Re: Page/Form caching

From: Date: Tue, 30 Mar 2004 03:07:50 +0000
Subject: Re: Page/Form caching
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-23304@lists.php.net to get a copy of this message
Jim Macdiarmid wrote:
Hi everyone, I think I'm having some issues with page/form caching and I'm not sure how to turn it off just for the current page, or if that is the proper thing to do. When I click submit on the form, the page redisplays however it doesn't seem like any processing is taking place. This is how I've structured my page.. I have the form action calling $_SERVER['PHP_SELF'] and the method is post.
Setting action = $_SERVER['PHP_SELF'] is why you are getting the same page back.
<?php /* attempting to loop through the $_POST global here
I hope you're doing variable checking here. Perhaps something like: <?php $valid = true; if (empty($_POST['emptyvar'])) {
    $valid = false;
} if (!is_string($_POST['stringvar'])) {
    $valid = false;
} ... if ($valid) {
    header('next_script.php');
} ?> Although if you have the time to invest, I suggest you try a PEAR package called HTML_QuickForm. Once you learn how to use it you can create new forms (with validation) quickly.
?> <HTML> <HEAD></HEAD> <BODY> ..etc... </BODY> </HTML> <?php /* php function code here */ ?> Any help to resolve this will be very appreciated, Jim


« previous php.windows (#23304) next »