Jump to content

custom include string


herghost

Recommended Posts

Hi all,

 

I am trying to include using a line like this:

<?php
		include('menus/customerdetails.php?id=' . $id . '');
	?>

 

Which does not work!

 

Basically this should be a custom menu for the user with the id of $id. It works if I remove everything from ? onwards, otherwise get this error:

Warning: include(menus/customerdetails.php?id=136) [function.include]: failed to open stream: 

 

Is there a way to do this so i can use $_get['id']? Or will I have to store it in a session?

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/196337-custom-include-string/
Share on other sites

From the manual on include:

 

When a file is included' date=' the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward.[/quote']

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.