php coding
|
2014-03-19, 20:49
(This post was last modified: 2014-03-19 20:49 by Raz!.)
Post: #1
|
|||||||
|
|||||||
php coding
I have a problem with my php code, if anyone can figure it out, it would be highly appreciated!
Parse error: syntax error, unexpected '<' in C:\wamp\www\register.php on line 9 Code: <?php |
|||||||
2014-03-19, 21:58
Post: #2
|
|||||||
|
|||||||
RE: php coding
If you read the error, it says that you've placed a chevron on line nine that shouldn't be there. Looking at your code, you haven't opened (nor closed for that matter) the variable you're defining. So it'd need to be changed to $form = 'your form here';
I've used single apostrophes because you've included a form, where if you use speech marks, you'll keep opening and closing the variable. |
|||||||
|
|||||||
2014-03-20, 00:29
(This post was last modified: 2014-03-20 00:42 by Pete.)
Post: #3
|
|||||||
|
|||||||
RE: php coding
Unless you want to escape all of your quote marks (which you would need to do) I would recommend the following:
For this example I would consider putting the following code in a separate file called "form.php": form.php Code: <form action="register.php" method="POST"> and from your main file call an include or require for the form HTML: Code: <?php It will make your code a lot cleaner. Getting away from echoes is a good thing. |
|||||||
|
|||||||
2014-03-20, 15:43
Post: #4
|
|||||||
|
|||||||
RE: php coding
(2014-03-20 00:29)Pete Wrote: Unless you want to escape all of your quote marks (which you would need to do) I would recommend the following: Thanks very much, this works extremely well. Thanks All! |
|||||||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)
Powered By MyBB, © 2002-2025 MyBB Group