Accept/Decline Button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Accept/Decline Button

Post by Jonah Bron »

Isset(). Don't forget to call session_start at the beginning.

Code: Select all

<?php
session_start();

if (!isset($_SESSION['did_accept'])) {
    die('Sorry, your session timed out.  Please go back and try again.');
}
if ($_SESSION['did_accept'] != true) {
    die('Sorry, there was an error.  Please go back and try again.');
}

// ...

?>
mattparsons
Forum Newbie
Posts: 12
Joined: Wed Nov 03, 2010 1:06 pm

Re: Accept/Decline Button

Post by mattparsons »

not following your last post...does that go in the same php file?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Accept/Decline Button

Post by Jonah Bron »

No, it goes in page2.url. It answers the question you asked in the previous post.
mattparsons
Forum Newbie
Posts: 12
Joined: Wed Nov 03, 2010 1:06 pm

Re: Accept/Decline Button

Post by mattparsons »

ok...so that code will supply my security between the 2 pages? If so...where do I post that code?
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Accept/Decline Button

Post by Jonah Bron »

Yes. Place it at the beginning of the file.
mattparsons
Forum Newbie
Posts: 12
Joined: Wed Nov 03, 2010 1:06 pm

Re: Accept/Decline Button

Post by mattparsons »

ok...that one didn't work...I even cleared my cache...and I can still access url2.html without clicking the "Accept" button on url1.html.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Accept/Decline Button

Post by Jonah Bron »

Hm. Post the entire code of url1.html.
Post Reply