PC Playground  

Go Back   PC Playground > The Core > Scripting/Programming
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2003, 10:53 PM
Senior Member
 
Join Date: Jan 2003
Location: I Wish I knew
Posts: 312
Send a message via AIM to shiznackonline
Default Help with PHP counter

Let me explain what it is doing first.. I have this script on main.php.... It works just fine on that document. When I click on a link to get on another page (which has the include) such as uhh main.php?other, the counter goes haywire. The total number of visitors goes off and is replaced with the [invalid parameters] tag. Here is my code. Please examine. Please help!!

# run script
if (getenv('QUERY_STRING') == '') {
takeLog(); # take log
} elseif (strtolower(getenv('QUERY_STRING')) == 'stat') {
viewStat(); # view statistics
} else {
# exit when script is called with invalid parameter
print '[This is that invalid SHIT]';

}
Reply With Quote
  #2 (permalink)  
Old 05-09-2003, 12:36 AM
Senior Member
 
Join Date: Jan 2003
Location: I Wish I knew
Posts: 312
Send a message via AIM to shiznackonline
Default

HELP!!!
Reply With Quote
  #3 (permalink)  
Old 05-09-2003, 08:12 PM
Member
 
Join Date: Jan 2003
Location: Netherlands
Posts: 75
Send a message via MSN to utimer
Default Re: Help with PHP counter

Quote:
Originally Posted by shiznackonline
Let me explain what it is doing first.. I have this script on main.php.... It works just fine on that document. When I click on a link to get on another page (which has the include) such as uhh main.php?other, the counter goes haywire. The total number of visitors goes off and is replaced with the [invalid parameters] tag. Here is my code. Please examine. Please help!!

# run script
if (getenv('QUERY_STRING') == '') {
takeLog(); # take log
} elseif (strtolower(getenv('QUERY_STRING')) == 'stat') {
viewStat(); # view statistics
} else {
# exit when script is called with invalid parameter
print '[This is that invalid s***]';

}
ehh why are you usings getenv('QUERY_STRING')? Why not just $HTTP_GET_VARS["action_or_whatever_u_like"];

example:
Code:
# run script if ($HTTP_GET_VARS["action"] == '') { takeLog(); # take log } elseif (strtolower($HTTP_GET_VARS["action"]) == 'stat') { viewStat(); # view statistics } else { # exit when script is called with invalid parameter print '[This is that invalid s***]'; }
you can now include it with
include("http://full_url(!)/counter.php?action=stat);
include("http://full_url(!)/counter.php);

If I misunderstood you, srry
Reply With Quote
Reply


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

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



All times are GMT. The time now is 12:43 AM.