Jump to content

sbrownii

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by sbrownii

  1. If you use php, you just need to know where you want the messages too show upYou could use values in the query string to tell you which fields need a message next to them.When your php runs it can just check when it gets to each field whether it needs to print a message for it or not.For example... when you search on most forums, it highlights the words in the post that match your search terms.Look here-> http://w3schools.invisionzone.com/index.ph...471&hl=selectorI searched for selector, clicked the link to that post and look at the url... it says "hl=selector". This tells the page to highlight the word "selector".If you look at the source will see a style entry like this .searchlite{ background-color: yellow; font-weight: bold; color: red;} Search for "searchlite" OR "selector" in the source and you will find something like this: <span class='searchlite'>selector</span> for the fun of it just change the url of this topic so it is like thishttp://w3schools.invisionzone.com/index.ph...opic=2534&hl=onChange "on" to any word you want...I'm sure I didn't have to talk about it so much... just wanted to show that what you are trying to do has been done many times.In your case, you don't so much care to change the class of a word, you just need to decide to show it, or not, using information passed through the query stringPerhaps you call the previous page like this to show that the password field needs to be corrected: mysite.com/mypage.php?password=error Then in your php you could do something like this <input type="text" name="email" value=""/><?phpif (isset($_GET['password'])){ echo "<span class='error_message'>Required!</span>";}?><input type="password" name="password" value=""/> I don't know if that's the kind of thing you are looking to do...You can use something like that, but you would lose the form info between pages unless you pass it back and forth. Passing user info using the query string is not very good as far a security goes....
  2. Seems this thread got very off... topic....As far as suggestions go... I think it would be nice if all the non-standard examples/tutorials were removed...By including such tutorials w3schools.com is simply furthering the Microsoft cause... not the W3C standards. People who nothing about the web come here... and learn how to write code that only works with IE. I wish they couldn't find any code like that on a site such as this.There are certain issues were IE does things one way and other browsers another, in that case, those cross-browser issues should be explained - but not things that ONLY work in IE and are not a part of any standard in any way!It is interesting to see people on these forums having problems gettings something to work, until they realize that they can only use IE for many of the examles/tutorials!!!!!
  3. The table will be created in the database that is currently selected. If you haven't selected a database, you can't create a table... or do much of anything else for that matter!If you try to execute a CREATE statement without selecting a database... it will fail.By selecting I mean in your code you need to specify which database to use. Not you need to choose a database as in MySQL versus Oracle, but as in You have 3 databases created inside your MySQL server and you need to choose which one to work with.
  4. sbrownii

    XML Data Islands

    BTW....Full XML support != supporting <xml> tagMany many many browsers support xml/xslt... many many....Supporting particular html tags (especially ones that don't even exist!) and supporting xml are totally different issues. You can find many sites that have even moved to xml (atleast out of the sites I frequent), and I have no problem viewing them in links, dillo, firefox, .... the list goes on...
  5. sbrownii

    Changing Languages

    Did you add a meta tag similar to this?? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" > and if you did... did you SAVE your file as UTF-8???What editor do you use???If you use notepad, click "Save As..." and look at the bottom of the Save Dialog to find "encoding" - Make sure it is set to "UTF-8" and not ANSIIHope this helped...
  6. sbrownii

    Dynamic Gallery

    Have you ever thought about searching the net??????????????If it is just hard to type...then click here -> http://clusty.com/search?query=php+image+gallery+tutorialIt is amazing what all is on the internet... There are all these cool search engines that lead to all kinds of knowledge...BTW... did you follow the links to the php manual that hacknsnack gave???Read the examples given there for readdir()... just while you loop through, add the things you want to your array!
  7. OK....You should study php a little more (if you are brave go to http://php.net )...It's not your fault you don't know... the tutorials here don't seem to talk about it... atleast not in regards to phpthe address might show http://w3schools.invisionzone.com/index.php?showforum=35 The actual file is located at http://w3schools.invisionzone.com/index.phpThe "?" lets us know that everything after that is information begin sent to that page. The info is given in name=value pairs. So in this case "showForum" is equal to "35". This "info" most often called a query string.So this index.php page might have code inside like this $showForum = $_GET['showForum']; This is a way to pass information to web pages so they can use it. In this case instead of writing hundreds of pages, one amazing index.php file is written to take info like what forum to show and it does the work dynamically...That is half the beauty of php and other server-side scripting! That is why you see it in so many address! Especially forums like this!!!!!Some more about this idea of passing info to pages can be found here -> http://www.w3schools.com/php/php_forms.aspHope this helped a bit...
  8. There are many ways!This is a php forum, but my suggested solution is javascript - that way you don't have to actually reload the page! One way would be to just add some span tags or something similar to your page next to the fields you are validating. Have the span tag contain your error message. Assign the id attribute to something meaningful - if the message is related to the password field name it "password_message". Set the span tag's class attribute to something meaningful - for example "hidden_message". Then when validating change the class of the desired span tag to something like "visible_message". Use css to define styles something like this: .visible_message{display:inline;color:#cc0000;}.hidden_message{display:none;} Use javascript for changing the class. You could use a function similar to this: function show_message(message_field_id){ message_field = document.getElementById(message_field_id); message_field.className = "visible_message";} You should set the "onsubmit" attribute of your form to something like <form action="submitpage.php" onsubmit="return validate_form()" method="post"> Make sure the validate_form() function returns true if everything passes validation, and false otherwise.There may of course be different and better ways. But this way certainly works...... I thought of posting a whole working example... but figured that might take all your fun away... you can see a simple example here -> http://sbrownii.tripod.com/form.html
  9. I'm not sure which page you went from to get to that particular "try it" page.Here is a quote from a page here->http://www.w3schools.com/xml/xml_data_island.asp You will also find some of the examples using javascript with xml use the IE only solution.<!-- The following comment should be ignored by all browsers that can't understand it!I personally thought I read somewhere that w3schools was for tutorials on things standardized by the W3C. I am constantly surprised to find so many examples favoring the NON-STANDAR IE way of doing things...-->OH WELL... the answer to your question as far as I know is that those things don't work in firefox because they don't exist in any specification other than Microsoft's ( just try to look through any of the html/xhtml specifications for an xml tag! ). It is NOT a problem with firefox!
  10. I use Korean, which has the same issues as Chinese. You can usually install an IME for the language you want to use - in your case Chinese. This is true for windows and linux. The IME gives you a way to input that language. Just search the internet for Chinese IME.If you are on WinXP, just go to the control panel and select "Regional and Language Settings". Select the "Languages" tab. Click on "Details". You should see a section called "Installed Services" with English listed. Click the "Add" button. Choose your Input Language and IME.There may be a checkbox on the "Languages" tab that says something about installing files for East Asian Languages... I think this might include Chinese... but I'm not sure...I use notepad very often on an English version of WinXP and have no problems entering Korean text. You should be sure to define the encoding of the page using meta tags: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> I prefer using utf-8 because I use a mix of languages. Make sure that you actually save the files in the same charset that you specifiy in the meta tag - in notepad choose "Save As..." and choose UTF-8 as your encoding.Hope this was atleast a little helpful.
  11. I found the same problem with the AJAX tutorial example.The javascript console seems to gripe about the googlead code - but it mostly seems to be about things in the style tags.It sure was nice to see that the script tag used to include the external .js file had no attributes except for 'src' - way to set the example.I'm wondering if the problem in the end is not the javascript though. Not even sure if it is only in firefox. I couldn't view any of the tutorial sections using IE, so not sure if other ppl have the problem in IE.I ran the script at home and changed the server-side script to php, but kept the idea the same, and it runs fine. The only change I made to the javascript file was to change the "asp" in the url of the server-side script to "php". I also did add the type attribute to the script tag, but it works without it.So again, it would seem either the problem is with the server-side script, or there is some other script on the page causing the problem.
×
×
  • Create New...