somebody explains to me

Web page creation, programs, scripts, PHP, SQL?

Moderator: Moderators

Postby synerz1_debian » Wed Aug 18, 2004 9:00 am

somebody explains to me: why this script doesnt work???
:huh:

<html>
<body>
<?php
if ($submit) {
echo "Información introducida.\n";
} else{
?>
<form method="post" action="<?php echo"$PHP_SELF"?>">
Nombre:<input type="Text" name="nombre"><br>
<input type="Submit" name="submit" value="Enter information">
</form>

<?php
} // end if
?>

</body>
</html>
:kwasny:
synerz1_debian
 

Postby miker_alpha » Wed Aug 18, 2004 2:45 pm

Well, this does.
Check for differences:
Code: Select all
<html>
<body>
<?php
$submit = $_POST['nombre'];
if ($submit) {
echo "Informacion introducida.\n";
    } else {
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "Nombre:<input type=\"Text\" name=\"nombre\"><br>";
echo "<input type=\"Submit\" name=\"submit\" value=\"Enter information\">";
echo '</form>';
 }
?>

</body>
</html>


:)
Good luck!

MikeR
Look for OpenVMS help on my webpage
Check for QOTD here.
Image
User avatar
miker_alpha
Moderator
Moderator
 
Posts: 256
Joined: Sat May 08, 2004 9:20 am
Location: Kibbutz Tzora, Israel

Postby prince18th » Tue Oct 05, 2004 5:30 am

Change : <form method="post" action="<?php echo"$PHP_SELF"?>">
To : <form method="post" action="<?=$PHP_SELF?>">
It's a small error in syntax but hard to see ... I think it works now
prince18th
 


Return to Web development

Who is online

Users browsing this forum: No registered users and 11 guests