You are here: Re: Form submission . « HTML « IT news, forums, messages
Re: Form submission .

Posted by Jonathan N. Little on 10/30/06 15:08

Vince Morgan wrote:
> "Jonathan N. Little" <lws4art@centralva.net> wrote in message
> news:88896$45456f6a$40cba7c2$19934@NAXS.COM...
>> Vince Morgan wrote:
>>> "Sandeep" <sandeepsinghal@gmail.com> wrote in message
>>> news:1162174842.447626.122950@f16g2000cwb.googlegroups.com...
>
>> Well of course if "dummy.php" doesn't exist you'll get a 404. Your
>> form's ACTION *must* point to a real file! Now is can be the *same* file
>> as your original form, i.e., post to itself.
>>
>>
>> --
>> Take care,
>>
>> Jonathan
> Thank you Jonathan,
> Well, dummy.php did exist, just not in that directory. Stupid, stupid, etc.
> That said it still won't do what I want.
> Is it at all possible to create a page, with inputs, that will allow me to
> add data and post it without the page wanting to change?
> A static type page from which I can post data?
> I actualy thought this would be quite easy.

Look Vince if you want a form to actually submit the data the URL will
change to whatever is in the ACTION property. That is just how forms
work. If you don't go to the ACTION's url then the data is not
transmitted. Now as I said you can give the appearance that the form is
static by posting to yourself.

//quagmire.php
<?php
if( isset($_POST['times']) ){
$visits=$_POST['times'];
$visits++;
$msg="Welcome back, you have visited $visits time[s]";
}
else {
$visits=0;
$msg="Welcome to the Quagmire, press the Submit button";
}

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Quagmire</title>
</head>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"
enctype="application/x-www-form-urlencoded">
<p><?php echo $msg; ?></p>
<div>
<input name="times" type="hidden" value="<?php echo $visits; ?>">
<input type="submit">
</div>
</form>
</body>
</html>


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация