Jump to content

[SOLVED] Only viewable if comming from a certain page?


Northern Flame

Recommended Posts

I'm not sure if it's possible to do this or not,

but I have two files,

page1.php and page2.php

 

How can I have it so that only the people that are comming from page1.php can view the contents of page2.php

 

So heres how it will work,

the user must be at page1.php and then go to page2.php,

or else it will echo an error message.

 

Can this be done?

Link to comment
Share on other sites

I'm not sure if it's possible to do this or not,

but I have two files,

page1.php and page2.php

 

How can I have it so that only the people that are comming from page1.php can view the contents of page2.php

 

So heres how it will work,

the user must be at page1.php and then go to page2.php,

or else it will echo an error message.

 

Can this be done?

 

<?php
if (stripos($_SERVER['HTTP_REFERER'], "http://www.mysite.com/page1.php")) {
    // show content
} else {
    // get out of here!
}
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.