Jump to content

Contact Forms Reciept


wizzkid

Recommended Posts

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.php
verify.php
mailman.php reciept.php
note: on verify.php action=mailman.php and redirect = reciept.php

What 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.
Link to comment
Share on other sites

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 this

session_start();
$_SESSION['name'] = $_POST['fname'];

now later on when you want to use that name again just call $_SESSION['name']

like this

echo "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
Link to comment
Share on other sites

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 user

echo"<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() agin

echo $username;
// echo the varable that was set via the session.
?>

link to session information ok.
http://uk.php.net/session
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.