How do I pass variables from a PHP script to an HTML document?

From: Date: Wed, 05 Dec 2001 18:00:32 +0000
Subject: How do I pass variables from a PHP script to an HTML document?
Groups: php.general 
Request: Send a blank email to php-general+get-76754@lists.php.net to get a copy of this message
Hi, I currently have a form that calls a PHP script when submit is pressed. Within the PHP script, I wish to call a custom confirmation screen. I do so by issuing the following command: Header("Location: " . $form["redirect"]); Now, I wanted my form variables passed from the PHP script to my HTML document so I wrote a function within the form that adds the variable names and values to the URL by urlencoing them like such: $output = "?"; $output .= urlencode($key) . "=" . urlencode(stripslashes($val)) . "&"; returning the above in a variable $vars, I call my redirect as such: Header("Location: " . $form["redirect"] . $vars); If I am not mistaken, this is synonymous with an HTTP GET? Here is my problem; the above fails with a large form, i.e., a form containing many fields. A bit of investigation has determined that there is a 1Kb limit on the total size of a request (URL+params) and I have one form that must be exceeding the limit. Question: Is there a way to emulate my above scheme via an HTTP POST as POST has no limit? Alternatively, is there another way to pass variables from a PHP script to a HTML form where I won't run into this limit? Thanks, Don

« previous php.general (#76754) next »