Jump to content

Problems with forms


Tabularasa

Recommended Posts

Good evening, I am discovering php and would like to play with forms.

 

I have created the following form

 

test2.php

<html>
<body>
<form action="welcome.php" method="GET">
<p>Your name: <input type="text" name="name"></p>
<p>your age: <input type="text" name="age"></p>
<p><input type="submit"></p>
</form>
</body>
</html>

 

I have then created the welcome.php called by test2.php. Both forms are in the same folder.

welcome.php

<html>
<body>
<p>Test: <?php echo "Success"?></p>
<p>Hi <?php echo htmlspecialchars($_GET['name'])?></p>
<p>You are <?php echo (int)$_GET['age']?> years old</p>
</body>
</html>

 

I then open test2.php with Firefox. I enter the required input ("Tabularasa","32") and hit submit. I am then redirected toward welcome.php with my browser window showing: file:///C:/wamp/www/test/welcome.php?name=Tabularasa&age=32

 

However, once I am on welcome.php is only see the following:

 

Test:

 

Hi

 

You are years old

 

looks like php is not returning anything. The funniest thing is that when I run welcome.php under the debug window of phpDesigner I at least get Test: Success which isn't the case when I open welcome.php directly with Firefox. What is happening?

Link to comment
https://forums.phpfreaks.com/topic/74652-problems-with-forms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.