Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    19
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Unhappy referring history automatically ???

    Hi,
    • I have a form in my site.when the form is submit successfully it's go to another page, which shows "submission is success".

    • and that page has a link to go back to a page which is viewing previously(before to form)


    • this is the code for it
      Code:
      <a href="javascript:history.go(-2)">Go back to previous</a>


    I want to know, how to go to previous page by automatically??? this should be happen after 10 seconds!

    please help me....

  • #2
    Regular Coder
    Join Date
    Jul 2010
    Location
    St George, UT
    Posts
    138
    Thanks
    6
    Thanked 17 Times in 17 Posts
    You can have the PHP that shows "submission is success" also output the following. 10000 is 10 seconds in ms:

    PHP Code:
    <?php

    echo '
    <script type="text/javascript">
        setTimeout("history.go(-2)", 10000);
    </script>
    '
    ;
    ?>

  • Users who have thanked wildreason for this post:

    hansan (07-24-2010)

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    19
    Thanks
    4
    Thanked 0 Times in 0 Posts
    WOW !
    it's working! thanx wildreason.....


  •  

    Posting Permissions

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