PHP Session variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have retrieved 4 values from database. Out of which 3 are displayed on the
same page and one variable, which is email address, needs to be carried to
the next page through a hyper link, the next page is actually a web form. I
can do this by either transferring that variable through query string or
through session.

Now the next page which is a web form is connected to a file that sends
email using php email functionality.

The problem I am having is just sending this $email variable from page one
to the web form. Once it reaches the web form, I need to again pass it to
the file that has php email functionality. How to send the variable across
these pages. 

I tried:
On Page 1:

<?
$query="SELECT val1, val2, val3, email FROM table WHERE no= '$no'";

$result=mysql_query($query);
$num=mysql_numrows($result);

mysql_close();
$1=mysql_result($result,$i,"1");
$2=mysql_result($result,$i,"2");
$3=mysql_result($result,$i,"3");
$email=mysql_result($result,$i,"email");
session_start();
session_register ("tamma");	
$HTTP_SESSION_VARS ["tamma"] = $email;
?>



On the webform:

<? 
	$HTTP_SESSION_VARS ["email"] = $email;
	
?>


on the php email page it's like this:

<?
  $name = $_REQUEST['name'] ;
  $emailid = $_REQUEST['emailid'] ;
  $subject = $_REQUEST['subject'] ;
  $message = $_REQUEST['message'] ;
  $email = $_REQUEST['email'] ;

  mail( $email, $name, $message, "From: $emailid" );
  header( "Location: thankYouContact.php" );
?>


Please advice a work around for this if I am doing it wrong. I know I am.

Chris
-- 
View this message in context: http://www.nabble.com/PHP-Session-variable-tf3473378.html#a9693267
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux