www.webdeveloper.com
Results 1 to 8 of 8

Thread: [RESOLVED] Back link in php

Threaded View

  1. #1
    Join Date
    Dec 2008
    Posts
    138

    resolved [RESOLVED] Back link in php

    I am trying to get a back link to have two function. If it comes from a page in my website it will use the history.go(-1) function if it is from outsite it will go to a general page. I've tried the below script but it doesn't work.

    page 1 link <a href="page2.php?frompage=1">

    page 2 script and link.

    <a href="<?php echo $link ?>">Back to Page 1</a>

    PHP Code:
    <?php
    if(isset($_GET['frompage'])) {
        if(
    $_GET['frompage'] == 1) {
            
    $link "<a href='history.go(-1);'>";
        } else {
             
    $link "generalpage.php";
        }
    }
    ?>
    Last edited by phpnewbie08; 04-14-2014 at 02:40 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles