Jump to content


Photo

Contact Forms Reciept


  • Please log in to reply
5 replies to this topic

#1 wizzkid

wizzkid
  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 02 July 2006 - 02:25 PM

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:
<?
print "Thank you".$_POST['fname']."<br>;"
?>

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.


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 July 2006 - 02:48 PM

put the fname in a seesion then print user name ok.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 wizzkid

wizzkid
  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 02 July 2006 - 03:33 PM

how can i declare session? can you point me where to get docs and how to do it? sorry im newbie :)

#4 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 02 July 2006 - 03:51 PM

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
:: gucci.com ::
:: blockbuster.com ::

--------------------

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 July 2006 - 03:56 PM

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
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#6 wizzkid

wizzkid
  • Members
  • PipPipPip
  • Advanced Member
  • 39 posts

Posted 02 July 2006 - 04:07 PM

Hey guys, thank you so much for the help! really appreciate it a lot :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users