Changing page content with Php $vars

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
darkangel2001lv
Forum Newbie
Posts: 5
Joined: Sun Jul 30, 2006 3:21 pm

Changing page content with Php $vars

Post by darkangel2001lv »

I new to php, and have been all over web looking for codes that will switch body content of page without reloading page.
Below is php script that i am using index page load great however any link clicked get 404 error. i have check and all files are where they need to be. Please can someone help.



This is script in index.php (which i want to serve as the site template and only the content to change when a link is clicked)

Code: Select all

 
<?php
if ($_GET['ddl'])
if  (file_exists['./'$_GET['ddl'].'.html'))
include (*$_GET['ddl'].'.html');
else
include ('./404error.html');
else 
include ("./main.html");
?> 
 

the problem i think is with the links, this is the way all links are setup... is there some thing wrong here?

http://sitename.com/index.php?ddl=pagename

have also tried leaving out the sitename with same results.
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: Changing page content with Php $vars

Post by Phoenixheart »

A dot is expected on line 4:

Code: Select all

if  (file_exists['./'$_GET['ddl'].'.html'))
should be

Code: Select all

if  (file_exists['./' . $_GET['ddl'] . '.html'))
also, what's with the asterisk on line 5 anyway?
Post Reply