#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    20
    Rep Power
    0
    When attempting to create a nice confirmation screen after a form is submitted, I used <input type=hidden name=variable value=$variable> type fields to pass the variables on to the next php script that processes, adds to mysql and writes a file.. Anyways, the hidden field only passes the first word, which I understand, but how to pass the entire variable without creating a temporary file that holds each variable. There has to be a way.

    Thanks in advance

    ------------------
    ---------
    Lanny
    dtm
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    <input type=hidden name=variable value='$variable'>
  4. #3
  5. No Profile Picture
    raghuram
    Guest
    Devshed Newbie (0 - 499 posts)
    Dont make use of Hidden Fields, use Query String for passing from one page to another.

    Type this code in one.php3

    <?php
    $data = "Some Sample Data";
    echo "<A HREF=two.php3?data=", urlEncode($data), ">Page Two</A><BR>n";
    ?>

    Type this code in two.php3

    <?php
    echo $data;
    ?>
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    20
    Rep Power
    0
    As far as the "page.php3?var=$var" thing goes, the problem is I have 2 or 3 variables that need to be passed, not just the first.

    Any other suggestions would be appreciated,



    ------------------
    ---------
    Lanny
    dtm
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    page.php?var1=value1&var2=value2&var3=value3
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    20
    Rep Power
    0
    Thanks a million guys

    ------------------
    ---------
    Lanny
    dtm
  12. #7
  13. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    raghuram,

    Assuming you are passing a form anyway, it is much cleaner to use hidden elements then to combine GET and POST methods.

    Also, don't forget to urlencode() any variables passed via query string. The particular problem originally mentioned would NOT be solved by your example as the query string would be truncated at the first space (except if the visitor was using MSIE4.x or later).

    [This message has been edited by rod k (edited June 09, 2000).]
  14. #8
  15. No Profile Picture
    raghuram
    Guest
    Devshed Newbie (0 - 499 posts)
    Do you know i wont like working on IE. Always i use Netscape only. I've tried the same code which i've quoted above. It also works exactly in Netscape.

    Raghuram.

Similar Threads

  1. Passing POST variables
    By rlorenzo in forum PHP Development
    Replies: 11
    Last Post: June 6th, 2004, 02:00 PM
  2. Replies: 7
    Last Post: February 16th, 2004, 02:55 PM
  3. help with assigning variables, variable passing/ retrieval
    By pinkipodmini in forum PHP Development
    Replies: 0
    Last Post: February 13th, 2004, 09:40 PM
  4. Why variables aren't passing through the include()
    By sapien in forum PHP Development
    Replies: 7
    Last Post: November 12th, 2003, 09:35 PM
  5. Help passing variables from a text file via include()
    By c4ctuz in forum PHP Development
    Replies: 4
    Last Post: October 14th, 2003, 08:00 AM

IMN logo majestic logo threadwatch logo seochat tools logo