Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2003
    Posts
    4

    Unanswered: PHP page refresh

    Hi, I need help with page refresh. My question is how do i stop someone from refreshing a certain page in PHP. Can this be done? Or can it be redirected to the same PHP page? Any help would be appreciated.

    Thanks,
    Jason

  2. #2
    Join Date
    Dec 2002
    Posts
    65
    Can you provide a little more info? What specifically are you trying to do? Are you using forms, sessions, etc? What would cause the page to be different after refreshing?

    -b
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  3. #3
    Join Date
    Jan 2003
    Posts
    4
    It's for one of my traffic exchanges. Sorry, I meant it should be redirected to a different page not the same page. After a user has been credited I would like them to have to click the next button and not be able to refresh the page. Just trying to stop automatic refreshing programs from working on my exchange.

    Thanks,
    Jason

  4. #4
    Join Date
    Dec 2002
    Posts
    65
    Hmm, just go with a session variable test then. It should be simple enough. Here's a quick, easy example.

    session_start();
    if ($_SESSION['visit'] == true )
    {
    header("Location: http://www.example.com/"); //your redirect URL
    }
    else
    {
    $_SESSION['visit'] = true;
    //display your normal page here
    }
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  5. #5
    Join Date
    Jan 2003
    Posts
    4
    Didn't work the way i wanted it to. Thank you anyway. I need it to go to a certain page when the user refreshes the page?

    Thanks,
    Jason

  6. #6
    Join Date
    Dec 2002
    Posts
    65
    Hmmm... maybe I'm not understanding correctly.
    As I understand it you were asking that on the first visit to the page (in the browser session) the user goes to one page and then if he refreshes it goes to another page. This is what my example was based off of.

    Did you want something more permanent where the user only visits once ever (even after closing the browser) and from then on gets forwarded to a different page. If so you may want to try and use cookies instead of sessions.

    -b
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  7. #7
    Join Date
    Jan 2003
    Posts
    4
    Yah i think i will try using cookies. Thanks for your help

  8. #8
    Join Date
    Dec 2002
    Posts
    2

    hi all

    Is there a way where you can refresh a page without using cookies and header?

  9. #9
    Join Date
    Dec 2002
    Posts
    2
    hi is there a way where i can refresh a page with a php code without using cookies and also header? this is what i mean the checkbox is in another function and then when i click it it will go to another function and then the page will be automatically refreshed.. is there a way tnx guys

Posting Permissions

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