Please help, code not working when it should *SOLVED*
Posted: Tue Nov 16, 2010 9:51 am
PLEASE, PLEASE PLEASE HELP ME. This is driving me insane.
I have a form (form.php) that is submitted to itself. All it has to do is assign the text from the textarea to a session variable, simple yes?
It doesn't work, the session variable always remains empty, in fact the (if (isset)) check returns false, when it clearly isn't, I can see the data in the get request URL. However if I use...
It displays the contents of the textarea
This is driving me crazy, can someone please take a look. My code is below.
Also, it doesn't matter if I use a session variable or a erm... normal? variable. I just can't get the contents of the textarea into a variable. Server issue?
I have a form (form.php) that is submitted to itself. All it has to do is assign the text from the textarea to a session variable, simple yes?
It doesn't work, the session variable always remains empty, in fact the (if (isset)) check returns false, when it clearly isn't, I can see the data in the get request URL. However if I use...
Code: Select all
echo $_GET['report'];This is driving me crazy, can someone please take a look. My code is below.
Code: Select all
<?php
session_start();
if (isset($_GET['report'])) {
$_SESSION['session_report'] = $_GET['report'];
//do some other stuff
}
?>
<html>
<form action = 'form.php' method = GET>
Please submit your report below<br />
<textarea name='report'></textarea><br />
<input type='submit' value = 'Submit' />
</form>
</html>