Jump to content

uhh....help please...with include and variables...


WarDeities

Recommended Posts

heres what I am trying to do:

 

if(isset($_GET['page']))

{

$page=$_GET['page'];

$page=strip_tags($page);

print"<div id='content'>";

print"$page.php<br>";

include '$page.php';

print"</p></td></tr>

</div>";

}

 

 

when I get page addnews from this code on same page:

 

<a href='index.php?page=addnews'>

 

I get this error:

 

Warning: main(/$page.php) [function.main]: failed to open stream: No such file or directory in /index.php on line 56

 

I see it is not taking the vaiable (in this case addnews)...can you use vaiables in include statments???

If so please tell me how!

 

 

Thanks :)

Link to comment
https://forums.phpfreaks.com/topic/94820-uhhhelp-pleasewith-include-and-variables/
Share on other sites

Archived

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

×
×
  • Create New...

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.