nutt318 Posted January 31, 2008 Share Posted January 31, 2008 I am not sure how to do this and would like some help on what would be the best way to accomplish this. Anyways my problem is that I have my site that works great and what not that runs off of a .css. I also have a shopping cart system that pretty much has its own interface. My questions is how would I include the shopping cart page/site within my current site. I just want my users to have the same look and feel with the shopping cart layed out the same way. I have tried messing with the shopping carts .css and its starting to look funny. BTW i am using a ZEN cart. Can I use something like: index.php is the shopping carts <?php include "/cart/index.php"; ?> any help would be awesome. Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/ Share on other sites More sharing options...
uwannadonkey Posted January 31, 2008 Share Posted January 31, 2008 yup, this works: <?php include('inc/index.php or w/e link is"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-454740 Share on other sites More sharing options...
nutt318 Posted January 31, 2008 Author Share Posted January 31, 2008 I tried what you said and i get a bunch of the following Warning: main() [function.main]: URL file-access is disabled in the server configuration in /home/.heavengaze/contentlit/new.mydomain.org/newsite/cart.php on line 34 line 34 is the include line. Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-454760 Share on other sites More sharing options...
uwannadonkey Posted February 2, 2008 Share Posted February 2, 2008 whoopsies! i made an error! its not: <?php include('inc/index.php or w/e link is"); ?> its <?php include('inc/index.php or w/e link is'); ?> if that doesnt work, i ono what problem is, lol Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-455734 Share on other sites More sharing options...
revraz Posted February 2, 2008 Share Posted February 2, 2008 Post the actual include line you are using. Sounds like you are going to a outside link? I tried what you said and i get a bunch of the following Warning: main() [function.main]: URL file-access is disabled in the server configuration in /home/.heavengaze/contentlit/new.mydomain.org/newsite/cart.php on line 34 line 34 is the include line. Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-455759 Share on other sites More sharing options...
nutt318 Posted February 4, 2008 Author Share Posted February 4, 2008 I guess it would be an outside link, because it is another system. I have my header and sidebar that is on my other pages, I just want shopping cart system to have the sidebar and header just like all of the other pages. I thought there was a way to do this but I cant seem to figure it out. The only other was I was trying to do it was to edit the css on the shopping cart site but it is a huge pain. Thanks. <h1 class="title">Welcome to the Online Store </h1> <div class="entry"> <p> <?php include "http://www.mydomain.org/cart/index.php"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457605 Share on other sites More sharing options...
Aureole Posted February 4, 2008 Share Posted February 4, 2008 Is the shopping cart on a different domain? If so then, you're screwed... to be crude. Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457607 Share on other sites More sharing options...
Guardian-Mage Posted February 4, 2008 Share Posted February 4, 2008 No modern servers would allow you to include a file from another domain. That is a major security risk. You need all the files stored on your own server if you want to use PHP include. However, you could look at iFrames, a very messy solution. Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457608 Share on other sites More sharing options...
psychowolvesbane Posted February 4, 2008 Share Posted February 4, 2008 Try: <?php include "cart/index.php"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457609 Share on other sites More sharing options...
nutt318 Posted February 4, 2008 Author Share Posted February 4, 2008 Nope, its on my domain just a different folder than the main site. Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457611 Share on other sites More sharing options...
nutt318 Posted February 4, 2008 Author Share Posted February 4, 2008 I have tried this and it doesnt load anything <?php include "../cart/index.php"; ?> When doing this I get a bunch of errors that show up on my page that, they are. <?php include "http://www.mydomain.org/cart/index.php"; ?> Warning: main() [function.main]: URL file-access is disabled in the server configuration in /home/.heavengaze/admin/new.mydomain.org/newsite/cart.php on line 34 Warning: main(http://www.mydomain.org/cart/index.php) [function.main]: failed to open stream: no suitable wrapper could be found in /home/.heavengaze/admin/new.mydomain.org/newsite/cart.php on line 34 Warning: main() [function.main]: URL file-access is disabled in the server configuration in /home/.heavengaze/admin/new.mydomain.org/newsite/cart.php on line 34 Warning: main(http://www.mydomain.org/cart/index.php) [function.main]: failed to open stream: no suitable wrapper could be found in /home/.heavengaze/admin/new.mydomain.org/newsite/cart.php on line 34 Warning: main() [function.include]: Failed opening 'http://www.mydomain.org/cart/index.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/.heavengaze/admin/new.mydomain.org/newsite/cart.php on line 34 Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457622 Share on other sites More sharing options...
Guardian-Mage Posted February 4, 2008 Share Posted February 4, 2008 Could you give us a brief diagram of your server tree layout? Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457634 Share on other sites More sharing options...
nutt318 Posted February 4, 2008 Author Share Posted February 4, 2008 Mydomain.org -Cart (folder)along with other folders and files for the shopping cart -index.php -Site (folder)this is where all of my current pages are -index.php, -aboutus.php -contactus.php and so on. Is this what you need? Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457636 Share on other sites More sharing options...
revraz Posted February 4, 2008 Share Posted February 4, 2008 If you are doing the include from site/index.php then try include "../../cart/index.php"; Is that a Cart or cart (if linux, case matters)? Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457638 Share on other sites More sharing options...
nutt318 Posted February 4, 2008 Author Share Posted February 4, 2008 I made sure that everything is case sensitive so that i know is fine but I tried what you said and now im getting the page not to load properly. It seems to only load a portion of the page because an image that is set in the css is not loading now. I can see my background and some text above where the include code is but nothing to do with the shopping cart. Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-457653 Share on other sites More sharing options...
nutt318 Posted February 6, 2008 Author Share Posted February 6, 2008 Any other ideas? Basically I have a Zen-Cart system installed in a folder called cart. I have my website in a folder called site. I want to be able to have the sidebar, header and footer around the shopping cart system on my site. Would I need to do an include function on the index.php of the shopping cart site? I have tried doing an include on the index.php on the cart system but i just get errors. Any ideas on how I can accomplish getting the shopping cart system within my normal site so users have the look and feel of the normal site but the shopping cart within it? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/88780-including-another-page/#findComment-459813 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.