Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.
PHP help.
Hey I'm trying to make a challenge that helps teach about cookies. What i want them to do is add a cookie with certain info and then go to this page.
Here is the challenge link. http://fashizzlepop.ulmb.com/challenges/cookies/1.php
Here is the pass checking code. Prolly some simple bug… can't figure it out. Other suggestions welcome.
if (isset($_GET['chall'])) {
switch ($_GET['chall']) {
case 'cookie1':
if (isset($_COOKIE["cookie1"])) {
if ($_COOKIE["cookie1"]=="85e7a731957c903616d0860750fc0dbd"){
echo "Congratulations! Now try and decypt the md5 hash set as the value for the cookie!"; }
else {
echo "I'm sorry, no cookie found. Cookie either not set or expired!"; }
else {
echo "I'm sorry, no cookie found. Cookie either not set or expired!"; }
break;
default:
echo "I'm sorry, no cookie found! Cookie either not set or expired!";
}
}
else
echo "I'm sorry Error in password checking!";
?>```
You have else statement twice? You should learn to read PHP errors they usually tell pretty easily where the problem is.
markupParse error: syntax error, unexpected T_ELSE in /hosted/subs/ulmb.com/f/a/fashizzlepop/public_html/challenges/passcheck.php on line 21
Means that the parser has encountered an else statement, that shouldn't be there, on line 21. That would have answered your problem already :P