Howdy, tonight I was playing around with trying to pass a value from a form field and use it for an "if" statement in php.
<form name="input" action="myscript.php" method="get">
Enter a 1 or a 2:
<input type="text" name="page_number_from_form">
<input type="submit" value="Submit">
if(isset($_GET["page_number_from_form"])) $page_number = $_GET["page_number_from_form"];
echo 'Number One.';
echo 'Number Two.';
echo 'No page number.';
No matter what I type in (or don't type in) it always echos "Number One". Is there a way to pass an integer from the form field instead of text? Maybe a way to convert it?