Hi,
I have a small search button on a website which does a really basic search on the MySQL database. However, the form tags keep disappearing. This seems really strange. The search button should look like this:
I have never known something like this to happen before so don't even know where to start in finding the problem. Has anyone had any experience of this before or know how to fix this problem???
Are you saying that the HTML you showed is generated by PHP? If so, it's that code that we need to see. If it is coming from a plain HTML file served by a web server, I don't see any way that it could omit a line.
The form is not generated by php. It is written in HTML, exactly as I have written it. There are some functions on the page that are written in PHP but they have absolutely nothing to do with the FORM. This is why this problem is so strange!
To see this in action. The code is on two different pages.
The really strange thing is how they sometimes seem to work perfectly and other times not at all. For instance, the first time the page is visited and a search is done using the box on the right, quite often the script will work and the search will be done. However, if you try and do a search again on the next page, pretty much everytime I have tried it it will not work, and if you look at that script you will see that the <form> tags have disappeared. Plus, the Bramcote Bulbs site seems to work the majority of the time, with just occasionally this happening. I have looked at both scripts in minute detail and they are identical so I just can't work out how this is happening. Any help would be so much appreciated!!!
I don't know what to tell you. I viewed both your URLs and used the search 4 or 5 times each, and everything was normal. The <form> tag was always there. I can only say that if there's some HTML (not generated by PHP) in a file, the web server will send it to the browser.
Problem is that on this page http://www.showglads.com/catalogue.php you have several opened <FORM> tags (for each item I guess), which are not closed (that's invalid html ofcourse) and browsers tries to fix them causing search form <FORM> tag to be removed, if you look at source (which comes from server, not firebug) form tag is there.
Hey,
Thanks for the help man, have now got rid of the other <form> tags completely and works perfectly. I think that <form> tag was a remnant of some previous work I had been doing.