Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old July 30th, 2004, 10:40 PM
soulcarvex soulcarvex is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 soulcarvex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Problem with PHP5 and Apache2 on WinXP

I wanted to set up and apache server with php5 and mysql on my WinXP Pro machine for testing of my php scripts as i write them.
I set up Apache2 and PHP5 according to very explicit instructions found on several websites offering tutorials on the subject. I have all of my .ini and .dll files and such in the right places and my server starts, displays files with .html and .php extensions. However, as soon as I want to execute a php script as simple as the following:

<?php
if ($id == '1') {

echo "You clicked the link!";

} else {

printf("<a href=\"%s?id=1\">Click Me</a><br>\n", $PHP_SELF);

}
?>

, things go wrong. Following the above code as an example of my problem, it is supposed to display a link with the text "Click Me," with the link pointing back at the script with "?id=1" attached to the end of it. When you click the link and the script sees the value for $id (as per the "if ($id == '1')" statement), it should then print "You clicked the link!" However, all it does it print "Click Me" again. This happens on any script that i send information back at, like forms and such...it just reprints what was originally there. I have tested these scripts on a friend's preconfigured server (IBServer), and they work PERFECTLY. I must be doing something wrong...
If anyone has any ideas as to what the problem might be, please help me! I'm desperate!
Thank you in advance.

Reply With Quote
  #2  
Old August 2nd, 2004, 07:26 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Change if "($id == '1')" to "if ($_GET['id'] == '1')". This is a register_globals problem. There's a very good sticky on this topic in the PHP forum that you should definitely check out.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old August 2nd, 2004, 10:14 PM
soulcarvex soulcarvex is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 2 soulcarvex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

Thank you very much, dhouston. This solved the problem right away. Thanks also for the tip about the register_globals thread; it does shed some light on things I was confused about. Thanks again.

Reply With Quote
  #4  
Old August 29th, 2004, 09:27 PM
oscarins oscarins is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 oscarins User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Finally the post works...

I have had the same problem and after many hours ... the problem is resolved changing one word in php.ini.

If you find php.ini (Windows directory or other) and change register_globals = Off to register_globals = On,
everything is ok. You can read more information in:

http://uk.builder.com/webdevelopment/scripting/0,39026636,39213078-2,00.htm

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > Problem with PHP5 and Apache2 on WinXP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway