Suddenly its not working anymore!

I’ve been using this one PHP script for years, never had a problem with it… and suddenly its not working. I did NOT do anything to my website because I hardly update it anyway.

My website: http://dorkette.net if you go on right side menu and click on content links that go like dorkette.net?x=some_page it wont work, the blog just shows up everytime

Also important to mention is that I think I changed servers?

The script I’ve been using:[code]// Sample script written by Daynah
// PHP-Princess.net

// Where all your text files are located at
$directory = ‘./’;

// If the variable exists
// Example: If the url is ?x=aboutme
if($x)
{
// Does the file $directory/$x.php exist?
if(is_file("$directory$x.php"))
include("$directory$x.php");
else
include(“http://dorkette.net/oops.txt”);
}

// If the page is just called as index.php
// Then just include the default main.txt page
else
{
$mypage = ‘blog.php’;
include("$directory$mypage");
}[/code]

Here’s your problem:

[php]
if($x)
[/php]

Why do you assume that a GET variable will automatically transfer into a PHP page-wide variable? This is true for servers running with register_globals enabled, but is discouraged. What if I enter something like:

?x=some_file_containing_passwords

Read up on register_globals, and global variables on the php.net manual website.

my friend got it to work by adding:

$x = $_GET["x"];

this script still being modified but works

Sponsor our Newsletter | Privacy Policy | Terms of Service