giridharseel Posted February 17, 2009 Share Posted February 17, 2009 Hello,my problem is that data in fields are not posted to another page,, plz explain i had build a test.html page,,the code in this page is <html><body><table width="100%" border="0"> <tr> <td><form name="form1" method="post" action="get.php"> <table width="100%" border="0"> <tr> <td colspan="2"><div align="center"><strong>Get Your Mysql Host Details</strong></div></td> </tr> <tr> <td width="14%">Mysql Host</td> <td width="86%"><label> <input name="host" type="text" id="host" size="45"> </label></td> </tr> <tr> <td>Mysql username</td> <td><label> <input type="text" name="username" id="username"> </label></td> </tr> <tr> <td>Mysql Password</td> <td><label> <input type="text" name="password" id="password"> </label></td> </tr> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Submit"> </label></td> </tr> </table> </form> </td></tr></table> </body> </html>when i click the submit button it goes to the page called test1.phpthe code in this page is<?php$host=$_POST["host"];$username=$_POST["username"];$password=$_POST["password"];$con = mysql_connect("$host","$username","$password");echo "MySQL host info: " . mysql_get_host_info($con) . "</br>";echo "MYSQL server info: " . mysql_get_server_info($con) . "</br>";echo " MYSQL client info: " . mysql_get_client_info();?> Link to comment Share on other sites More sharing options...
Synook Posted February 17, 2009 Share Posted February 17, 2009 You are sending the data to a page called get.php. However, your action page is actually called... Link to comment Share on other sites More sharing options...
giridharseel Posted February 18, 2009 Author Share Posted February 18, 2009 i dont understand wat u mean action page in your terms, but i cannot understand watz the problem,,i think the problem is with php version (i think wat i am using is object oriented php)my server details goes here,, plz explain sir#Operating systemLinux#Apache version2.2.11 (Unix)#PHP version5.2.8#MySQL version5.0.67 Link to comment Share on other sites More sharing options...
Synook Posted February 18, 2009 Share Posted February 18, 2009 Your process page, the one the form is supposed to be sent to, is called test1.php. However, in your form, the destination is stated as get.php. So the data doesn't get through.Don't worry, your code is entirely procedural. Link to comment Share on other sites More sharing options...
giridharseel Posted February 18, 2009 Author Share Posted February 18, 2009 if i put test.php in action also it does not goin to send the data ... Link to comment Share on other sites More sharing options...
Synook Posted February 18, 2009 Share Posted February 18, 2009 Do you see any errors? Link to comment Share on other sites More sharing options...
giridharseel Posted February 18, 2009 Author Share Posted February 18, 2009 no,,i dont see any errors,,is this happening bcoz of php versions,,,my php versions are posted in last posts Link to comment Share on other sites More sharing options...
jeffman Posted February 18, 2009 Share Posted February 18, 2009 Do some basic debugging. At the top of your script, add this:var_dump($_POST);See if there are any values there.Ater your call to mysql_connect(), add this:echo $con;If you have a true connection, you should get a resource ID. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 18, 2009 Share Posted February 18, 2009 When I copy and paste your HTML code and press submit, it tries to load get.php, not the current page.Do you have a get.php? Can you post the code for it? Is it redirecting back to the form page? Link to comment Share on other sites More sharing options...
giridharseel Posted February 20, 2009 Author Share Posted February 20, 2009 yes,i have get.phpbut why this happening, i cannot understand.plz explain other procedure,how can i do? Link to comment Share on other sites More sharing options...
Synook Posted February 20, 2009 Share Posted February 20, 2009 You could show us get.php? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.