wizzkid Posted July 2, 2006 Share Posted July 2, 2006 Hi Guys,I made a contact form that actually the value to the specified email address. What it does is let the user verify the detail entered and send to the email and have a reciept. My problem lies on the reciept. Here's my pages http://www.leeph.net/pastebin/test/Everything is working. contacts.phpverify.phpmailman.php reciept.phpnote: on verify.php action=mailman.php and redirect = reciept.phpWhat I want to do is display:Thank you NAME, we will respond you at EMAIL.What I did is on reciept.php, i put:[code]<?print "Thank you".$_POST['fname']."<br>;"?>[/code]I am not sure if its the correct syntax. I used the $_POST['fname'] on verify.php and it worked.Should you need some clarification about this setup. let me know.hoping a response to this matter.Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/13456-contact-forms-reciept/ Share on other sites More sharing options...
redarrow Posted July 2, 2006 Share Posted July 2, 2006 put the fname in a seesion then print user name ok. Quote Link to comment https://forums.phpfreaks.com/topic/13456-contact-forms-reciept/#findComment-51998 Share on other sites More sharing options...
wizzkid Posted July 2, 2006 Author Share Posted July 2, 2006 how can i declare session? can you point me where to get docs and how to do it? sorry im newbie :) Quote Link to comment https://forums.phpfreaks.com/topic/13456-contact-forms-reciept/#findComment-52007 Share on other sites More sharing options...
Drumminxx Posted July 2, 2006 Share Posted July 2, 2006 actually what your doing is just fine, good job.now if you are going to use the persons name as they browse around the site then you could put the name into a session.this site has a good tutorial on sessions but for the short version, a session is just a cookie on the server (not the client) computer and you create it like thissession_start();$_SESSION['name'] = $_POST['fname'];now later on when you want to use that name again just call $_SESSION['name']like thisecho "Hello " . $_SESSION['name']just be sure to put session_start() at the top or before any output is sent to the browser of all your pages to keep it alive Quote Link to comment https://forums.phpfreaks.com/topic/13456-contact-forms-reciept/#findComment-52010 Share on other sites More sharing options...
redarrow Posted July 2, 2006 Share Posted July 2, 2006 test.php<? session_start();// set the session session_start(); on all pages to return data and no html can go before it.$fname="john";$username=$_SESSION[''username']=$fname;//username is the varable for the session.// $_SESSION['username'] is the session that gets and holds the users name//$fname was the name of the userecho"<a href='test_result.php'>go and see the name of the user</a":// echo a link to see the next page.?>test_result.php<? session_start();// set the session_start() aginecho $username;// echo the varable that was set via the session.?>link to session information ok.http://uk.php.net/session Quote Link to comment https://forums.phpfreaks.com/topic/13456-contact-forms-reciept/#findComment-52011 Share on other sites More sharing options...
wizzkid Posted July 2, 2006 Author Share Posted July 2, 2006 Hey guys, thank you so much for the help! really appreciate it a lot :) Quote Link to comment https://forums.phpfreaks.com/topic/13456-contact-forms-reciept/#findComment-52016 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.