Jump to content

include() issue


Plug-in

Recommended Posts

Hey if you could help me I would really appreciate it, I haven't been coding for a while and I'm getting stuck on quite a basic part of my script, in fact it was the first part.

 

I'm using the include(); function to include a file which will be used to show multiple pages through the $_GET variable, for example if you don't understand what I'm talking about if I was making an "about" page I might do index.php?page=about and it would retrieve the "about" page. Unfortunately I keep getting this error:

 

Warning: include(back_func.php?id=new) [function.include]: failed to open stream: No error in C:\Program Files\EasyPHP-5.3.9\www\link_extension\index.php on line 25

 

Warning: include() [function.include]: Failed opening 'back_func.php?id=new' for inclusion (include_path='.;C:\php\pear') in C:\Program Files\EasyPHP-5.3.9\www\link_extension\index.php on line 25

 

Notice: Undefined variable: var in C:\Program Files\EasyPHP-5.3.9\www\link_extension\index.php on line 26

 

This is the PHP in my index page, notice it consists of one line because I removed the rest for testing:

include('back_func.php?id=new');
      echo $var;

This is my back_func.php page, also simplified for testing:

<?php
if (isset($_GET['id']))
$var = 'worked';
else
$var = 'not';
?>

 

If you don't understand what I'm asking but feel you could help I'm happy to further explain, I'm expecting it's something basic I've forgotten.

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/259565-include-issue/
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.