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
Dear All, Thanks for the replies. I am using WAMP so it coems with Apache, PHP and MySQL and i even checked with Phpinfo() and i have php. Could soem one tell me how to check for html also and i saw in lot of forums they speak about .htaccess file and i couldn't find it. Here is the output that my results page displays: "; $link = mysql_connect('localhost','root'); if (!$link) { die('Could not connect to MySQL database ' . mysql_error()); } echo 'Connected to the Database. Please scroll down for the results'. " "; mysql_select_db("Human-Mouse") or die(mysql_error()); // Query statement with Inner join if ($subject == NULL && $subclass != "All") { $result = mysql_query("SELECT * FROM differences d INNER JOIN `references` r on d.reference = r.reference WHERE class = '$class' AND subclass LIKE '%$subclass%'") or die (mysql_error()); } else if($subclass == "All" && $subject != NULL) { $result = mysql_query("SELECT * FROM differences d INNER JOIN `references` r on d.reference = r.reference WHERE class = '$class' AND subject LIKE '%$subject%' OR human LIKE '%$subject%' OR mouse LIKE '%$subject%'") or die (mysql_error()); } else if($subclass == "All" && $subject == NULL) { $result = mysql_query("SELECT * FROM differences d INNER JOIN `references` r on d.reference = r.reference WHERE class = '$class'") or die (mysql_error()); } else { $result = mysql_query("SELECT * FROM differences d INNER JOIN `references` r on d.reference = r.reference WHERE class ='$class' AND subclass LIKE '%$subclass%' AND subject LIKE '%$subject%' OR human LIKE '%$subject%' OR mouse LIKE '%$subject%'") or die(mysql_error()); } if (mysql_num_rows($result)==0 ) { die('Sorry. No results could be found with your query. Please try with other keywords.' . mysql_error()); } echo ''; echo ''; // Columns names of the table echo ''; echo ''; while($row = mysql_fetch_array($result)) { // linking the reference key to its url $hyperlink = ''.$row[6].''; // start of a new row echo ''; //loop through elements (ie td's) echo ""; echo " "; echo ''; } echo ' Class Subclass Subject Human Mouse Reference $row[1] $row[2] $row[3] $row[4] $row[5] $hyperlink '; mysql_free_result($result); ?> This is the PHP code searching in the MySQL db and it is printed as it is on the webpage. NOTE: My webpage has not been published yet. It is only on my PC
thanks to aall for trying.....i have solved the problem......its due to error in the installation and configuaration of PHP and HTML details in the WAMP server......now its running as i expected.....