johnseito Posted July 21, 2008 Share Posted July 21, 2008 Hello, Could someone show me a code example of when a user click on the submitted button on a form after filling it out, that all these information will be on another php program. For example: userinput.php (click submitted --- after filling the input field) inputresult.php (show the result of the data filled in this page) Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/115763-submitted-click-result-infor-on-another-php-program/ Share on other sites More sharing options...
jonsjava Posted July 21, 2008 Share Posted July 21, 2008 userinput.php <form method="POST" action="inputresult.php"> <input type="text" name="username"> <input type="password" name="password"> inputresult.php <?php print_r($_POST); ?> dirty example, yes. but that will show you how it works. Quote Link to comment https://forums.phpfreaks.com/topic/115763-submitted-click-result-infor-on-another-php-program/#findComment-595128 Share on other sites More sharing options...
johnseito Posted July 21, 2008 Author Share Posted July 21, 2008 what if I created a database and store all the users input, I want to show all of it on inputresult.php I created a example with while loop fetch and it shows blanks so far. Quote Link to comment https://forums.phpfreaks.com/topic/115763-submitted-click-result-infor-on-another-php-program/#findComment-595167 Share on other sites More sharing options...
johnseito Posted July 22, 2008 Author Share Posted July 22, 2008 Here is an example <?php mysql_connect("localhost", "xxx", "xxx");//CONNECT TO MYSQL mysql_select_db("test"); //SELECT DATABASE $data = mysql_query("SELECT * FROM register"); // or die(mysql_error()); while($info = mysql_fetch_array( $data )) { print <<<HERE <h1>Registered</h1> <p>Thank you, you have registered - you may now login</a>.</p> <table border=0> <tr><td width=200><font color=black>First, Last Name: </font></td> <td><font color =gray> $info[firstname] ,$info[lastname] </font></td></tr><br> <tr><td><font color=black>Gender: </font></td> <td> <font color =gray>$info[gender] </font><BR></td></tr> <tr><td><font color=black>Birthday: </font></td> <td><font color =gray>$info[month] $info[day] $info[year] </font></td><BR></tr> HERE; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/115763-submitted-click-result-infor-on-another-php-program/#findComment-596116 Share on other sites More sharing options...
johnseito Posted July 23, 2008 Author Share Posted July 23, 2008 userinput.php Code: <form method="POST" action="inputresult.php"> <input type="text" name="username"> <input type="password" name="password"> inputresult.php Code: <?php print_r($_POST); ?> dirty example, yes. but that will show you how it works. This code looks good, but lets say for example, I only want to post what is filled when everything is filled(CONDITION) how would I do that with this code then? You know what I mean? Quote Link to comment https://forums.phpfreaks.com/topic/115763-submitted-click-result-infor-on-another-php-program/#findComment-597081 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.