Current location: Hot Scripts Forums » Programming Languages » PHP » recording variables


recording variables

Reply
  #1 (permalink)  
Old 03-09-05, 10:28 PM
wings wings is offline
Newbie Coder
 
Join Date: Jan 2005
Location: my computer
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
recording variables

is there a way to record variables sent through a HTTP connection? because I want to be able to log installations of my scripts, and I have seen this exact thing been done before, I just couldn't get the source code

like for example if I had a person go to http://example-site.com/record.php?hhost=$httphost&sname=$scriptname

and has predeffined variables for both $httphost and $scriptname of:
PHP Code:

$httphost getenv("HTTP_HOST"); $scriptname getenv("SCRIPT_NAME"); 

how would I be able to log those variables, either in a mysql database for flat file
Reply With Quote
  #2 (permalink)  
Old 03-17-05, 09:23 PM
wings wings is offline
Newbie Coder
 
Join Date: Jan 2005
Location: my computer
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
anyone got any ideas?
Reply With Quote
  #3 (permalink)  
Old 03-18-05, 04:55 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
enviroment and http variables are stored in $_ENV, $_SERVER, $_POST and $_GET
http://www.php.net/variables.predefined

logging them is similar to any other insertion process you make ..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #4 (permalink)  
Old 03-18-05, 06:56 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
use a session or cookie to store long term variables...
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #5 (permalink)  
Old 03-18-05, 05:12 PM
wings wings is offline
Newbie Coder
 
Join Date: Jan 2005
Location: my computer
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the link, I'll read through it when I get the chance, and if I have any more questions, I'll ask
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Server side variables Puno PHP 13 08-13-05 10:22 PM
PHP global variables don't work inside a class wizkid PHP 4 12-20-04 03:31 PM
Can anyone help me ? (problem using php variables in html db insert code) chronic_ PHP 2 06-13-04 11:19 AM
help with displaying variables tisza PHP 9 12-22-03 05:08 PM
adding more variables to the mail() result spinicrus PHP 6 08-28-03 04:55 PM


All times are GMT -5. The time now is 05:35 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.