Reload menu selection in form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

scorphus wrote:I don't belive $_POST is available when the user press the back button. It seems to be a browser issue. Did you try JAM's solution already?
filch:
I tried this (my prev post) using similiar data on one of my own projects, with success...
You might not care to test yourself, but others might, hence this note.

Edit: Misleading direction of comments fixed.
Last edited by JAM on Mon Oct 27, 2003 7:46 pm, edited 1 time in total.
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

I said "I don't belive" because I was sure about that. So sure that I did not want to waste my time with a simple test...

Btw, I tested it right now and get (as you no doubt have guessed) not success.

My test:

Code: Select all

<html>
<head>
	<title>.o0o.</title>
</head>

<body>

<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST" name="form1">
	<input type="text" name="test">
	<input type="submit" name="go" value="Go">
</form>
<pre>
<?php
print_r($_POST);
?>
</pre>

</body>
</html>
Write something in the text filed, press the submit button and then press the browser's back button. You'll get an empty $_POST. Reload it: empty $_POST. Hold Shift key and reload it: empty $_POST.

Best regards,
Scorphus.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Oh sorry, I was quoting you, but not replying to you.

Perhaps not the smartest way to make a comment, by quoting someone else first... I read it the same way you did, but I was directing the "testing it" issue to the one that had the original problem/question.
Post Reply