php text box variables

Posts 1–2 of 2 · Page 1 of 1
php text box variables
I dont understand why this happens, I followed multiple tutorials and still
this error happens

Code:
<?php
if(isset($_GET['ex']))
{
		$ex = $_GET['ex'];
}		
?>

<form action="" method="POST">
text: <input type="text" name="ex">
<input type="submit" name="submit" value="submit">
</form>
<?php
echo $ex
?>
How do I get the variable to work
<?php>
if(isset($_GET['ex']))
{
$ex = $_GET['ex'];
}
?>

<form action="" method="POST">
text: <input type="text" name="ex">
<input type="submit" name="submit" value="submit">
</form>
<?php
echo $ex
?>
echo $ex

Thats your problem that code isnt finished. Either finish it or remove it.

Yeah i tested it the $ex is a unnecessary code and it messes up the whole script. Just take it off thats how i fixed it.

Awhhhh i see why its not working



<?php
if(isset($_GET['ex']))
{
$ex = $_GET['ex'];
}
?>

<form action="" method="POST">
text: <input type="text" name="ex">
<input type="submit" name="submit" value="submit">
</form>
---------------
<?php
echo $ex
?>
---------------
You need to fix that spot to this

echo $ex
<?php>

and at the top you made it <?php

Gotta make it <?php> you just made simple mistakes you didnt notice.
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?