Page 1 of 1

Php syntax error,

Posted: Fri Aug 05, 2011 6:38 pm
by dominic600
Okay so ive been working on this website and i made a register forum but when i ftp it and then go to test it out i get an error. ive done it exactly like in the video tutorial and it does not work for me.

heres the line of code to where its says im getting the error:
$form = <form action='register.php' method='post'>

and the error is :

Parse error: syntax error, unexpected '<' in /home/a3888506/public_html/register.php on line 7



Thanks for any help in advance,
Dominic

Re: Php syntax error,

Posted: Fri Aug 05, 2011 7:05 pm
by flying_circus
That's because there is a syntax error. I would assume that you want to set the $form variable to the following string. You need to wrap it in quotes, so it is treated as a string, otherwise the < symbol is treated as a comparisson operator and dies.

Code: Select all

$form = "<form action='register.php' method='post'>";

Re: Php syntax error,

Posted: Fri Aug 05, 2011 7:09 pm
by dominic600
yes, i have done that. when i do that i get this :

Parse error: syntax error, unexpected '<' in /home/a3888506/public_html/register.php on line 8

and line 8 reads:
<table>

Re: Php syntax error,

Posted: Sat Aug 06, 2011 5:06 am
by Dodon
It's the same issue as you had before. You can't simply place <table> in your php code when <table> is html code. Either put it in a variable like you did with the form or use it as HTML code.