going back to previous page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rlm51
    New Member
    • Mar 2007
    • 29

    going back to previous page

    Hey ... how is everyone ...

    I want to put a button on a page that does a "back to previous page" using

    a href="<?php $_SERVER['HTTP_REFERER'] ?>" />

    attached to the button but it doesn't work. Do I have an error in syntax?

    Thanks for your help

    Robert
  • aktar
    New Member
    • Jul 2006
    • 105

    #2
    Originally posted by rlm51
    Hey ... how is everyone ...

    I want to put a button on a page that does a "back to previous page" using

    a href="<?php $_SERVER['HTTP_REFERER'] ?>" />

    attached to the button but it doesn't work. Do I have an error in syntax?

    Thanks for your help

    Robert

    with PHPs short tags you can do something similar to what youv'e done, which is: [PHP]<?=$_SERVER['HTTP_REFERER']; ?>
    [/PHP]

    which is the same as :
    [PHP]<?php

    print $_SERVER['HTTP_REFERER'];

    ?>[/PHP]

    On PHP5 short tags are off by default, so you will need to do it the traditional way.

    Dont forget the semi-colon (;)

    Comment

    • rlm51
      New Member
      • Mar 2007
      • 29

      #3
      Thanks very much ...

      As Always ... I love this forum.

      Robert

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Originally posted by rlm51
        Thanks very much ...

        As Always ... I love this forum.

        Robert
        We all do!

        Ronald

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Originally posted by ronverdonk
          We all do!

          Ronald
          ...otherwise we wouldn't be here! ^_^

          DM

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by aktar
            with PHPs short tags you can do something similar to what youv'e done, which is: [PHP]<?=$_SERVER['HTTP_REFERER']; ?>
            [/PHP]

            which is the same as :
            [PHP]<?php

            print $_SERVER['HTTP_REFERER'];

            ?>[/PHP]

            On PHP5 short tags are off by default, so you will need to do it the traditional way.

            Dont forget the semi-colon (;)
            As is always said: do your best not to use short tags - it may cause alot of hassle when migrating from one server, with short tags on, to another server, with them off.

            [php]
            <?php echo $_SERVER['HTTP_REFERER'];?>
            [/php]
            I'm surprised im the first person to say this, actually.

            Originally posted by ronverdonk
            We all do!

            Ronald
            Yes, yes we do.

            Retards, markus.

            Comment

            Working...