cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: curl-and-php Digest, Vol 26, Issue 14

From: sunil kumar <sunil.rajput81_at_gmail.com>
Date: Mon, 12 Nov 2007 16:49:03 +0530

Dear,
         I have a problem, I want to redirect to user from one server
to other server.
Description:

First user send the request to server A for a login module which is
implemented at server B and server B send the login module to user if
request comes from server A. server B check the IP of server A if ip
match the it will give the login module otherwise nothing.

Now how server A redirect to user at server B because by
header("Location: http://blah.com"); function Server B found the
remote address of user not server A. how we send the request to server
B for user redirection. Is it possible or not in php/curl.

On Oct 28, 2007 4:30 PM, <curl-and-php-request_at_cool.haxx.se> wrote:
> Send curl-and-php mailing list submissions to
> curl-and-php_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> or, via email, send a message with subject or body 'help' to
> curl-and-php-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-and-php-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-and-php digest..."
>
>
> Today's Topics:
>
> 1. Re: TFTP PUT in PHP (Daniel Stenberg)
> 2. Re: TFTP PUT in PHP (simon_at_ice.org)
> 3. Re: TFTP PUT in PHP (Daniel Stenberg)
> 4. Re: TFTP PUT in PHP (simon_at_ice.org)
> 5. Re: TFTP PUT in PHP (Daniel Stenberg)
> 6. Re: Quotes: Single, double, and NONE (Colleen R. Dick)
> 7. Re: Quotes: Single, double, and NONE (simon_at_ice.org)
> 8. please help (sunil kumar)
> 9. Re: please help (Mark E)
> 10. Re: please help (Mark E)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 27 Oct 2007 15:10:51 +0200 (CEST)
> From: Daniel Stenberg <daniel_at_haxx.se>
> Subject: Re: TFTP PUT in PHP
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <Pine.LNX.4.64.0710271510330.27932_at_yvahk3.pbagnpgbe.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sat, 27 Oct 2007, Mino Bernardi wrote:
>
> >> Surely the double quotes used all over make a difference?
> > Sure indeed. There's no difference between " and ' in PHP, in this case.
>
> Yes, but single quotes would be wrong too wouldn't them?
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 27 Oct 2007 15:14:57 +0200
> From: simon_at_ice.org
> Subject: Re: TFTP PUT in PHP
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <472339D1.6050806_at_ice.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Daniel Stenberg wrote:
> > On Sat, 27 Oct 2007, Mino Bernardi wrote:
> >
> >
> >>> Surely the double quotes used all over make a difference?
> >>>
> >> Sure indeed. There's no difference between " and ' in PHP, in this case.
> >>
> >
> > Yes, but single quotes would be wrong too wouldn't them?
> >
> >
> Single or double quotes can be used fairly synonymously in PHP.
> The only exception is when quoting variables.
> I can attest using single or double quotes in curl declarations in PHP
> make no difference.
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 27 Oct 2007 15:31:09 +0200 (CEST)
> From: Daniel Stenberg <daniel_at_haxx.se>
> Subject: Re: TFTP PUT in PHP
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <Pine.LNX.4.64.0710271530010.27932_at_yvahk3.pbagnpgbe.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sat, 27 Oct 2007, simon_at_ice.org wrote:
>
> > I can attest using single or double quotes in curl declarations in PHP make
> > no difference.
>
> So are you saying that in PHP land the following two lines are identical?
>
> curl_setopt($c, "CURLOPT_PUT", "TRUE");
>
> curl_setopt($c, CURLOPT_PUT, TRUE);
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
>
> ------------------------------
>
> Message: 4
> Date: Sat, 27 Oct 2007 15:37:53 +0200
> From: simon_at_ice.org
> Subject: Re: TFTP PUT in PHP
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <47233F31.3030402_at_ice.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Daniel Stenberg wrote:
> > On Sat, 27 Oct 2007, simon_at_ice.org wrote:
> >
> >
> >> I can attest using single or double quotes in curl declarations in PHP make
> >> no difference.
> >>
> >
> > So are you saying that in PHP land the following two lines are identical?
> >
> > curl_setopt($c, "CURLOPT_PUT", "TRUE");
> >
> > curl_setopt($c, CURLOPT_PUT, TRUE);
> >
> >
> Simply: Yes.
>
> curl_setopt($c, CURLOPT_PUT, TRUE);
> ==
>
> curl_setopt($c, "CURLOPT_PUT", "TRUE");
> ==
> curl_setopt($c, 'CURLOPT_PUT', "TRUE");
> ==
>
> curl_setopt($c, CURLOPT_PUT, 'TRUE');
>
> The only difference comes in with variables.
> echo "$foo"
> is NOT the same as
> echo '$foo'
>
> [The first dumps the contents of $foo, the second dumps '$foo']
>
>
>
> ------------------------------
>
> Message: 5
> Date: Sat, 27 Oct 2007 15:42:04 +0200 (CEST)
> From: Daniel Stenberg <daniel_at_haxx.se>
> Subject: Re: TFTP PUT in PHP
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <Pine.LNX.4.64.0710271540540.27932_at_yvahk3.pbagnpgbe.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sat, 27 Oct 2007, simon_at_ice.org wrote:
>
> > Simply: Yes.
> >
> > curl_setopt($c, CURLOPT_PUT, TRUE);
> > curl_setopt($c, "CURLOPT_PUT", "TRUE");
>
> Thanks, I always thought the CURLOPT_* things were some kind of containers
> holding the numerical values libcurl uses for them, not the strings...
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
>
> ------------------------------
>
> Message: 6
> Date: Sat, 27 Oct 2007 08:40:29 -0700
> From: "Colleen R. Dick" <platypus_at_proaxis.com>
> Subject: Re: Quotes: Single, double, and NONE
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <1193499629.15493.278.camel_at_localhost.localdomain>
> Content-Type: text/plain
>
>
> People:
> Back to PHP basics: PHP is flawed but not *THAT* flawed.
> (apologies to most of you who know this) here is how it rolls.
> Double quotes and single treat embedded variables differently.
> "foo" and 'foo' happen to be the same because
> there is no variable in it. For this reason single quotes are more
> efficient.
> However if $a == 1 then "foo$a" evaluates to foo1 and 'foo$a' is just
> foo$a
>
> In the case of curl declarations, CONSTANTS like CURLOPT_PUT are
> arbitrary constants defined in the curl module and substituted
> textually. Someone may be passing actual arg strings such as post
> var strings that have no embedded variables and getting away with not
> knowing the difference between single and double, but for constants that
> will not fly. You DON'T quote them at all single or double.
>
> The constant strings are used
> both for human legibility and maintainability of the module. Normally we
> don't care what it is.
>
> You can test if you print CURLOPT_PUT; and print "CURLOPT_PUT";
> there will be a difference.
>
> On Sat, 2007-10-27 at 15:31 +0200, Daniel Stenberg wrote:
> > On Sat, 27 Oct 2007, simon_at_ice.org wrote:
> >
> > > I can attest using single or double quotes in curl declarations in PHP make
> > > no difference.
> >
> > So are you saying that in PHP land the following two lines are identical?
> >
> > curl_setopt($c, "CURLOPT_PUT", "TRUE");
> >
> > curl_setopt($c, CURLOPT_PUT, TRUE);
> >
>
>
>
> ------------------------------
>
> Message: 7
> Date: Sat, 27 Oct 2007 17:50:14 +0200
> From: simon_at_ice.org
> Subject: Re: Quotes: Single, double, and NONE
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <47235E36.6090107_at_ice.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Apologies for the top post.
> I can guarantee that before I posted, just to be sure, I tried every
> variation that I posted, and ran them through the Zend IDE debugger,
> with exactly the same result each time.
> Product PHP might be different, but I'd be surprised.
>
> Colleen R. Dick wrote:
> > People:
> > Back to PHP basics: PHP is flawed but not *THAT* flawed.
> > (apologies to most of you who know this) here is how it rolls.
> > Double quotes and single treat embedded variables differently.
> > "foo" and 'foo' happen to be the same because
> > there is no variable in it. For this reason single quotes are more
> > efficient.
> > However if $a == 1 then "foo$a" evaluates to foo1 and 'foo$a' is just
> > foo$a
> >
> > In the case of curl declarations, CONSTANTS like CURLOPT_PUT are
> > arbitrary constants defined in the curl module and substituted
> > textually. Someone may be passing actual arg strings such as post
> > var strings that have no embedded variables and getting away with not
> > knowing the difference between single and double, but for constants that
> > will not fly. You DON'T quote them at all single or double.
> >
> > The constant strings are used
> > both for human legibility and maintainability of the module. Normally we
> > don't care what it is.
> >
> > You can test if you print CURLOPT_PUT; and print "CURLOPT_PUT";
> > there will be a difference.
> >
> > On Sat, 2007-10-27 at 15:31 +0200, Daniel Stenberg wrote:
> >
> >> On Sat, 27 Oct 2007, simon_at_ice.org wrote:
> >>
> >>
> >>> I can attest using single or double quotes in curl declarations in PHP make
> >>> no difference.
> >>>
> >> So are you saying that in PHP land the following two lines are identical?
> >>
> >> curl_setopt($c, "CURLOPT_PUT", "TRUE");
> >>
> >> curl_setopt($c, CURLOPT_PUT, TRUE);
> >>
> >>
> >
> > _______________________________________________
> > http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
> >
>
>
> ------------------------------
>
> Message: 8
> Date: Sat, 27 Oct 2007 23:00:09 +0530
> From: "sunil kumar" <sunil.rajput81_at_gmail.com>
> Subject: please help
> To: curl-and-php_at_cool.haxx.se
> Message-ID:
> <c7c2709d0710271030l23a35ba2tdad1b56236df1b59_at_mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dir
>
> how to redirect a url from one server to second server. and second
> server check the ip of first server from where the request comes.
>
> only request comes from one server not from user. user request that url from
> browser.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://cool.haxx.se/pipermail/curl-and-php/attachments/20071027/53f866ac/attachment-0001.htm
>
> ------------------------------
>
> Message: 9
> Date: Sat, 27 Oct 2007 15:14:21 -0600
> From: Mark E <mark_at_edwards.org>
> Subject: Re: please help
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <4723AA2D.3060801_at_edwards.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
>
> sunil kumar wrote:
> > Dir
> >
> > how to redirect a url from one server to second server. and second
> > server check the ip of first server from where the request comes.
>
> Redirect - put this in the index file for the site with no other code in
> the file:
>
> <?php
> header("Location: http://blah.com");
> ?>
>
> Detect and print IP to the browser screen:
>
> <?php
> $ip = $ip=$_SERVER['REMOTE_ADDR'];
> echo $ip;
> ?>
>
> Mark
>
>
> ------------------------------
>
> Message: 10
> Date: Sat, 27 Oct 2007 16:22:22 -0600
> From: Mark E <mark_at_edwards.org>
> Subject: Re: please help
> To: curl with PHP <curl-and-php_at_cool.haxx.se>
> Message-ID: <4723BA1E.6040108_at_edwards.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
>
> Mark E wrote:
>
> > Detect and print IP to the browser screen:
> >
> > <?php
> > $ip = $ip=$_SERVER['REMOTE_ADDR'];
> > echo $ip;
> > ?>
>
> Correction due to cut and paste error:
>
> <?php
> $ip = $_SERVER['REMOTE_ADDR'];
> echo $ip;
> ?>
>
>
> Mark
>
>
> ------------------------------
>
> _______________________________________________
> curl-and-php mailing list
> curl-and-php_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>
> End of curl-and-php Digest, Vol 26, Issue 14
> ********************************************
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-11-12