Re: Not Allowing REload or REfresh with this script?
| From: | Chris Lee | Date: | Tue, 06 Mar 2001 13:39:13 +0000 |
| Subject: | Re: Not Allowing REload or REfresh with this script? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-42759@lists.php.net to get a copy of this message | ||
try this, your code example has some design flaws.
<?php
include_once('session.egn');
if (isset($HTTP_POST_VARS['submit']))
if ( isset($HTTP_SESSION_VARS['done']) AND $HTTP_SESSION_VARS['done'] ==
$PHP_SELF)
{
echo "a <br>\n";
echo "You can only press submit once <br>\n";
exit();
} else
{
echo "b <br>\n";
$done = $PHP_SELF;
session_register('done');
}
// do some code
echo "
<form method='post' action='$PHP_SELF'>
<input type='hidden' name='submit' value ='1'>
<input type='submit'>
</form>
";
?>
im not exactly sure on what
if (issset($userfile))
{
global $userfile;
unset($userfile);
} else
{
// do some code
}
this is supposed todo, what is the global there for? what does it do? please explain.
--
Chris Lee
Mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
lee@mediawaveonline.com
"Dhaval Desai" <dhaval_adams@yahoo.com> wrote in message news:20010306084242.61687.qmail@web10014.mail.yahoo.com...
Hi!
Well I need help with something. I have a form which
has a ction to a file called actio.php
Now When I hit the submit button. It goes to the file
and it performs a certain action as seen below:
action.php: is as follows:
<?php
if(isset($userfile))
{
echo "$userfile is set";
global $userfile;
unset ($userfile);
}
else
{
echo "Sorry buddy , Userfile is not set";
}
?>
My main intentyion is to unset the variable so that
When the page is REFRESHED or RELOADED. It should
execute the else code block.
I am trying to implement it on one of my websites
where users can not refresh a particular a page.
Thank You
Dhaval Desai
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net