Jump to content

wizjr101

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

wizjr101's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Forgot to uncomment before I copied them - sorry. Nothing shows up just a blank page generated. Its like it cant find the cookie. I know the cookie is there, i check in the browser and it shows up. I delete it and relogin and its there again. So I know that part is working. Maybe I just need to dump the cookie thing and try to figure out sessions? Never worked with them so guess now is as any time to start.
  2. I've move everything over to a closed server with all error reporting on. This is a testing server and not open to the world so Im not worried about security at this point. index.php - login page loginprocess.php - verifies login then sets cookie. login failure goes back to index.php else it goes to readcookie.php readcookie.php - this is the script that verifies there is a cookie. if not send back to index.php else exit script and display html. Here is the loginprocess script. It works fine. # <?php # $username = $_POST['username']; # $password = $_POST['password']; # if($username=="james" && $password=="bond"){ # setcookie("rchjr","true",time()+3600); # header("location:http://example.com/readcookie.php"); # }else{ # header("location:http://example.com/index.php"); # } # ?> This is readcookie.php nothing else is on the page. Its the reading of the cookie that wont function. per the last posted suggestion I changed it to this. It still does not work. # <?php # if (!isset($_COOKIE["rchjr"]) || $_COOKIE['rchjr']!='true'){ # header("location:http://www.kraft.com"); # } # ?> Ive tried this on 2 different servers thinking it might be something there. no differences. I'm completely confused.
  3. I guess i just dont understand how cookies work. I've been tinkering with this for 2 days now. Here is my final script after tinkering with it. It never reads or finds the cookie at all and just redirects to the kraft.com page. I can see the cookie and read it from the browser in FF or IE so I know its there, the script just cant find it. If anyone can put me in the right direction as to how to do this I would be grateful. <?php if (!isset($_COOKIE["rchjr"])){ header("location:http://www.kraft.com"); exit(); }else{ exit(); } ?> What the whole thing needs to do is this 1. User logs in and is verified. "DONE this works" 2. cookie is then placed. "DONE this works" 3. sent to home.php "DONE this works 4. home.php need to verify that an active cookie is there. if not send that person to the login page else do nothing/exit script. "This is the script above and does not work" 5. all other pages need to verify that an active cookie is there. if not send that person to the login page else do nothing/exit script. "This is the script above and does not work". Can this work this way or do I need to do something completely different? Thank you so far for everyone's help.
  4. Working with a Mac Server. Apache 1.3 Came in this morning and the apache server had crashed. Been working working for months without any problems. Haven't changed anything. Went to restart the server and it wont restart. Error on logs shows: OpenSSL: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long Any ideas? ??? Im a noobie Mac person who knows web programming and thats all. I have no ideas on what this is? HELP
×
×
  • 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.