SitePoint Sponsor

User Tag List

Results 1 to 18 of 18
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    open page B when page A is loaded

    hi,

    i want that when i load page A, page B gets opened and after 2 seconds u see page C and then u get back to page A

    i think i need a javascript right?
    if so can anyone post the right code?

    i need one more thing....i need page b and c to be opened only once a day

    thanks

  2. #2
    code ninja hamstu's Avatar
    Join Date
    Nov 2002
    Location
    Montréal, Canada
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Er, can you explain in a little more detail?

    Do you want to have a popup window open?

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hamstu View Post
    Er, can you explain in a little more detail?

    Do you want to have a popup window open?
    mmm...
    ok lemme try to be clearer if possible...

    on april the 1st is the joke day in italy
    so i want that when my users go on my forum homepage they see a page (a) where they read they are banned and after 2 seconds page c comes and say it was a joke

    hope is is clearer now

  4. #4
    code ninja hamstu's Avatar
    Join Date
    Nov 2002
    Location
    Montréal, Canada
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh ok, you could use a meta refresh in that case.

    Put this in your <head> tag (on the Joke page):
    Code:
    <meta http-equiv="refresh" content="2;url=http://www.google.com/" />
    Change google.com to the new page.

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hamstu View Post
    Oh ok, you could use a meta refresh in that case.

    Put this in your <head> tag (on the Joke page):
    Code:
    <meta http-equiv="refresh" content="2;url=http://www.google.com/" />
    Change google.com to the new page.
    how to show this page only once for user?

  6. #6
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    by setting a cookie and then checking the cookie if they already seen it.

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria View Post
    by setting a cookie and then checking the cookie if they already seen it.
    how do i do that?

  8. #8
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Set a cookie? Depends on what back-end language you are using. Whatever language you are using, check the documentation.

  9. #9
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria View Post
    Set a cookie? Depends on what back-end language you are using. Whatever language you are using, check the documentation.
    italian

  10. #10
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eh, I meant what back-end programming language you are using. Knowing Italian will not help you set cookies.


  11. #11
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria View Post
    Eh, I meant what back-end programming language you are using. Knowing Italian will not help you set cookies.

    php and html

  12. #12
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, so check out the PHP documentation on how to set and read cookies.

  13. #13
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria View Post
    Ok, so check out the PHP documentation on how to set and read cookies.
    where do i check that?

  14. #14
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Google "php documentation", first hit you get might shock you.

  15. #15
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria View Post
    Google "php documentation", first hit you get might shock you.
    checked it but not familiar with php,
    could u please post the exact code i have to use?

  16. #16
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you basically want a complete solution without you having to actually look into something and maybe learn from it?

    Give it a try yourself first. When you run into a wall, post the code here (or even better, a PHP forum) and people might help you then.

  17. #17
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria View Post
    So you basically want a complete solution without you having to actually look into something and maybe learn from it?

    Give it a try yourself first. When you run into a wall, post the code here (or even better, a PHP forum) and people might help you then.
    i found this
    http://it.php.net/manual/it/function.setcookie.php
    but i dont know what code to get and where to put it into my page

  18. #18
    code ninja hamstu's Avatar
    Join Date
    Nov 2002
    Location
    Montréal, Canada
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's very basic PHP, and there are plenty of examples in the documentation you linked to. Basically you set the cookie with setcookie, and you can check to see if it is set by reading $_COOKIE["YourCookieName"]

    I won't write all the code for you, so If you don't understand, you might want to start from the beginning of the manual: http://it.php.net/manual/it/index.php

    If you have any more questions, feel free to ask.


Bookmarks

Posting Permissions

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