First try at PHP

Status
Not open for further replies.

wcmatt

New Member
Messages
40
Reaction score
0
Points
0
Almost straight from the tutorials:

<FORM name="vregform" ACTION="../regreply.php" method="post">
<table>
<tr>
<td>
<INPUT TYPE=TEXT NAME=”last_name”>
<INPUT TYPE=TEXT NAME=”first_name”>
<INPUT TYPE=SUBMIT VALUE=Submit>
<td>
<tr>
</table>
</FORM>

"regreply.php"
<html>
<body>
<?php echo $_POST["first_name"]; ?>Should be a name?<br />
Thanks for your registration information.
</body>
</html>

Simply reply page doesn't include the value of "first_name" submitted on the form??

I just started trying to learn PHP, shouldn't this work?
 

zubair12

Banned
Messages
631
Reaction score
0
Points
0
What is your layout i can`t understand...the given code is one file????

or two????
 
Last edited:

adamparkzer

On Extended Leave
Messages
3,745
Reaction score
81
Points
0
What is your layout i can`t understand...the given code is one file????

or two????
Of course it's two files, he even specified the second file by labeling it with "regreply.php"

wcmatt - I just looked through your code and it seems as if everything is coded properly (other than a few missing quotation marks that are considered conventional). The only reason I can think of that your script isn't working is that your path to regreply.php is wrong. Check the relative location, or use an absolute URL in your ACTION, and try again.
 

wcmatt

New Member
Messages
40
Reaction score
0
Points
0
adamparkzer - I think the path to regreply.php is ok, I am getting a page displayed that looks something like this:

Should be a name?
Thanks for your registration information.

What is missing from the display is the value of $_POST["first_name"]. Which should be set by the submited "vregform". It appears that I am not picking up the form data.

This actually seems too easy even for me to mess up! Any other thoughts?

Thanks for the response.
 

gomarc

Member
Messages
516
Reaction score
18
Points
18
The problem is in the tilted quotes wrapping last_name and first_name:

Code:
<INPUT TYPE=TEXT NAME=[SIZE=3][COLOR=Red][B]”[/B][/COLOR][/SIZE]last_name[SIZE=3][COLOR=Red][B]”[/B][/COLOR][/SIZE]>
<INPUT TYPE=TEXT NAME=[SIZE=3][COLOR=Red][B]”[/B][/COLOR][/SIZE]first_name[SIZE=3][COLOR=Red][B]”[/B][/COLOR][/SIZE]>
Using notepad (not Word), replace them with straight down quotes ( " ).
 

adamparkzer

On Extended Leave
Messages
3,745
Reaction score
81
Points
0
The problem is in the tilted quotes wrapping last_name and first_name:

Code:
<INPUT TYPE=TEXT NAME=[SIZE=3][COLOR=Red][B]”[/B][/COLOR][/SIZE]last_name[SIZE=3][COLOR=Red][B]”[/B][/COLOR][/SIZE]>
<INPUT TYPE=TEXT NAME=[SIZE=3][COLOR=Red][B]”[/B][/COLOR][/SIZE]first_name[SIZE=3][COLOR=Red][B]”[/B][/COLOR][/SIZE]>
Using notepad (not Word), replace them with straight down quotes ( " ).
lol!! That's hilarious.

... Sorry, I had to say that.
 
Status
Not open for further replies.
Top