icon Learn how to get the most out of Surmunity - read our forum tips here! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » PHP, MySQL » PHPsuexec » Site Navigation broken

PHPsuexec Information and tips

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread
Old September 11th, 2007, 12:56 PM   #1 (permalink)
Registered User
Fresh Surpasser
 
Joined in Jun 2006
10 posts
Gave thanks: 2
Thanked 0 times
Site Navigation broken

My site will no longer work properly. I am a php noob. I use this really simply PHP code to display content on my site. <?php
if ($PG="/0") { $PG = "home"; }
$PAGE = $PG . ".php";
include($PAGE)?> I use links such as index.php?PG=email to change the value of PG to display the next item. all of a sudden my site stopped working and I don't know why. Please help a noob out
Smo_Bob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old September 11th, 2007, 2:34 PM   #2 (permalink)
Race Surpass
Super #1
 
MarkRH's Avatar
 
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,103 posts
Gave thanks: 17
Thanked 79 times
Sounds like register_globals has been disabled on the server, which is a good thing for security reasons.

Change:

PHP Code:
<?php 
if ($PG="/0") { $PG "home"; } 
$PAGE $PG ".php";
include(
$PAGE)?>
to:
PHP Code:
<?php 
if (empty($_GET['PG'])) { $PG "home"; } else { $PG $_GET['PG']; } 
$PAGE $PG ".php";
include(
$PAGE)?>
or more stream lined:
PHP Code:
<?php 
if (empty($_GET['PG'])) { $PG "home"; } else { $PG $_GET['PG']; } 
include(
$PG ".php")?>
That should do it. The $_GET array includes the variable/value pairs sent via the URL after the "?". The empty funtion comes back true if PG does not exist or has no value.
MarkRH is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks MarkRH for this great post!
Smo_Bob (September 11th, 2007)
Old September 11th, 2007, 3:15 PM   #3 (permalink)
Registered User
Fresh Surpasser
 
Joined in Jun 2006
10 posts
Gave thanks: 2
Thanked 0 times
Awsome Thanks
Smo_Bob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 edit your posts

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