Jump to content

[SOLVED] Forms to Variables


EdoDodo

Recommended Posts

Page 1:

<form method="post" action="http://localhost/page2.php">
Minimum Number: <input type="text" size="10" maxlength="40" name="min_num"><br>
Maximum Number: <input type="text" size="10" maxlength="10" name="max_num"><br>
Number of Guesses: <input type="text" size="10" maxlength="10" name="guesses"><br>
<input type="submit" value="Go!">
</form>

 

Page 2:

<?php
$min_num='$_POST['min_num']';
$max_num='$_POST['max_num']';
$guesses='$_POST['guesses']';

echo '$min_num, $max_num, $guesses';
?>

 

 

I'm pretty sure it's just a silly mistaker but I'm new to PHP and stuff so I can't spot it.

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.