My super newb question
Moderator: General Moderators
My super newb question
This is going to seem really stupid, but im stumped.
I have a form name form.html that looks like this:
<html>
<head>
<title>Form</title>
</head>
<body>
<form action="profile.php" method=post>
E-mail:
<br><input type="text" name="email">
<br>
Screen Name:
<br>
<input type="text" name="sm">
<br>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
and a php file called profile.php that looks like this:
<?php
echo "$email";
echo "$sm";
?>
But nothing happens when I enter stuff in the form, it gives me a blank page. Try it at http://68.80.101.77/form.html
Thanks
I have a form name form.html that looks like this:
<html>
<head>
<title>Form</title>
</head>
<body>
<form action="profile.php" method=post>
E-mail:
<br><input type="text" name="email">
<br>
Screen Name:
<br>
<input type="text" name="sm">
<br>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
and a php file called profile.php that looks like this:
<?php
echo "$email";
echo "$sm";
?>
But nothing happens when I enter stuff in the form, it gives me a blank page. Try it at http://68.80.101.77/form.html
Thanks
try this:
Code: Select all
<?php
echo "$_POST[email]<br>\n";
echo "$_POST[sm]<br>\n";
?>test this then:
on profile.php:
when u use GET, PHP save the form varibales and stuff in an array called $_GET[]
on profile.php:
Code: Select all
<?php
echo $_GET['email'];
echo $_GET['sm'];
?>liljester wrote:his form is using the POST method (<form action="profile.php" method="post">)... $_GET will prolly be empty
oops, forgot to mention that
ok, ill continue here:
form.html:
Code: Select all
<html>
<head>
<title>Form</title>
</head>
<body>
<form action="profile.php" method="get">
E-mail:
<br><input type="text" name="email">
<br>
Screen Name:
<br>
<input type="text" name="sm">
<br>
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>Code: Select all
<?php
echo $_GET['email'];
echo $_GET['sm'];
?>-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA