将表单数据发送到一个页面,然后是另一个页面?

I'm having a bit of trouble with this one, as basic as it may be. I have a simple form with name, email, comments, etc. that outputs itself to one php page, but I want to have a link that sends it to a second page, for example:

<label for="name">Name:</label><input type="text" name="name" size="20" />

Goes to a second page (second.php) with this code and prints it just fine:

print "<div>Thank you, $name.</p></div>";

But if I try to send $name to a third page (third.php) using similar code it shows up like this:

Thank you, $name.

With the actual variable and not what was stored in $name.

I feel like I'm missing one tiny little thing but I'm not sure what it is. I used this:

$name = $_POST['name'];

To bring it to second.php and this to bring it to third.php:

print 'Click <a href="third.php? name=' . $name . '">here</a> to proceed.';

Just to see if it would get the same information from second.php, but I don't think it works that way. Is there something else I should be doing on the third page? I have a feeling it's something incredibly insignificant but as I'm learning, I just can't quite get a grasp on it.

查看全部
dougu3988
dougu3988
2012/02/27 03:30
  • html5
  • php
  • html
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

4个回复