Sunday, 15 February 2015

html - php redirection with form values -



html - php redirection with form values -

i beginner @ php, want write script redirect me address attribute equal value of form input. right way?

index.html

<form action="process.php" method="post"> <input type="text" name="name" placeholder="your name" /> <input type="submit" /> </form>

and heres process.php:

<? header('location: level1.html?name=' . $_post['name']); ?>

for reason, doesn't work. there improve way? thanks!

<? header('location: level1.html?name=' . $_post['name']); ?>

change to

<?php header('location: level1.html?name=' . $_post['name']); ?>

edit:

make sure not output before using header()

php html forms

No comments:

Post a Comment