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

Parse Error : syntax error, unexpected T_STRING, expecting ',' or ';'

P: 47
hi to all,

i am getting syntax error on my code..

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62

what's the actual problem here..?

my code

Expand|Select|Wrap|Line Numbers
  1. echo  '<input type="image" name="'.$i.'_img" value="'.$i.'_img" src="'.$imagesArray['src'][$i].'" alt="'.$imagesArray['alt'][$i].'" onclick="document.getElementById('img').src=this.src; document.getElementById('img').alt=this.alt;" />';     /*  line 62  */
Sep 20 '08 #1
Share this Question
Share on Google+
3 Replies

P: 258
The problem is that you can NOT use single qoute inside another one.

If you need to do it then you have to put a \ before them. I changed your code

Expand|Select|Wrap|Line Numbers
  1. echo '<input type="image" name="'.$i.'_img" value="'.$i.'_img" src="'.$imagesArray['src'][$i].'" alt="'.$imagesArray['alt'][$i].'" onclick="document.getElementById(\'img\').src=this.src; document.getElementById(\'img\').alt=this.alt;" />';
Sep 20 '08 #2

Expert 5K+
P: 5,821
bnashenas, please proof your posts and fix your code tags. If you can't figure out why your post isn't formatting correctly, please PM a moderator.
Sep 20 '08 #3

P: 47
The problem is solved...

Thanks a lot.....
Sep 20 '08 #4

Post your reply

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