Jump to content

coping php code


dark_stranger

Recommended Posts

Hi, hope someone can help.  I have been creating a site (for myself) using paypal shopping vart, but i have since discovered that its not fit for purpose & therefore after much searching i have decided to use "OpenCart", but instead of using the default OpenCart shop front I want to use my exisitng site desing and was hoping that I could intergrate certain php code from OpenCart into my site. I therefore installed opencart in the root of my site & then renamed the opencart index.php & copied my site across & started coping the contents of the opencart index.php into my website index.php and was able to copy everything across apart from...

 

// Session -

require(DIR_INCLUDE . 'session.php');

$session = new session;

 

as the session section produces the error...

 

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/zoapho90/public_html/index.php:9) in /home/zoapho90/public_html/include/session.php on line 22

 

 

and the below displays the default template that i dont want.

 

// Display Template

echo($template->fetch('layout.tpl'));

 

Therefore why am i getting the above error & would my theory work by coping the opencart index.php php code into my php page & then enter php code to display products, etc?

 

I hope that makes sense.

Link to comment
https://forums.phpfreaks.com/topic/78837-coping-php-code/
Share on other sites

Hi and thanks for a speedy response,

I copied that code to the very top of the page & get...

Warning: main(DIR_INCLUDEsession.php): failed to open stream: No such file or directory in /home/zoapho90/public_html/index.php on line 2

Warning: main(DIR_INCLUDEsession.php): failed to open stream: No such file or directory in /home/zoapho90/public_html/index.php on line 2

Fatal error: main(): Failed opening required 'DIR_INCLUDEsession.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/zoapho90/public_html/index.php on line 2

 

saying that, its strange that if the code is in the index.php for opencart is works fine, but if its in my index.php it doesnt, and the only thing diffent is that the template code isnt used.

Link to comment
https://forums.phpfreaks.com/topic/78837-coping-php-code/#findComment-399010
Share on other sites

Hi, that worked. Thanks,

 

Next quick question, to continue on with my original quesiton.  Now i have the original php code from the opencart index.php embeded in my ondex.php, is it possible to call php commands from the application/database such a product details, catogory names, etc

Link to comment
https://forums.phpfreaks.com/topic/78837-coping-php-code/#findComment-399040
Share on other sites

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.