ahpro Posted March 3, 2007 Share Posted March 3, 2007 Ok, the code seems fine but then i put it on the net and it says problem with line 2. Any ideas as to why? <? PHP $user = $_POST['uname']; $pwrd = $_POST['p1']; $check = $_POST['p ']; $DOCU NT_ROOT = $_SERVER['DOCU NT_ROOT']; ?> <HTML> <HE D> <TITLE>Reg tering your account</TITLE> </HE D> <BODY> <?PHP if ($pwrd == $check) { echo $user; ' ,your passwords do not match, please go back and type them again'; } Link to comment https://forums.phpfreaks.com/topic/41026-line-2/ Share on other sites More sharing options...
DangerM0use Posted March 3, 2007 Share Posted March 3, 2007 Ok, the code seems fine but then i put it on the net and it says problem with line 2. Any ideas as to why? <? PHP $user = $_POST['uname']; $pwrd = $_POST['p1']; $check = $_POST['p ']; $DOCU NT_ROOT = $_SERVER['DOCU NT_ROOT']; ?> <HTML> <HE D> <TITLE>Reg tering your account</TITLE> </HE D> <BODY> <?PHP if ($pwrd == $check) { echo $user; ' ,your passwords do not match, please go back and type them again'; } I'd have $pwrd as $pass I may be reading this wrong as I am pretty new at this, but $_post, does that not mean your posting those details. I personally don't have $_post on any of the details. Link to comment https://forums.phpfreaks.com/topic/41026-line-2/#findComment-198663 Share on other sites More sharing options...
JBS103 Posted March 3, 2007 Share Posted March 3, 2007 Your PHP tag is <? PHP. You have to get rid of the space. You also have some funny things going on. echo $user; ' ,your passwords do not match, please go back and type them again'; Should be something like echo $user.', your passwords do not match, please go back and type them again'; Link to comment https://forums.phpfreaks.com/topic/41026-line-2/#findComment-198664 Share on other sites More sharing options...
tarun Posted March 3, 2007 Share Posted March 3, 2007 New Code <?PHP $user = $_POST['uname']; $pwrd = $_POST['p1']; $check = $_POST['p1']; $DOCU NT_ROOT = $_SERVER['DOCUMENT_ROOT']; ?> <HTML> <HEAD> <TITLE>Registering your account</TITLE> </HEAD> <BODY> <?PHP if ($pwrd == $check) { echo '$user ,your passwords do not match, please go back and type them again'; } ?> Link to comment https://forums.phpfreaks.com/topic/41026-line-2/#findComment-198668 Share on other sites More sharing options...
smc Posted March 3, 2007 Share Posted March 3, 2007 Welll this spot doesn't make sense: <?PHP if ($pwrd == $check) { echo '$user ,your passwords do not match, please go back and type them again'; } ?> If the passwords match your showing a message saying they don't. You would do: <?PHP if ( $pwrd != $check) { echo '$user ,your passwords do not match, please go back and type them again'; } ?> Link to comment https://forums.phpfreaks.com/topic/41026-line-2/#findComment-198670 Share on other sites More sharing options...
JBS103 Posted March 3, 2007 Share Posted March 3, 2007 Does it still not work? Or are you just sharing the working code? Link to comment https://forums.phpfreaks.com/topic/41026-line-2/#findComment-198673 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.