Pass same info to successive pages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jrsjrs
    New Member
    • Sep 2006
    • 24

    Pass same info to successive pages

    PAGE 1 - saved as yyyIntro.php is between the rows of periods.
    ..............
    The secret word is HAPPY.
    <TABLE>
    <A href=yyyConfirm .php?i=HAPPY>Se nd the secret word to page 2.</A>
    </TABLE>
    ..............
    PAGE 2 - saved as yyyConfirm.php
    ............... ...
    <?
    $i=$HTTP_GET_VA RS["i"];
    print "<BR>Word passed was - $i";
    ?>
    <BR><a href="yyySend.p hp?k=i">Send the secret word to page 3.</a>
    ............... ...
    PAGE 3 - saved as yyySend.php
    ............... ........
    <?
    $k=$HTTP_GET_VA RS["k"];
    print "Secret word passed to page 3 was - $k";
    ?>
    ............... .......

    The word HAPPY is sent properly from page 1 to page 2.
    How can I now continue to send the word HAPPY
    properly from page 2 to page 3?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    First: try to prevent using the $HTTP_* arrays. They are deprecated and will no longer be available in PHP 6.0. Use $_GET, $_PUT, $_REQUEST etc.
    The following shows the way to pass the value to script 3. You simply echo the value of $i in the value= attribute of the <a... statement.
    [php]
    <?php
    $i=$_GET['i'];
    print "<br />Word passed was - $i";
    ?>
    <br /><a href="yyySend.p hp?k=<?php echo $i; ?>">Send the secret word to page 3.</a>[/php]

    Ronald :cool:

    Comment

    • jrsjrs
      New Member
      • Sep 2006
      • 24

      #3
      Thanks ronverdonk.
      That solved the problem. I had a mental block on that one!
      Is there a website that has other tags that will be
      deprecated in php 6 ? So I don't waste any
      more time writing code with old tags.

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        The reports about what is in and maybe not in 6.1 are constantly changing. However, to be on the safe side, never use deprecated functions!

        Ronald :cool:

        Comment

        • public
          New Member
          • Sep 2006
          • 1

          #5
          Even I'm trying this example to incorpate in my work, but it's failed

          <?
          $i=$_GET['i'];
          print "<br />Word passed was - $i";
          ?>
          I just copied & pasted this whole stuff, but no message appeared on next page.

          Note: my URL is ok means.... http.....test.p hp?i=HAPPY

          Comment

          • ronverdonk
            Recognized Expert Specialist
            • Jul 2006
            • 4259

            #6
            To see what is going on you better show the code of all 3 snippets.
            PLEASE PUT THESE CODE BETWEEN [php] and [/php] TAGS!!!!

            Ronald :cool:

            Comment

            Working...