Page 1 of 1

Page redirection and data in the URL

Posted: Fri May 21, 2004 4:48 am
by sajsal
Hi all

I have developed a form validation script which works as:

1) User fills in the form and presses submit. The form is posted on the same page.
2) A validation script (validate()) executes for the whole form and checks each object for the validation rules specified during form creation.

3) If there is any error i the form the validate() displays the same form with error fields marked with *, otherwise the validate() redirects to the next page. The redirection works as follows:

foreach ($_REQUEST as $field => $fieldValue){

$fieldName = $field;
$fieldValue = $_REQUEST[$fieldName];
$tString = $tString . $fieldName. "=" .$fieldValue. "&";
}

$PageRed= $successPage."?". $tString;

header("Location: http://" . $_SERVER['HTTP_HOST']. dirname($_SERVER['PHP_SELF']). "/" . $PageRed);
exit();

Now I am having problems in the case when the form contains large data object e.g. Textarea. because there is a restriction that in the url we can send a specific length of data.

I would like to have something similar to "Server.execute or Server.Transfer" in ASP.

Can anyone help in this regard.

Regards

Posted: Fri May 21, 2004 6:33 am
by launchcode
There is a limit on the querystring - but it's a VERY large one.

Even so it doesn't look tidy. Why not just place all of the values into a session and redirect back to your form which can populate the contents based on the session values. Keep going in a loop like this until there are no errors.