[PHP] Using POST to pass variables

2005-11-30 Thread Todd Cary
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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using POST to pass variables

2005-11-30 Thread EasyHorpak.com

use $_POST[btnSend];  to use post method





- Original Message - 
From: Todd Cary [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Thursday, December 01, 2005 11:50 AM
Subject: [PHP] Using POST to pass variables


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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using Post like Get

2004-08-14 Thread Kim Steinhaug
Since you are on the same server, I hope you mean the same domain.
If not the session variable wouldnt work very well.

But if you infact are on the same domain, you should look into the session
variable and store everything you need. From what I know there are now
limits on how much you can store in a session, that said I wouldt pump
several megabytes into it...

Several good answers here, but it looks like most of us agree on the
session.
Cookies can ofcourse also be used, but this also means that you require all
your clients to have them enabled. Anyways, even when using cookies I
always use session as the main system - cookies only works as a
saved session in my systems. (Meaning, instead of having to logg onto
the system again, the username and passowrd are stored in a cookie, this
way the user can choose the famous remember me setting many of us enjoy).

-- 
Kim Steinhaug
-
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-
www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
-


Dennis Gearon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 What I'm trying to achieve is to have the same cookie IDENTIFY a user on
 different (or same) applications (on the same server), but require them
 to log in for each application, and get a different session.. Basically,
 to keep separate 'user trails and in process variables' for different
 tabs or windows in a browser.

 www.scotttrade.com does it somehow, and I see no GET variables on the URL.

 John W. Holmes wrote:

  Dennis Gearon wrote:
 
  With get varaibles, it's possible to always have get variables on a
  page, even without a form, by simply appending the Get variables to
  the end of the URL.
 
  Is there anyway to do the same with Post variables? For instance, a
  javascript that onUnload submit, or something?
 
 
  You can't just include POST variables in a link, if that's what you're
  going for. Perhaps some clunky javascript submitting a hidden form on
  an onclick method would get you close, but why even bother?
 
  Maybe you should just say what you're actually trying to achieve and
  why, then we could offer better alternatives.
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using Post like Get

2004-08-13 Thread Joshua D. Drake
Dennis Gearon wrote:
What I'm trying to achieve is to have the same cookie IDENTIFY a user on 
different (or same) applications (on the same server), but require them 
to log in for each application, and get a different session.. Basically, 
to keep separate 'user trails and in process variables' for different 
tabs or windows in a browser.
Why not just keep an acl list of which applications a particular session 
is logged in for? What I mean is you have your sessions table. You know 
they are logged in.

User foo: logged into app a
User foo: Goes to app b
  App b recognizes the name of the cookie and checks the value against
  the session table. If true --
User foo: is recognized but requested to log in
When User foo logs in, the auth table is updated to reflect that they 
are not authenticated against a different part of the site.

Sincerely,
Joshua D. Drake
Your Web Host ;)
Sincerely,
Joshua D. Drake

www.scotttrade.com does it somehow, and I see no GET variables on the URL.
John W. Holmes wrote:
Dennis Gearon wrote:
With get varaibles, it's possible to always have get variables on a 
page, even without a form, by simply appending the Get variables to 
the end of the URL.

Is there anyway to do the same with Post variables? For instance, a 
javascript that onUnload submit, or something?

You can't just include POST variables in a link, if that's what you're 
going for. Perhaps some clunky javascript submitting a hidden form on 
an onclick method would get you close, but why even bother?

Maybe you should just say what you're actually trying to achieve and 
why, then we could offer better alternatives.



--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Using Post like Get

2004-07-23 Thread Dennis Gearon
With get varaibles, it's possible to always have get variables on a 
page, even without a form, by simply appending the Get variables to the 
end of the URL.

Is there anyway to do the same with Post variables? For instance, a 
javascript that onUnload submit, or something?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using Post like Get

2004-07-23 Thread raditha dissanayake
Dennis Gearon wrote:
With get varaibles, it's possible to always have get variables on a 
page, even without a form, by simply appending the Get variables to 
the end of the URL.

Is there anyway to do the same with Post variables? For instance, a 
javascript that onUnload submit, or something?
Your question is not very clear but here goes:
Post usually means the data is in the body of the message. In other 
words after sending the request headers you need to write the data for 
the 'payload' which may be your variables if you are using 
www/url-encoded but can be any content type you want it to be. THis is 
not something that you can do with javascript because you do not get 
direct access to the streams with javascript.


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using Post like Get

