Re: [PHP] need a little help all
- Original Message - From: "Richard Davey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 29, 2003 4:52 AM Subject: Re: [PHP] need a little help all > Hello, > > Wednesday, December 17, 2003, 11:50:52 AM, you wrote: > > wmc> Here is what i have i call 2 cookies in the top of my script, now i need to > wmc> call another when another script is called but it keeps givin me the error > wmc> headers already sent, > wmc> now ive seen this done in other scripts but wont work for me so please help > wmc> me is it in my php.ini or is it just not possible and imagened seeing it > wmc> somwhere else. Thanks all. > > You can access the value of cookies anywhere in your script, > regardless if the headers have been sent or not. However you cannot > SET a cookie once the headers have gone for use in the same page > session. This isn't a PHP setting, it's just not possible. - Output buffering might be hlepful. read the php documentation abt output buffering. - > > -- > Best regards, > Richardmailto:[EMAIL PROTECTED] > > -- > 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] need a little help all
Hello, Wednesday, December 17, 2003, 11:50:52 AM, you wrote: wmc> Here is what i have i call 2 cookies in the top of my script, now i need to wmc> call another when another script is called but it keeps givin me the error wmc> headers already sent, wmc> now ive seen this done in other scripts but wont work for me so please help wmc> me is it in my php.ini or is it just not possible and imagened seeing it wmc> somwhere else. Thanks all. You can access the value of cookies anywhere in your script, regardless if the headers have been sent or not. However you cannot SET a cookie once the headers have gone for use in the same page session. This isn't a PHP setting, it's just not possible. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need a little help
Hmmm, I'm using exactly this: http://www.domain.com/images/image1.gif";; } else { $requestImage = "http://www.domain2.com/image2.gif";; } header ("Content-Type: image/gif"); header ("Content-Length: ". filesize($requestImage)); header ("Content-Disposition: inline; filename=" . $requestImage); readfile($requestImage); ?> And, it kind of works using Netscape although it hangs the progress bar for a really long time and prevents any gif animations from starting for a long time. When I try it with IE 5.5sp2, no go, just a broken image. -brian ** > -Original Message- > From: Girish Nath [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 28, 2002 7:55 PM > To: Brian V Bonini > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Need a little help > > > Hi Brian > > I've just setup the RedirectMatch in Apache and tried the PHP script > (test.php) out and it worked fine. > > The only thing that caused broken image symbols to appear was if the image > redirect script (test.php) created any output before the header() > functions. > Check for whitespace or any functions that might be outputting error > messages within test.php > > Regards > > > Girish > -- > www.girishnath.co.uk > > > > - Original Message - > From: "Brian V Bonini" <[EMAIL PROTECTED]> > To: "Girish Nath" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, January 28, 2002 8:17 PM > Subject: RE: [PHP] Need a little help > > > 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éZ-ä(òS¡¹!n3pPßsfÔÓÄVoõ`\Z·Å"ô2'Ô?;Ur©e8òÞhS??0Ít^%;-,X > âÑ9>ºcI%",(CqxpR ¤Ô"4ûȶÔ&%03. Ì`?ÃåP? r ~éT > "ÀÃ^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:[EMAIL PROTECTED]] > > Sent: Monday, January 28, 2002 11:21 AM > > To: Brian V Bonini > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] Need a little help > > > > > > Hi > > > > This should send different images to the referer based on what > parse_url() > > returns: > > > > > > > $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" <[EMAIL PROTECTED]> > > To: "PHP Lists" <[EMAIL PROTECTED]> > > 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 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > 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 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 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 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]
RE: [PHP] Need a little help
What browser are you using? I just read in the annotated manual there may be issues wiht this using ie5.x. Do you have the script running on a public webserver where I can try it from here just to see if I get the same results? -Brian > -Original Message- > From: Girish Nath [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 28, 2002 7:55 PM > To: Brian V Bonini > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Need a little help > > > Hi Brian > > I've just setup the RedirectMatch in Apache and tried the PHP script > (test.php) out and it worked fine. > > The only thing that caused broken image symbols to appear was if the image > redirect script (test.php) created any output before the header() > functions. > Check for whitespace or any functions that might be outputting error > messages within test.php > > Regards > > > Girish > -- > www.girishnath.co.uk > > > > - Original Message - > From: "Brian V Bonini" <[EMAIL PROTECTED]> > To: "Girish Nath" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, January 28, 2002 8:17 PM > Subject: RE: [PHP] Need a little help > > > 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éZ-ä(òS¡¹!n3pPßsfÔÓÄVoõ`\Z·Å"ô2'Ô?;Ur©e8òÞhS??0Ít^%;-,X > âÑ9>ºcI%",(CqxpR ¤Ô"4ûȶÔ&%03. Ì`?ÃåP? r ~éT > "ÀÃ^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:[EMAIL PROTECTED]] > > Sent: Monday, January 28, 2002 11:21 AM > > To: Brian V Bonini > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] Need a little help > > > > > > Hi > > > > This should send different images to the referer based on what > parse_url() > > returns: > > > > > > > $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" <[EMAIL PROTECTED]> > > To: "PHP Lists" <[EMAIL PROTECTED]> > > 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 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > > 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 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 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 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]
Re: [PHP] Need a little help
Hi Brian I've just setup the RedirectMatch in Apache and tried the PHP script (test.php) out and it worked fine. The only thing that caused broken image symbols to appear was if the image redirect script (test.php) created any output before the header() functions. Check for whitespace or any functions that might be outputting error messages within test.php Regards Girish -- www.girishnath.co.uk - Original Message - From: "Brian V Bonini" <[EMAIL PROTECTED]> To: "Girish Nath" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, January 28, 2002 8:17 PM Subject: RE: [PHP] Need a little help 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éZ-ä(òS¡¹!n3pPßsfÔÓÄVoõ`\Z·Å"ô2'Ô?;Ur©e8òÞhS??0Ít^%;-,X âÑ9>ºcI%",(CqxpR ¤Ô"4ûȶÔ&%03. Ì`?ÃåP? r ~éT "ÀÃ^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:[EMAIL PROTECTED]] > Sent: Monday, January 28, 2002 11:21 AM > To: Brian V Bonini > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Need a little help > > > Hi > > This should send different images to the referer based on what parse_url() > returns: > > > $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" <[EMAIL PROTECTED]> > To: "PHP Lists" <[EMAIL PROTECTED]> > 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 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > 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 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 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]
RE: [PHP] Need a little help
hmmm, I think I see where your going but that either just puts out a lot of garbage on the screen: ¤X!lø`7Y± Á\t1h^(uT3è¡ J2¶O\ÔG)ÂGì Ìtéä(ò¡¹!n3pPßÔÓÄVõ`\Z·Åô2Ô;Ur©e8òÞhS0Ít%;-X âÑ9ºcI%(CqxpR ¤Ô4ûȶÔ&%03. Ì`ÃåP r é ÀÃ^IÀ¦Zª:;}äò,XOWýH0PE8´ä,Sx'ÀµT÷Src`ÀÏÀrBÀ7í¨òT ÙÑç|+iûJFAERKfÙ4 J³Ð² etc. or a broken image symbol. -B > -Original Message- > From: Girish Nath [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 28, 2002 11:21 AM > To: Brian V Bonini > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Need a little help > > > Hi > > This should send different images to the referer based on what parse_url() > returns: > > > $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" <[EMAIL PROTECTED]> > To: "PHP Lists" <[EMAIL PROTECTED]> > 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 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > 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 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]
Re: [PHP] Need a little help
Hi This should send different images to the referer based on what parse_url() returns: 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" <[EMAIL PROTECTED]> To: "PHP Lists" <[EMAIL PROTECTED]> 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 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- 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]
RE: [PHP] Need a little help with array
Try this instead: $sql = " SELECT CONCAT(fname, ' ', lname, '<', email, '>') AS str_email FROM customers "; and then the rest of your code.. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Richard Kurth [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 16, 2001 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] Need a little help with array I am trying to get the first name and Last name plus the email address out of the database in a format like this Richard Kurth<[EMAIL PROTECTED]>;Richard Kurth<[EMAIL PROTECTED]> so I can put it in the BCC section of a mail all customer program What I have below works for getting the email out but I can't figure out how to get the rest out all together $sql = "SELECT email,fname,lname FROM customers"; $result = mysql_query($sql); $recipient = array(); while ($myrow = mysql_fetch_array($result)) $recipient[] = $myrow["email"]; $recipient_list = implode(",", $recipient); Best regards, Richard mailto:[EMAIL PROTECTED] -- 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 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]