Using $_SERVER[PHP_SELF]
Posted: Tue Nov 07, 2006 3:46 pm
Burrito | Please use
and here is the if statement...
Now when I access the page in my explorer it shows the form, but when I submit it throws up an ie error page. If anyone can help me out I would so greatly appreciate it. Thanks
Burrito | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello all:
I'm trying to use $SERVER[PHP_SELF] in my action parameter in my HTML form tag. And it works when I just type it out as an HTML form. But I'm trying to echo the form code in a php function to be called in an if statement in the body area. Here's a snippet of what I have so far...Code: Select all
function showform()
{
echo '
<form action="<?PHP echo $_SERVER[PHP_SELF]; ?>" method="post">
Username: <input type="text" name="username" tabindex=1 >
Password: <input type="text" name="password" tabindex=2 >
<input type="hidden" name="submitted" value="submitted" >
<input type="submit" name="submit" value="Submit" >
</form>
';
}Code: Select all
<body>
<?php
if (array_key_exists('submitted', $_POST))
{
nextform();
}
else
{
showform();
}
?>
</body>Burrito | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]