Be a Supporter!

Parse error: parse error???

  • 992 Views
  • 6 Replies
New Topic Respond to this Topic
CalumTurner
CalumTurner
  • Member since: Jun. 25, 2006
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Parse error: parse error??? 2006-07-08 11:13:25 Reply

Hello everyone

I'm creating a regestration area for my site, and I plan on making a log in area too. My problem is when i was uploading my code (the code is below) I encountered a problem. I went to the spicific URL and it said "Parse error: parse error, unexpected T_STRING in /home/www/genius1.awardspace.com/regester.
php on line 6"

I dont know what it wants me to edit, The code is below:

<?php

<form action="confirmreg.php" method="GET">
Enter a Password: <input type="text" name="pass" />
Enter a Username: <input type="text" name="user" />
Enter your name: <input type="text" name="name" />
Enter your age: <input type="text" name="age" />
Enter your email: <input type="text" name="email" />
Enter your country: <input type="text" name="country" />

<input type="submit" />

</form>

?>

Can someone plz help me!

-robokid

JeremysFilms
JeremysFilms
  • Member since: Feb. 18, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Parse error: parse error??? 2006-07-08 11:28:01 Reply

First off, you put the HTML out there as expressions. If you want to make PHP output that HTML, you need to echo or print it. So echo the html you want to be outputted.

Examples:

echo 'Hey how are you';

echo '<form>
<input type="hidden" name="blah">
</form>';

seel
seel
  • Member since: Jun. 27, 2005
  • Offline.
Forum Stats
Member
Level 21
Musician
Response to Parse error: parse error??? 2006-07-08 11:28:25 Reply

Hmm.. You have some nasty syntax there, change the [input type="text" name="Password" /], use "password" as type instead of "text".. And then you should change GET to POST in form action.. And now to the main reason why it wont work: You have to remove the <?php and ?> tags, and use a normal HTML document, since the syntax you use is HTML code, not PHP..

JeremysFilms
JeremysFilms
  • Member since: Feb. 18, 2005
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Parse error: parse error??? 2006-07-08 11:30:28 Reply

Sorry for double post, but also, you don't really need to use PHP to output that. You could just have it there then you PHP when you need it. Like this:

html is cool
dfjsldkfjlksdf
<?php
//omg php
?>

CalumTurner
CalumTurner
  • Member since: Jun. 25, 2006
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Parse error: parse error??? 2006-07-08 11:44:43 Reply

thanks you guys, Im thinking of making the regestration questions in htlml, just because it would look more formal, but then at the bottom i would use php codes just to save the users information in the mysql database. thanks

-robokid

DearonElensar
DearonElensar
  • Member since: Jun. 10, 2002
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Response to Parse error: parse error??? 2006-07-08 13:25:13 Reply

i suggest you really look into php a bit more and learn about outputting html and things like that, and also look to things like security etc. because if i look at what you made your not ready to make a registration / member system...


BBS Signature
Zendra
Zendra
  • Member since: Sep. 7, 2003
  • Offline.
Forum Stats
Member
Level 51
Blank Slate
Response to Parse error: parse error??? 2006-07-09 04:09:55 Reply

At 7/8/06 01:25 PM, DearonElensar wrote: i suggest you really look into php a bit more and learn about outputting html and things like that, and also look to things like security etc. because if i look at what you made your not ready to make a registration / member system...

I totally agree. After reading your story on how your planning to do 'code' your member system, I really got a bad feeling about it.
You could start on W3Schools.com / PHP.