Advanced Search

Results 1 to 2 of 2

Thread: PHP Successfully validate then pass variables across multiple pages

  1. #1
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default PHP Successfully validate then pass variables across multiple pages

    Okay I have finally figured out how to pass variables across multiple pages by using the following code.

    PHP Code:
    <?php
    foreach ($_POST as $key => $val) {
    echo 
    '<input type="hidden" name="' $key '" value="' $val '" />' "\r\n";
    }
    ?>

    Now I am stuck on how to validate each field without using any JavaScript. I usually use:


    PHP Code:
    <form action="<?php $_SERVER['PHP_SELF'?>" />

    However, I cannot use that code and pass variables to the next page. Can anyone please help me successfully validate and pass form fields across several pages?

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    Why not use SESSION variables instead.

    This is a fairly easy way of passing variables to multiple pages with no intricate code needed to access the variable values.

    Have a look at how to use SESSION variables and see if that meets your requirements

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •