I am using a wamp local server and the file is located in the www directory without any subfolders.
Thanks alot. let me try this. meanwhile since i am totally a newbie so can you kindly explain whats happeneing here. will it display an error incase it couldnt located the file or the form field name? thanks a lot.
Hello.
i am totally new to php and just started to learn now. i just dont understand why the following code is not printing the username that i enter on the page.
Please note that the code itself is saved with the name "basicForm.php".
Thanks.
<html>
<head>
<title> Basic Form </title>
<?php
$username = $_POST['username'];
print ($username);
?>
</head>
<body>
<form name"form1" method="POST" action="basicForm.php">
<input type="text" value="username" name="username">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
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.