Jump to content

Archived

This topic is now archived and is closed to further replies.

flashback

BIGGEST PHP COMPLICATION OF THE DECADE

Recommended Posts

my site's coded into php / anyway, whenever I click a link, nothing happens, except the index.php refreshes with the news.html..

http://www.foxyones.net/

Click a link and you'll see..

does anyone know the problem / know how I can fix it / or anything valuable to the prob?

it'll be greatly appreciated!

Share this post


Link to post
Share on other sites
Maybe you are not coding the URL right. It looks as if you have had it working before..? If not, maybe you should just link directly to the pages instead of putting "php?id=simpson" in the link.

Share this post


Link to post
Share on other sites
it worked well like two days ago

i rather have those pages inside the content area, though

x()

Share this post


Link to post
Share on other sites
here's the index.php code in the desired content area:


<?php
if ($id == "") {
  include "news.html";
}
else {
  include "$id.html";
}
?>


anything wrong in that?

Share this post


Link to post
Share on other sites
my host's IonCube went down a day ago...

i have no idea what it is, but i think it has something to do with php protection

could that in any way effect my pages?

Share this post


Link to post
Share on other sites
Don't know, but if they have switched off register_globals in the configuration then it might make a difference.
Try replacing $id with $_GET['id'] in your if statements and see if that makes a difference.

Share this post


Link to post
Share on other sites
it made a difference

now when i click a link, it actually takes me to a different page

but its an error page

still, we're making progress

Share this post


Link to post
Share on other sites
with adding the code you said

it says;

Warning: main(.html): failed to open stream: No such file or directory in /home/foxyones/public_html/index.php on line 187

Warning: main(): Failed opening '.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/foxyones/public_html/index.php on line 187

Share this post


Link to post
Share on other sites
Hmm, seems that's returning an empty string, so empty string plus .html = ".html", which doesn't exist.
You could try [b]print_r($_REQUEST);[/b] to see what the page is taking in and it will give a better idea of what's going on.
Also, you could make a page with [b]<?php phpinfo(); ?>[/b] on it and this will display alot of configurations that could point to the problem.

Share this post


Link to post
Share on other sites
According to the output I think this should work:
<?php
if ($_REQUEST['id'] == "") {
  include "news.html";
}
else {
  include $_REQUEST['id'].".html";
}
?>

Share this post


Link to post
Share on other sites
jesus you're a freaking genius

thanks for the help, everyone

i would send you all cookies, but i have a meeting to go to

what was the problem, btw? (ill read your response when i return)

Share this post


Link to post
Share on other sites
Well you were checking $id but because the server has upped it's security, if you want to refer to a variable in the address then you must use $_GET or $_REQUEST, with the variable name in square brackets; $_GET['VARNAME'].

Share this post


Link to post
Share on other sites
You may want to read the following thread
http://www.phpfreaks.com/forums/index.php/topic,95407.msg382014.html#msg382014

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.