Page redirection and data in the URL

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

Post Reply
sajsal
Forum Newbie
Posts: 1
Joined: Fri May 21, 2004 4:48 am

Page redirection and data in the URL

Post 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
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post 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.
Post Reply