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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.