Parsing variable with <a href>

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Igor

    Parsing variable with <a href>

    Hello,
    i moved some scripts from one server to an other server (not my own, but
    on different service providers).
    The next script is not working anymore, i can't send a variable with a <a
    href> command. Does anybody know why???

    The file TEST.PHP:

    <html>
    <body>

    <?php
    print ("Var is $var");
    ?>
    <a href="test.php? var=1">testlink </a>

    </body>
    </html>

    Greetings Igor
  • Harry

    #2
    Re: Parsing variable with &lt;a href&gt;

    Igor wrote:[color=blue]
    > Does anybody know why???[/color]
    It is working, you just don't know it is, it comes from the fact that
    register_global s is turned off.

    use $_GET['var'] instead of $var, or assign one into the other.
    [color=blue]
    > print ("Var is $var");[/color]

    becomes

    print ("Var is ".$_GET['var']);

    or

    $var = $_GET['var'];
    print ("Var is $var");


    H

    Comment

    • Igor

      #3
      Re: Parsing variable with &lt;a href&gt;

      That's the information i needed, is this just the difference between PHP3
      and PHP4 or is my example just dirty php work??

      Harry <harryman100@gm ail.com> wrote in news:I76EAq.EDH @bath.ac.uk:
      [color=blue]
      > Igor wrote:[color=green]
      >> Does anybody know why???[/color]
      > It is working, you just don't know it is, it comes from the fact that
      > register_global s is turned off.
      >
      > use $_GET['var'] instead of $var, or assign one into the other.
      >[color=green]
      >> print ("Var is $var");[/color]
      >
      > becomes
      >
      > print ("Var is ".$_GET['var']);
      >
      > or
      >
      > $var = $_GET['var'];
      > print ("Var is $var");
      >
      >
      > H
      >[/color]

      Comment

      • Michael Fesser

        #4
        Re: Parsing variable with &lt;a href&gt;

        .oO(Igor)
        [color=blue]
        >That's the information i needed, is this just the difference between PHP3
        >and PHP4 or is my example just dirty php work??[/color]

        Chapter 28. Using Register Globals
        PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


        Micha

        Comment

        Working...