Please Help - Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

06-07-09, 07:17 PM
|
|
Newbie Coder
|
|
Join Date: Jun 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Please Help - Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'
Hi,
Hope this is the right place to post this! , If not im sorry!
Im having the error :
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/fhlinux134/c/classifiedswindow.co.uk/user/htdocs/index.php on line 55
This effecting code is:
Code:
<form action='index.php' method='POST'>
I cannot see a problem.
Anyone got any ideas?
Thankyou ,
Jordan
|

06-07-09, 08:14 PM
|
 |
Aspiring Coder
|
|
Join Date: Oct 2003
Posts: 502
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Also show lines before and after this one, that often helps to narrow it down .... you may want to try changing the single quotes to double quotes.
|

06-08-09, 05:45 AM
|
|
Newbie Coder
|
|
Join Date: Jun 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Problem still persisting
Hi There,
I have changed to double quotes however the same problem remains.
Here is a selection of code above and below (Not all but a fair amount)
Code:
//show data to user.
echo"
<table>
<tr>
<td>
Info about the user who has posted.
</td>
</tr>
<tr>
<td>
Message
</td>
</tr>
</table>
}
//Horizontal Line
echo <hr>
//Form
echo "
<form action="index.php" method="POST">
<table width='100%'>
<tr>
<td width='18%'>
Your Full Name:
</td>
<td>
<input type='text' name='text' maxlength='35'>
</td>
</tr>
<tr>
<td>
Your Email:
</td>
<td>
<input type='text' name='email' maxlength='50'>
</td>
</tr>
<tr>
Thankyou,
Jordan
|

06-08-09, 05:55 AM
|
 |
Aspiring Coder
|
|
Join Date: Oct 2003
Posts: 502
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You have a few things out of whack ....
PHP Code:
//show data to user.
echo " <table> <tr> <td> Info about the user who has posted. </td> </tr> <tr> <td> Message </td> </tr> </table>";
}
//Horizontal Line echo "<hr>";
//Form
echo " <form action=\"index.php\" method=\"POST\"> <table width=\"100%\"> <tr> <td width=\"18%\"> Your Full Name: </td> <td> <input type=\"text\" name=\"text\" maxlength=\"35\"> </td> </tr> <tr> <td> Your Email: </td> <td> <input type=\"text\" name=\"email\" maxlength=\"50\"> </td> </tr> <tr>
Escape your quotation marks, and make sure your echo tags are closed as well.
|

06-08-09, 06:03 AM
|
|
Newbie Coder
|
|
Join Date: Jun 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Thankyou,
Hi There,
Changed the code and things like you suggested and now its working fine again 
Thankyou Very Much
Jordan
|

06-08-09, 04:30 PM
|
|
Newbie Coder
|
|
Join Date: Jun 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Another Problem.
Hey , Got another problem now after a bit more coding.
Im getting the error:
Parse error: syntax error, unexpected '/' in /home/fhlinux134/c/classifiedswindow.co.uk/user/htdocs/index.php on line 102
A bit of my code above this is:
Code:
<form action=\"index.php\" method=\"POST\">
<table width=\"100%\">
<tr>
<td width=\"18%\">
Your Full Name:
</td>
<td>
<input type=\"text\" name=\"text\" maxlength=\"35\">
</td>
</tr>
<tr>
<td>
Your Email:
</td>
<td>
<input type=\"text\" name=\"email\" maxlength=\"50\">
</td>
</tr>
<tr>
<td valign='top'>
Your Advert:
</td>
<td>
<textarea cols='20' rows='2' name='message' maxlength='300'></textarea>
<p>
<input type='submit' name='submit' value='Post'>
</td>
</tr> "
</table>
</form>
It seems the error is coming from (Which is line 102)
Any Idea's on this?
Thankyou, Jordan
|

06-08-09, 04:37 PM
|
 |
Aspiring Coder
|
|
Join Date: Oct 2003
Posts: 502
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
PHP Code:
</td> </tr> </table> </form>";
Actually, you can get by without the echo's and escapes and just use HTML if you want, as long as you go back into PHP when needed.
|

06-08-09, 04:52 PM
|
|
Newbie Coder
|
|
Join Date: Jun 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey there , thanks for your reply.
I've done that exactly as you stated but now its saying:
Parse error: syntax error, unexpected $end in /home/fhlinux134/c/classifiedswindow.co.uk/user/htdocs/index.php on line 105
which is ?>
Any Ideas?
|

06-08-09, 06:27 PM
|
|
Aspiring Coder
|
|
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 414
Thanks: 4
Thanked 27 Times in 26 Posts
|
|
that means you have missed a bracket somewhere } somewhere, make sure you have matching opening brackets { and closing brackets }.
|

06-08-09, 07:52 PM
|
|
Newbie Coder
|
|
Join Date: Jun 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thankyou!
All Sorted!
Cheers 
Thanks guys for yourself, I appreciate it
Jordan
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
desoerate for help!!! Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting ']
|
JavierVT |
PHP |
7 |
09-07-08 08:31 PM |
|
PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRIN
|
aprogrammer |
PHP |
19 |
07-27-08 10:02 AM |
|
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'
|
Dr. Forensics |
PHP |
3 |
07-15-06 03:54 PM |
|
parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '}'
|
unlisted80 |
PHP |
8 |
07-05-06 04:28 PM |
|
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' HELP
|
stormshadow |
PHP |
2 |
06-27-06 09:27 AM |
|