2004-07-23 Thread John W. Holmes
Dennis Gearon wrote:
With get varaibles, it's possible to always have get variables on a 
page, even without a form, by simply appending the Get variables to the 
end of the URL.

Is there anyway to do the same with Post variables? For instance, a 
javascript that onUnload submit, or something?
You can't just include POST variables in a link, if that's what you're 
going for. Perhaps some clunky javascript submitting a hidden form on an 
onclick method would get you close, but why even bother?

Maybe you should just say what you're actually trying to achieve and 
why, then we could offer better alternatives.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using Post like Get

2004-07-23 Thread Dennis Gearon
What I'm trying to achieve is to have the same cookie IDENTIFY a user on 
different (or same) applications (on the same server), but require them 
to log in for each application, and get a different session.. Basically, 
to keep separate 'user trails and in process variables' for different 
tabs or windows in a browser.

www.scotttrade.com does it somehow, and I see no GET variables on the URL.
John W. Holmes wrote:
Dennis Gearon wrote:
With get varaibles, it's possible to always have get variables on a 
page, even without a form, by simply appending the Get variables to 
the end of the URL.

Is there anyway to do the same with Post variables? For instance, a 
javascript that onUnload submit, or something?

You can't just include POST variables in a link, if that's what you're 
going for. Perhaps some clunky javascript submitting a hidden form on 
an onclick method would get you close, but why even bother?

Maybe you should just say what you're actually trying to achieve and 
why, then we could offer better alternatives.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using Post like Get

2004-07-23 Thread raditha dissanayake
Dennis Gearon wrote:
What I'm trying to achieve is to have the same cookie IDENTIFY a user 
on different (or same) applications (on the same server), but require 
them to log in for each application, and get a different session.. 
Basically, to keep separate 'user trails and in process variables' for 
different tabs or windows in a browser.
What you need then is PHP session management stuff - it's very unlikely 
that you will need to tincker with the protocol. PHP session management 
will take care of everything (except securing the system which you need 
to do ;-)


www.scotttrade.com does it somehow, and I see no GET variables on the 
URL.

John W. Holmes wrote:
Dennis Gearon wrote:
With get varaibles, it's possible to always have get variables on a 
page, even without a form, by simply appending the Get variables to 
the end of the URL.

Is there anyway to do the same with Post variables? For instance, a 
javascript that onUnload submit, or something?

You can't just include POST variables in a link, if that's what 
you're going for. Perhaps some clunky javascript submitting a hidden 
form on an onclick method would get you close, but why even bother?

Maybe you should just say what you're actually trying to achieve and 
why, then we could offer better alternatives.



--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using Post like Get

2004-07-23 Thread John W. Holmes
Dennis Gearon wrote:
What I'm trying to achieve is to have the same cookie IDENTIFY a user on 
different (or same) applications (on the same server), but require them 
to log in for each application, and get a different session.. Basically, 
to keep separate 'user trails and in process variables' for different 
tabs or windows in a browser.
Can't you just set $_SESSION['application_name']['loggedin'] = TRUE for 
the various applications? If they are accessing application widget, 
then checking for isset($_SESSION['widget']['loggedin']) will tell you 
whether they are logged in or not. Or am I missing something?

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals  www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Using Post like Get

2004-07-23 Thread Matthew Sims
 What I'm trying to achieve is to have the same cookie IDENTIFY a user on
 different (or same) applications (on the same server), but require them
 to log in for each application, and get a different session.. Basically,
 to keep separate 'user trails and in process variables' for different
 tabs or windows in a browser.

 www.scotttrade.com does it somehow, and I see no GET variables on the URL.


What about $_SESSION variables? You can use the $_SESSION to keep the same
identity from page to page and still require a different login when
needed.

--
--Matthew Sims
--http://killermookie.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using Post like Get

2004-07-23 Thread Frank Munch
Hi,
a cookie is path-specific - can that help you?
Frank

At 10:54 PM 8/23/2004, you wrote:
What I'm trying to achieve is to have the same cookie IDENTIFY a user on 
different (or same) applications (on the same server), but require them to 
log in for each application, and get a different session.. Basically, to 
keep separate 'user trails and in process variables' for different tabs or 
windows in a browser.

