[PHP] Re: General question...

2003-06-13 Thread Valentin
Thanks Bobby!



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



[PHP] Re: General question...

2003-06-12 Thread Bobby Patel
You can try using the cURL package with PHP. I use it with a system call.

$curl_path = /usr/bin/curl; # or full path of curl

$post = 'amount=3.40merchant_id=2351235'; #POST  key value pairs with ,
these variables will be POSTed to site

$command = $curl_path -d \$post\ $gateway_url;

exec($command, $responce);

the $responce variable holds any out put from the site.

Then you  will have to parse the HTML (which I hate).

The above technique is best for when the site you call post back variables
(thus no parsing).

Now, this is with PHP with no cURL package, if you have it installed than
maybe you can use the cURL Library to do the above.

Valentin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hi all,

 is it possible with php:
 first to pass request to another URL and after that to get the html
responce
 as a string and put it into php $variable?

 best,





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



[PHP] Re: General question...

2002-02-04 Thread Philip Hallstrom

Something along the lines of:

if( ereg(/confirm.php, $_SERVER['HTTP_REFERER']) )  {
Header(Location: thanks.php);
exit;
}else {
Header(Location: index.php);
exit;
}

You might want to do some additional checking as well.. the above would
match both /path/to/confirm.php as well as
/path/to/somewhere/else.php?fakeit=/confirm.php)

I'll leave that sort of stuff up to you :)

On Wed, 30 Jan 2002, jas wrote:

 Ok I think I know what I need to learn... how can I do a redirect based on
 whether or not a user came from a certain page?  For example... if a user
 comes from a page called confirm.php then it takes them to a page called
 thanks.php and if the user came from a different server or typed the url
 directly then it would redirect the user to the index.php page?
 Thanks in advance...
 Jas
 P.S. A tutorial on this would definately prevent me from posting the same
 question again. =)



 --
 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] Re: General question...

2002-02-04 Thread Lars Torben Wilson

On Mon, 2002-02-04 at 13:52, Philip Hallstrom wrote:
 Something along the lines of:
 
 if( ereg(/confirm.php, $_SERVER['HTTP_REFERER']) )  {
   Header(Location: thanks.php);
   exit;
 }else {
   Header(Location: index.php);
   exit;
 }
 
 You might want to do some additional checking as well.. the above would
 match both /path/to/confirm.php as well as
 /path/to/somewhere/else.php?fakeit=/confirm.php)
 
 I'll leave that sort of stuff up to you :)

One other note: you cannot trust the user agent to even send referrer 
header. They aren't required to, and it's quite easy to spoof (tools
such as wget and curl even include commands specifically so they can
lie about where they came from).

In short, you can never really know. You could, I suppose, make users
log in and track them with a session. Otherwise, while you *can* do
something like what you propose, it'll never be particularly robust
when using $HTTP_REFERER.


Torben

 On Wed, 30 Jan 2002, jas wrote:
 
  Ok I think I know what I need to learn... how can I do a redirect based on
  whether or not a user came from a certain page?  For example... if a user
  comes from a page called confirm.php then it takes them to a page called
  thanks.php and if the user came from a different server or typed the url
  directly then it would redirect the user to the index.php page?
  Thanks in advance...
  Jas
  P.S. A tutorial on this would definately prevent me from posting the same
  question again. =)
 
 
 
  --
  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
 
-- 
 Torben Wilson [EMAIL PROTECTED]
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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