01.08.2011, 17:59
Hello. I wanted to make Submit button and when press, it redirects to url (eg: hostname.com/users.php?name=submited text
But i don't know how to redirect to this link. I was trying a lot of ways but noone worked.
I do this on submit page:
Then on mydomain/serveronline.php:
But i get this:
Parse error: syntax error, unexpected T_STRING in /home/mindauga/domains/mydomain.com/public_html/serveronline.php on line 4
But i don't know how to redirect to this link. I was trying a lot of ways but noone worked.
I do this on submit page:
PHP код:
<html><head>Single-button form</head>
<body>
<form action="mydomain/serveronline.php" method="post"> Enter a number: <input type="text" name="number" size="3"> <br>
<input type="submit" name="submit"> </form>
</body>
</html>
PHP код:
<?php
if ($_POST['submit'])
{
header('Location: http://www.mydomain.com/blog.php?name=. $_POST['number']');
}
?>
Parse error: syntax error, unexpected T_STRING in /home/mindauga/domains/mydomain.com/public_html/serveronline.php on line 4