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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.