Dear friends, I have created a html page with dynamic select boxes and included the below line in the form <form action="sqlpage.php"target="_blank" method="post"> HTML: The mentioned sqlpage.php contains some php code with head,body and html tags which connects to MySQL DB and search for queries and displays the results on a webpage. But when i run the html page and enter search terms in the query box and click search it directs to this sqlpage and i don't see any results but the php code is displayed as it is on the page. But when i run the page as http:localhost/sqlpage.php it gives perfect results. I guess there is some misinterpretation between html and php. I would be thankful if someone help me in this matter. Thanks in advance. Kind Regards Aravind
as i said when i try the sqlpage.php using localhost it gives me correct results in the way i want but when i give it to html page then i get this error of displaying all the code
Here is the code <script type="text/javascript"> function populate(o) { d=document.getElementById('de'); if(!d){return;} var mitems=new Array(); mitems['Select class']=['Select subclass']; mitems['x']=['All','subclass1','subclass2']; mitems['y']=['All','value1','value2']; mitems['z']=['All','value1,'value2']; mitems['w']=['All','value1','value2']; d.options.length=0; cur=mitems[o.options[o.selectedIndex].value]; if(!cur){return;} d.options.length=cur.length; for(var i=0;i<cur.length;i++) { d.options[i].text=cur[i]; d.options[i].value=cur[i]; } } </script> <select name="class" id="or" onchange="populate(this)"> <option selected='selected' name="Select class">Select class</option> <option name = "x">x</option> <option name = "y">y</option> <option name ="z">z</option> <option name ="w">w</option> </select> <br /> <label for="de">Subclass</label> <select name="subclass" id="de"> </select><br /> HTML:
If it displays the php code of that file it seems like your server doesn't have PHP installed/configured right
thanks to all, i have solved my problem.....it was due to some problems in the installation of the server and configuration
the html file with the php code was not on the server so the browser prints the PHP code as it is and when i moved the file to the server directories it worked like charm....thanks to all of u....will be back again if i have some problem..... cheers, Aravind