Hi there 😃
I've got a simple HTML page which takes user input and then prints out the input when the submit button is clicked.
the issue i'm faced with is depending where the PHP code is positioned in the HTML i cannot call up the value of a variable:
<?php
echo("Begining " . $a);
?>
<html>
<head>
<title>Test Variables</title>
</head>
<body>
<form>
<form action="<?=$PHP_SELF?>" method="POST">
<input type="TEXT" name="testf" size="10">
<input type="submit" name = "submit" value = "submit"></form><?php
if ("submit" == $submit) {
$a = $testf;
echo( "Bottom " . $a);
}
?>
</body></html>
Any ideas, I need to use session_start function which i understand has to be at the very beggining of an HTML document (correct me if i'm wrong 🙂 ), and the variable i need to use is empty as demonstrated in the above example.
Thanks in advance
Pete 😃