Jump to content


Photo

BIGGEST PHP COMPLICATION OF THE DECADE


  • Please log in to reply
13 replies to this topic

#1 flashback

flashback
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 09:34 PM

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!

#2 pocobueno1388

pocobueno1388
  • Members
  • PipPipPip
  • Advanced Member
  • 3,369 posts
  • LocationPalm Beach, Florida

Posted 08 July 2006 - 09:42 PM

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.

#3 flashback

flashback
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 09:43 PM

it worked well like two days ago

i rather have those pages inside the content area, though

x()

#4 flashback

flashback
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 09:44 PM

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?



#5 flashback

flashback
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 09:55 PM

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?

#6 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 08 July 2006 - 10:16 PM

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.

<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#7 flashback

flashback
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 10:29 PM

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

#8 flashback

flashback
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 10:32 PM

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

#9 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 08 July 2006 - 10:38 PM

Hmm, seems that's returning an empty string, so empty string plus .html = ".html", which doesn't exist.
You could try print_r($_REQUEST); 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 <?php phpinfo(); ?> on it and this will display alot of configurations that could point to the problem.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#10 flashback

flashback
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 10:43 PM

http://www.foxyones.net/ad.php

i dont understand the configs

looking at it

#11 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 08 July 2006 - 10:44 PM

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

<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#12 flashback

flashback
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 10:47 PM

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)

#13 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 08 July 2006 - 10:52 PM

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'].
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#14 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 09 July 2006 - 01:36 AM

You may want to read the following thread
http://www.phpfreaks....html#msg382014




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users