Can someone help me is there any way to used PHP Include () that would work on my php script with an id I'm trying to make like this <?php include("myspace.php?id=108001502"); ?> but it giving me error can't open stream is there possible to make it work
not possible... one easy thing u can do is..... convert your 'myspace.php' page into a function which is accessible from the page u r calling it.... and then pass the 'id' value to the function
in addition to what rising_star said, you can also modify the myspace.php to take the parameter id not from get (like $id = $_GET['id']; ) but from the current namespace of your variables (simply do NOT define the parameter $id in your myspace.php) and then define that parameter before your include $id = 100000; include('myspace.php');
u can do what stats side you just add <?php $id=1000; include('myspace.php'); ?> and in add $_GET['id'].
sharadcool : $_GET is for HTTP GET requests, you can't use it to retrieve a variable from your current namespace ..
If all the myspace.php page is doing is displaying HTML, you can use file_get_contents()... But I doubt it. What you'd need to do is make whatever myspace.php does a function. Then, all you'd need to do is include('myspace.php');echo myfunction(108001502); PHP: .