Hi,
I'm new to php and I'm trying to pass information from a form (html page) to a php page and write the data, simple just to get started...
this is what I did:
<?php
echo ("Your name is: $fName $lName")
?>
on the html page I have a form with two fields:
fName and lName.
why doesn't this work?
Thanks
it's not working... why?
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Here's an example to work from:
That should be pretty much self-explanitory, but, if you still require more help, ask away! 
Code: Select all
<?php
if ($submit) { // Check if form has been submitted.
echo('Your name is: $firstName $lastName.'); // If it has, display form results.
}
else { // If it hasn't, display the form.
?>
<FORM METHOD="post" ACTION="<?=$PHP_SELF?>">
<INPUT TYPE="text" NAME="firstName" VALUE="Enter First Name">
<INPUT TYPE="text" NAME="lastName" VALUE="Enter Last Name">
<INPUT TYPE="submit" NAME="submit">
</FORM>
<?
}
?>now this won't work...
I added this:
register_globals=On;
and I got this error:
Parse error: parse error, unexpected '=' in c:\inetpub\wwwroot\php\test1.php on line 8
why?
register_globals=On;
and I got this error:
Parse error: parse error, unexpected '=' in c:\inetpub\wwwroot\php\test1.php on line 8
why?
it's alive!!!
Thanks everyone, it works! but I'll be back in the future with more questions!
bye
bye