www.scotttrade.com does it somehow, and I see no GET variables on the URL.
John W. Holmes wrote:
Dennis Gearon wrote:
With get varaibles, it's possible to always have get variables on a 
page, even without a form, by simply appending the Get variables to the 
end of the URL.

Is there anyway to do the same with Post variables? For instance, a 
javascript that onUnload submit, or something?

You can't just include POST variables in a link, if that's what you're 
going for. Perhaps some clunky javascript submitting a hidden form on an 
onclick method would get you close, but why even bother?

Maybe you should just say what you're actually trying to achieve and why, 
then we could offer better alternatives.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] using POST

2002-02-12 Thread ZILBER,LEONID (HP-NewJersey,ex1)

Hi guys,

I have assembled an XML file, encrypted it and now ready to pass it to an
outside server.

$encryptedXML file contains encrypted value of an XML file

How can I send the XML-(URL encoded) within the HTTPS-POST. The reason for
sending the cleartext XML URL encoded is to allow for the special characters
such as ''  and '' to be sent across the HTTP protocol.

$msgToBePosted = EOD
htmlheadtitlePost/title/head
form method='POST'
action='https://alpha.server.com/test/DeliverReg/default.asp'
input type=hidden name=PARAMS value=$encryptedXMLFile
/form/body/html
EOD;

Do you know how can I POST the above $msgToBePosted? 
Basically, I want to pass the above form to the
https://alpha.server.com/test/DeliverReg/default.asp, the value must be
hidden, having name=PARAMS and value=$encryptedXMLFile

Thank you,
Leon
---
Leon Zilber
HP Internet Operation RD Lab
phone: 973.443.78.82
email: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Using post method thru php-script

2001-06-25 Thread Richard Lynch

 $fp = fsockopen('secure.aaa.com',443,$err_num,$err_msg);

Talking to an SSL server on port 443 is a bit more complicated than chatting
up an HTTP server on port 80.

You have to pre-negotiate your encryption algorithms and send some public
keys back and forth to generate some more public/private key-pairs and...

While DIY is tons of fun, with a deadline of the 27th looming, I'd look into
using cURL.

Search the archives for URLs and further info on cURL.  Last I heard,
somebody was gonna integrate cURL direct into PHP, but I've been out of it
for awhile.

Oh yeah: I'm back! :-)

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Using post method thru php-script

2001-06-23 Thread George Alexander

Hi,

I am developing a shopping-cart application and i need to 
authorize the credit-card no. of the customer.

I need to use a post method thru my php-script a replica 
of which I am giving below:

Script Start:

// Build the request string

$request.='cardnum='.urlencode();
$request.='address='.urlencode(99 xyz);
$request.='zipcode='.urlencode(96004);
$request.='amount='.urlencode(2.00); 

// Build the header 

$header=POST /cgi-bin/xyz.exe HTTPS/1.0\r\n; 
$header.=Host: secure.aaa.com\n. User-Agent: PostIt\r\n;
$header.=Content-type: application/x-www-form-urlencoded\r\n; 
$header.=Content-length: .strlen($request).\r\n\r\n; 

// Open the connection 
$fp = fsockopen('secure.aaa.com',443,$err_num,$err_msg); 
$i=0;
if ($fp) 
{ 
 // Send everything 
fputs($fp,$header.$request); 

 // Get the response
$response=I am in;
 while (!feof($fp))
 {
$response.=fgets($fp,128);
$i++;
 }
 fclose($fp);
}
else
$response=Dead;
?
html
head
titleResponse from aaa.com/title
/head

body bgcolor=#FF
p
? echo Response from aaa: .$response; ?
? echo brNo. of loops: .$i; ?
? echo brError no: .$err_num. Error Message: .$err_msg; ?
/p
/body
/html

Script End.

In the above code I am posting my form data to
 https://secure.aaa.com/cgi-bin/xyz.exe which 
processes the credit card and returns some 
string values showing whether the credit-card 
is valid or not.

My question is that whether the method I'm 
using is correct to post data to secure servers.
Well my code runs on a normal server ie. non-
secure.
My code is able to connect to the secure 
server i.e fsockopen works but i do not get
any response from the server. 
Well you can judge this by the result I am 
getting on my browser.
The result  I am getting on browser is:

Response from aaa: I am in 
No. of loops: 1 
Error no: 0 Error Message:

So am i doing anything wrong somewhere or is
there some other way to do this thing.

Please help asap. I need to finish this stuff by 27th
of this month.

regards
George


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]