Jump to content


Photo

cool thingy


  • Please log in to reply
5 replies to this topic

#1 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 14 June 2006 - 05:15 AM

Hi, Like always i was fiddling around with code(this time arrays) and i stumbled apon something cool! put this in a php pahe and upload it to your webserver! its kinda handy

foreach($_SERVER as $id => $value){
echo "$id: $value<br>";
}

"Syntax error" .. WHERE THE **** IS IT?!

#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 14 June 2006 - 05:18 AM

lol you have found the $_SERVER array. yes, lots of useful stuff in there.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 legohead6

legohead6
  • Members
  • PipPipPip
  • Advanced Member
  • 434 posts

Posted 14 June 2006 - 05:23 AM

[!--quoteo(post=383636:date=Jun 14 2006, 12:18 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 14 2006, 12:18 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
lol you have found the $_SERVER array. yes, lots of useful stuff in there.
[/quote]

ya, i also found $_POST $_GET $_SESSION lol...they all come in handy!
"Syntax error" .. WHERE THE **** IS IT?!

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 14 June 2006 - 08:50 AM

Everyone uses those all the time in their scripts! These variables are called [a href=\"http://uk2.php.net/variables.predefined\" target=\"_blank\"]Super Globals[/a]. There are also other prefined variables too in PHP.

#5 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 14 June 2006 - 02:08 PM

... Which are documented here:

[a href=\"http://www.php.net/variables.predefined\" target=\"_blank\"]http://www.php.net/variables.predefined[/a]
~ D Kuang

#6 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 14 June 2006 - 02:57 PM

And a much easier way of dumping any of them or any array (or variable) is
<?php echo '<pre>' . print_r($thearray,true) . '</pre>'; ?>

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users