RE: [PHP] Need a little help

From: Date: Mon, 28 Jan 2002 20:17:25 +0000
Subject: RE: [PHP] Need a little help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-82462@lists.php.net to get a copy of this message
hmmm, I think I see where your going but that either just puts out a lot of garbage on the screen: ¤X!lø`7–Y± Á\t1h^€(uT”3衇 J2¶’O\ԑG)ÂGìˆ Ì–•t鎖ä(òŠ¡¹!n3pPߚƒÔÓÄVœõ`\Z·Å„ô2‘Ԁ;Ur©e8òÞhS€‰0Ítˆ%;-‚X âÑ9›ºcI%„‚(CqxpR ¤Ô„4ûȶÔ&%03. Ì`‰ÃåP† r ˜é™ “ÀÃ^IÀ¦•Zªˆ:;}ä‚ò,XOWýH0PE8´ä,Sx'ÀˆµT÷Src`ÀÏÀrBÀ7í¨òT ÙÑç|+iûJFA€ERKfÙ4 J³Ð² etc..... or a broken image symbol. -B > -----Original Message----- > From: Girish Nath [mailto:girishn@btinternet.com] > Sent: Monday, January 28, 2002 11:21 AM > To: Brian V Bonini > Cc: php-general@lists.php.net > Subject: Re: [PHP] Need a little help > > > Hi > > This should send different images to the referer based on what parse_url() > returns: > > <?php > > $url=parse_url($HTTP_REFERER); > if ($url[host] == "domain.com") { > $requestImage = "images/domain_A.gif"; > } > else { > $requestImage = "images/domain_B.gif"; > } > > header ("Content-Type: image/gif"); > header ("Content-Length: ". filesize($requestImage)); > header ("Content-Disposition: filename=" . $requestImage); > readfile($requestImage); > > ?> > > You may need to modify it a bit perhaps with a "switch" statement for more > flexibilty. Let me know how you get on. > > Regards > > > Girish > -- > www.girishnath.co.uk > > > > > ----- Original Message ----- > From: "Brian V Bonini" <b-bonini@cox.net> > To: "PHP Lists" <php-general@lists.php.net> > Sent: Monday, January 28, 2002 4:02 PM > Subject: [PHP] Need a little help > > > I'm trying to redirect based on referring host > and request. > > I have an .htaccess set up like this: > RedirectMatch (.*)\.gif$ > http://www.domain.com/_borders/test.php > to redirect all requests for .gif's to a php script which then > determines the referring host. > > $url=parse_url($HTTP_REFERER); > if ($url[host] == "domain.com") { > file://this is where I get stuck > do something > } else {do some thing} > > how to I return the correct image. I.e. if the referring page > has an <img src="mydomain.com/image"> link and I redirect requests for > that image to the php script to determine the host how can I now > return a different image for display into the page. Make sense? > Is it possible? > > -Brian > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#82462) next »