I haven't used sessions before, but it doesn't look like the variables are
being put into the session.
If they're coming from a form, then they would appear in the $_POST or
$HTTP_POST_VARS variables, not the $HTTP_SESSION_VARS variable.
HTH
Martin
-Original Message-
From: Dave G [mailto:[EMAIL PROTECTED]
Sent: Monday, 22 December 2003 4:34 PM
To: 'PHP General'
Subject: [PHP] Why won't this form post session variables?
PHP Gurus,
I'm really stuck here. I've written the following code, and it
will never execute the if statement. I keep getting the form
displayed,
and when I fill the form and hit the submit button, the
HTTP_SESSION_VARS array does not seem to take any of the
values set out
in the form.
Is there an error in this code? I've checked and double checked,
but I can't see why the variables wouldn't post. Any advice much
appreciated.
session_start();
if(isset($HTTP_SESSION_VARS['episodeTitle'])
isset($HTTP_SESSION_VARS['episodePP']))
{
$episodePP=addslashes($HTTP_SESSION_VARS['episodePP']);
$episodeTitle=addslashes($HTTP_SESSION_VARS['episodeTitle']);
db_connect();
$insertPPQuery = INSERT INTO scripts (title, plotpoints) VALUES ( .
$episodeTitle . , . $episodePP . );
$insertPPResult = mysql_query($insertPPQuery);
unset ($HTTP_SESSION_VARS['$episodeTitle']);
unset ($HTTP_SESSION_VARS['$episodePP']);
echo 'Your episode, ' . $episodeTitle . ', has been saved. Would you
like to a href=addplotpoint.phpadd another episode/a?';
}
else
{
echo 'Enter in a new episode in plot point form.brbr';
echo 'form action=thispage.php method=post name=newPPbr';
echo 'Title:br';
echo 'input type=text name=episodeTitle size=75br';
echo 'Text:br';
echo 'textarea name=episodePP rows=10 cols=55/textareabr';
echo 'input type=submit name=submitButton value=Upload';
echo '/form';
}
--
Yoroshiku!
Dave G
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__ Information from NOD32 1.582 (20031218) __
This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php