By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,516 Members | 1,369 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,516 IT Pros & Developers. It's quick & easy.

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\r

P: 1
I'm working on a simple php script and i'm getting the error in the title
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $user = $_POST['username'];
  4. $pass1 = $_POST['pass1'];
  5. $pass2 = $_POST['pass2'];
  6. $email1 = $_POST['email1'];
  7. $email2 = $_POST['email2'];
  8.  
  9.  
  10. if ($pass1 == $pass2) {
  11. echo "The passwords match";
  12. }
  13. else {
  14. echo "<center><h1>The passwords do not match</h1></center> <center></h2>Please go <a href=/"index.php/">HERE</a> to try again</h2></center>";
  15. }
  16. ?>
can anyone help identify the problem
Mar 29 '12 #1
Share this Question
Share on Google+
3 Replies


Expert Mod 100+
P: 2,324
it's the direction of the slashes when you escape it in your echo statement, it should be back slashes

it should be
Expand|Select|Wrap|Line Numbers
  1. <a href=\"index.php\">HERE</a> . . .";
Mar 29 '12 #2

PsychoCoder
Expert Mod 100+
P: 465
If you're trying to create a login screen then take a look at this: http://www.dreamincode.net/code/snippet1153.htm
Mar 30 '12 #3

P: 93
echo "<center><h1>The passwords do not match</h1></center> <center></h2>Please go <a href='index.php'>HERE</a> to try again</h2></center>";
Apr 16 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Browse more PHP Questions on Bytes