db530 Posted May 21, 2008 Share Posted May 21, 2008 Alright, I have no idea why this won't work. I'm using PHP5, it worked fine on PHP4. I get this error when I'm trying to include another php script: Warning: include(product_other_details.php?pid=774&d_type=details) [function.include]: failed to open stream: No such file or directory in /data/16/1/57/83/1546246/user/1664829/htdocs/product_info.php on line 296 Warning: include() [function.include]: Failed opening 'product_other_details.php?pid=774&d_type=details' for inclusion (include_path='.:/usr/services/vux/php5/lib/php') in /data/16/1/57/83/1546246/user/1664829/htdocs/product_info.php on line 296 You can see for yourself at: http://www.industrialpc.com/product_info.php?pid=774 Here is the line (296) in the code: include "product_other_details.php?pid=$_GET[pid]&d_type=$dtype" ?>... that seems to be working because in the error it gives 'product_other_details.php?pid=774&d_type=details' whick works. Anyway, I've changed the .ini file so include is on, checked to make sure the page thats being included is there. Any other ideas? I'm totally lost, thanks for any help. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 21, 2008 Share Posted May 21, 2008 Are you trying to include the GENERATED version? As in the copy you would see in a browser? You need to use a URL for the include Quote Link to comment Share on other sites More sharing options...
db530 Posted May 21, 2008 Author Share Posted May 21, 2008 Are you trying to include the GENERATED version? As in the copy you would see in a browser? You need to use a URL for the include What do you mean use a URL for the include? Yes I want to include the generated version if this is what you mean: http://www.industrialpc.com/product_other_details.php?pid=774&d_type=details that should be in the box where the errors are coming up on http://www.industrialpc.com/product_info.php?pid=774 thanks for the response Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 21, 2008 Share Posted May 21, 2008 The include you are using: include("product_other_details.php?pid=774&d_type=details"); will try to include the local file with the PHP code in it, not what you see in your browser Quote Link to comment Share on other sites More sharing options...
db530 Posted May 21, 2008 Author Share Posted May 21, 2008 The include you are using: include("product_other_details.php?pid=774&d_type=details"); will try to include the local file with the PHP code in it, not what you see in your browser I'm lost. Do you know how I can fix this? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 21, 2008 Share Posted May 21, 2008 Use the full URL: include("http://servername.com/product_other_details.php?pid=774&d_type=details"); Quote Link to comment Share on other sites More sharing options...
db530 Posted May 21, 2008 Author Share Posted May 21, 2008 Use the full URL: include("http://servername.com/product_other_details.php?pid=774&d_type=details"); hmm, well that got rid of the error messages but now it is just blank. Should I have some type of statement like echo for it to actually show up on there? this is just driving me nuts because it worked before. I appreciate the help Quote Link to comment Share on other sites More sharing options...
db530 Posted May 21, 2008 Author Share Posted May 21, 2008 Anyone have any ideas why the data isn't showing up? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 22, 2008 Share Posted May 22, 2008 Really, you shouldn't be doing an include like that...You should wrap everything up into a function that returns the HTML, then use the function on both pages. Then, you can pass the data (pid, d_type) as arguments. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.