Heya, I've got a little PHP issue. Below's the code... if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){ // if verification code was correct send the message and show this page mail("mail@address.com", 'Name: '.$posName, 'IP Address: '.$_SERVER['REMOTE_ADDR']."\n\n"'Name: '.$posName."\n\n"'Docs: '.$posDocs."\n\n"'Address: '.$posAddress."\n\n"'Phone: '.$posPhone."\n\n"'Services: '.$posServices, "From: $posEmail"); // delete the cookie so it cannot sent again by refreshing this page setcookie('tntcon',''); } else { // if verification code was incorrect then return to contact page and show error header("Location:".$_SERVER['HTTP_REFERER']."?name=$posName&docs=$posDocs&address=$posAddress&phone=$posPhone&email=$posEmail&wrong_code=true"); exit; } PHP: What's wrong with it? It's not working. I guess that something's wrong with all the " and ' (or maybe not). Thanks in advance, dmi
Try: if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){ // if verification code was correct send the message and show this page mail("mail@address.com", 'Name: '.$posName, 'IP Address: '.$_SERVER['REMOTE_ADDR']."\n\n".'Name: '.$posName."\n\n".'Docs: '.$posDocs."\n\n".'Address: '.$posAddress."\n\n".'Phone: '.$posPhone."\n\n".'Services: '.$posServices, "From: $posEmail"); // delete the cookie so it cannot sent again by refreshing this page setcookie('tntcon',''); } else { // if verification code was incorrect then return to contact page and show error header("Location:".$_SERVER['HTTP_REFERER']."?name=$posName&docs=$posDocs&address=$posAddress&phone=$posPhone&email=$posEmail&wrong_code=true"); exit; } PHP:
You should also place brackets around your variables if using them inside the double quotes or the other method. "{$var}" or "".$var."" PHP: It's good practice so you don't accidentally add characters onto a variable without wanting to.