Reply to Re: Using POST to pass variables

Your name:

Reply:


Posted by David Robley on 10/24/88 11:33

Todd Cary wrote:

> Except this passes the "message" in the URL. Is there a way to pass
> variables as a POST (not in the URL)?

If you use the POST method, the message won't be passed in the URL - unless
there is something you aren't telling us :-)
>
> I have a class that creates a new socket, however on my client's shared
> server, the creation of sockets is not allowed. With a new socket, I am
> able to pass the variable information via the socket (POST).
>
> Todd
>
> David Robley wrote:
>> Todd Cary wrote:
>>
>>> When I have more than one button on a page, I us what I call a reentrant
>>> approach. That is the page calls itself.
>>>
>>> If the page is emailer.pgp, the the FORM tag would be
>>>
>>> <form method="get" action="emailer.php">
>>>
>>> At the top is
>>>
>>> <?php
>>> $send = $_GET[btnSend]; // Send button pressed
>>> $cancel = $_GET[btnCancel];// Cancel is pressed
>>> $message = $_GET[message];
>>> if ($send) {
>>> header("location: send.php?message=" . $message);
>>> }
>>> if ($cancel) {
>>> header("location: index.php");
>>> }
>>> ?>
>>>
>>> Is there a better way to do this so I can use a POST form?
>>>
>>> Thank you...
>>>
>>> Todd
>> What about:
>>
>> <form method="post" action="emailer.php">
>>
>> and
>>
>> if (isset($_POST['send']) ) {
>> # do some sanitising on $_POST['message'] here
>> header("location: http://f.q.d.n/path/to/send.php?message=" .
>> $_POST['message']);
>> }
>> exit();
>>
>> if (isset($_POST['cancel']) ) {
>> header("location: http://f.q.d.n/path/to/index.php");
>> }
>>
>> Add other sanity checks as required.
>>
>>
>> Cheers




Cheers
--
David Robley

"Someone removed all the twos from this deck," Tom deduced.

[Back to original 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

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