[PHP] Global variables
I know there is a way to do it in Perl, but is there anyway in PHP to display all of the global variables. Such as OS, browser, date/time, that sort of thing I know I could print each one seperately, but are they all stored in an array somewhere?
[PHP] Hello $variable, whats your name?
I would like to know if there is a way to determine the name of a variable. Example: I have the variable $firstname, with a value of Jon I want to be able to echo name_of_variable : value_of_variable; So the user would see firstname : Jon I want to be able to do this without knowing what variables will be passed to the PHP script in advance. Any help is appreciated in advance. === And shepards we shall be For thee, my lord, for thee For thou hath descended forth from thy hands That our feats may swiftly carry out thy command We will flow a river forth unto thee And teaming with souls shall it ever be... === http://jcampbell.blacklightning.net -- 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] Complex IF statement
Thank you all for your help earlier! Now I need to know if it is possible to create a complex if statement? if ($variable=="duck") || ($variable=="goose"){ }else{ } Is how I thought it would work. I just need to know if there is an easy way to do an OR in if statements IF variable equals duck or goose... === And shepards we shall be For thee, my lord, for thee For thou hath descended forth from thy hands That our feats may swiftly carry out thy command We will flow a river forth unto thee And teaming with souls shall it ever be... === http://jcampbell.blacklightning.net -- 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] about:home
I know it is possible to redirect a user to their home page, but is it possible to determine what home page they are using?
[PHP] Slow running PHP
This is going to be a silly question. I have written the following form to mail script, and it works. But it takes a good minute or so to process. Can any one shed some light? I think it may have to do with the gethostbyaddr($REMOTE_ADDR) but if anyone else can help, that would be great. Jon Something unexpected happenedUser: There is nothing you can do"; echo "Webmaster: You can only call this script with 'POST'"; } else { $datevar = date("F j, Y"); $timevar = date("g:i a T"); $message .= "The following message was received from $HTTP_REFERER\non $datevar at $timevar\n\n"; if ($incall!=""){ $allvars = explode(",",$incall); $incto = $allvars[0]; $incsubject = $allvars[1]; $incurl = $allvars[2]; $incfrom = $allvars[3]; $incinfo = $allvars[4]; } if ($incinfo > 0 ){ $message .= "User's IP Address: $REMOTE_ADDR\n"; } if ($incinfo > 1 ){ $message .= "User's Browser: $HTTP_USER_AGENT\n"; } if ($incinfo > 2 ){ $resolvedhost = gethostbyaddr($REMOTE_ADDR); $message .= "User's Host Name: $resolvedhost\n"; } $message .= "\n"; while(list($key,$val)=each($HTTP_POST_VARS)) { //DO NOT PRINT SYSTEM VARIABLES if(($key=="incto") ||($key=="incsubject")||($key=="incurl")||($key=="incfrom")){ }elseif(($key=="incinfo")||($key=="incall")){ //PRINT ALL OTHER VARIABLES }else{ $message .= "$key: $val\n\n"; } } if ($incto==""){ echo "Something unexpected happenedUser: There is nothing you can do"; echo "Webmaster: You did not specify an e-mail address to receive this message"; } if ($incfrom==""){ $incfrom = "From: jcMail@$SERVER_NAME"; } else { $incfrom = "From: $incfrom"; } if ($incsubject==""){ $incsubject = "Message from jcMail: $datevar $timevar"; } if ($incurl==""){ $incurl = "$HTTP_REFERER"; } $message .="=--\nThis message brought to you by jcMail!"; mail("$incto", "$incsubject", $message, "$incfrom"); echo "Sending..."; echo ""; echo "Your message has been sentIf you are not automatically redirected, click here"; } ?>
[PHP] Basic fopen() question
I had an example of a function to open a file and read its contents into an array. It worked so that each line of the file was one element of the array. I can't find my example, nor can I get it to work the way I'd like. Any help? =- Jonathan Campbell ( [EMAIL PROTECTED] ) Mid days haze and I'm still not awake I got everything going but my bills are still late Funnier than hell and I think it's a blast Life's like a laugh when you got no money Lyrics from "Average Day" by Aztek Trip ( http://www.aztektrip.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]
Re: [PHP] Must Have Cookies. PHP/JavaScript
Not to sound overly obvious, but try this. setcookie("cookieusername","$username",time()+6048000,"/","",0); $cookieusername = $HTTP_COOKIE_VARS["cookieusername"]; if (!$cookieusername){ echo"Sorry, no cookie, no page."; die(); } =- Jonathan Campbell ( [EMAIL PROTECTED] ) Mid days haze and I'm still not awake I got everything going but my bills are still late Funnier than hell and I think it's a blast Life's like a laugh when you got no money Lyrics from "Average Day" by Aztek Trip ( http://www.aztektrip.com ) - Original Message - From: "Jeff Gannaway" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 05, 2001 4:36 PM Subject: [PHP] Must Have Cookies. PHP/JavaScript > OK, I'm working on a site that absolutely must use a cookie containing a > session identifier. > > I know how to set a cookie through PHP, but I need to do something else too. > > The same page MUST identifier whether the cookie was accepted or not. I've > seen sites like NetFlix.com that will test to see if their cookie was > accepted, and if not, print up a page that says "Sorry, you've got have > your Cookies on or go somewhere else." > > Does anyone know how to do this with PHP, Java, or JavaScript? > > Code examples or example URLs would be appreciated. > > Thanks, > Jeff Gannaway > ___ > > SUMMER ART PRINT SALE at www.PopStreet.com > Save an additional 10% off art print orders of $50 or more. > Type in coupon code jemc when checking out. > ___ > > Find the right art print for your home. > * Search by artist, color, art style and subject. > * Preview the art prints against your wall color. > * Specializing in contemporary, abstract and African > American art. > * Every day discounts on thousands of fine art prints. > > PopStreet.com is your avenue to art. > > > http://www.popstreet.com > ___ > Coupon may be redeemed from June 27 through July 31, 2001. > > -- > 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] Code Examples for Job Interview
Hey Everyone. This isn't a request for code or help, just thoughts and ideas. I've recently been asked to bring along some code examples for a job interview I will be heading to this week. This was the exact request "The sample does not have to be within any particular language, but something that is a substantive representation of your style and logic. " I'm not sure what to take. Most of my PHP and other projects are lengthy and involved. I'm not sure if it would be better to print out functions I've created that perform tasks, or just find something that did wonderfully challenging things and print that out. Anyone have thoughts on this? =- Jonathan Campbell ( [EMAIL PROTECTED] ) Mid days haze and I'm still not awake I got everything going but my bills are still late Funnier than hell and I think it's a blast Life's like a laugh when you got no money Lyrics from "Average Day" by Aztek Trip ( http://www.aztektrip.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]
[PHP] TCP/IP Server Question
I was recently looking at the talker example at http://www.php.net/manual/en/ref.sockets.php Does anyone know an example of making this same code for multiple connections. I'd love to see any working examples www.PictureArena.com === The lack of humility before nature thats being displayed here staggers me. === www.PictureArena.com