malcolm99 Posted August 4, 2008 Share Posted August 4, 2008 Hi , I am sruggling to post information between two pages ? does anyone know what the problem could be , could it be a setting , could it be I am using on my second page . if(isset($_POST['submit'])) { else echo "error "; And an error shows ? any suggestions ? Link to comment https://forums.phpfreaks.com/topic/118053-posting-problems/ Share on other sites More sharing options...
JasonLewis Posted August 4, 2008 Share Posted August 4, 2008 This is a basic form posting script. You have your HTML page: <form action="process.php" method="post"> Your Name: <input type="text" name="your_name" /><br /> <input type="submit" name="submit" value="Show My Name!" /> </form> On process.php you would have something like this: //Check to see if form has been submitted... if(isset($_POST['submit'])){ //It has, lets echo out there name, if they supplied one. $name = $_POST['your_name']; if($name == ""){ //Name has not been entered echo "You did not enter your name."; }else{ //Name has been entered echo "Hello ".$name."!"; } }else{ //They went to this page without submitting the form! echo "Hey! Go and submit the form!"; } Just an example. Very basic. Link to comment https://forums.phpfreaks.com/topic/118053-posting-problems/#findComment-607308 Share on other sites More sharing options...
vikramjeet.singla Posted August 4, 2008 Share Posted August 4, 2008 As mentioned by "ProjectFear" use post as a method in form tag.... double check your form method... Link to comment https://forums.phpfreaks.com/topic/118053-posting-problems/#findComment-607381 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.