Im very new to php, but im tring to get a simple form to work with the below code. I know registered_globals is turned off so looking at other posts i saw one about using $_POST array. instead of just using the variable.
I get the following error message:
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in /homedir/holly-s31/lgseddon/public_html/forms/form2.php on line 7
form.php
<html>
<head>
<title>test form</title>
</head>
<body>
<form action="form2.php">
<input type="text" name="$POST['name']">
<br>
<textarea name="$POST['address']" rows="5" cols="40">
</textarea>
<br>
<input type="submit" value="Enter">
</form>
</body>
</html>
form2.php
<html>
<head>
<title>reading from form.php</title>
</head>
<body>
<?php
print "welcome : <b>$POST['name']</b><p>\n\n";
print "Your address is:<P>\n\n<b>$POST['address']</b>";
?>
</body>
</html>
Another way I read about was using $http_POST_VARS, if i use the below code it does print out the text I enter in my forms but i dont know how to access each element individualy.
<?php
foreach ( $HTTP_POST_VARS as $key=>$value ) {
print "$key : $value<BR>\n";
}
?>
can somebody help please?
thanks