1

Html form submits data to a php. Php loads it into a database and passes on the data (in this case usr ) to a html document( resultpg.html ).

I need the html document to say "Hi NameOfUser,".

The snippet from the page containing html form:

<form class="login-form" action="/form.php" method="POST">
<input type="text" name="usr" placeholder="username"/>
<input type="password" name="pwd" placeholder="password"/>
<button type=submit form="form1" value="submit">login</button>

I have redirected my form.php to open the html like:

if ($connect->query($query) === TRUE) {
header( 'Location: resultpg.html' );

} else {
echo "Error: " . $query . "<br>" . $connect->error;
}
Imacoder
  • 511
  • 5
  • 7

0 Answers0