close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Add to Cart Button...

Thread began 1/22/2013 6:03 pm by daniel279790 | Last modified 1/24/2013 4:20 am by daniel279790 | 561 views | 4 replies |

daniel279790

Add to Cart Button...

Hi There

I'm having trouble with my Add to Cart Button. I want it to redirect to my Cart when clicked. But instead it just reloads the same page.

Looking on these forums it looks like a common problem, but I've tried all the potential solutions - removing spaces, adding @session_commit(); to the redirect bit etc etc. But nothing seems to be working.

Any solutions would be great.

I'm using PHP Ecart 4.5.2.

The dynamanic page is...
choose.php

And I want it to redirect to...
fixmy_cart.php

Many Thanks in advanced.

Sign in to reply to this post

Jason ByrnesWebAssist

i'll need a copy of your pages so i can examine the code.

Sign in to reply to this post

daniel279790

Hi Jason

I've attached them. The page with the Add to Cart Button is customise/choose/choose.php

Many Thanks

Attached Files
pages.zip
Sign in to reply to this post

Jason ByrnesWebAssist

add the following code at line 1 to turn on error reporting:

php:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>




i bet you get the headers already sent error.

at line 89, you include the init.php file:
include($_SERVER['DOCUMENT_ROOT'].'/init.php');


in the init.php file, you have some HTML that is being generated.

this HTML is being output to the page before the doctype tag (it also includes it's own doctype tag, causing 2 doctypes, and head sections which is bad HTML format) , and also before the header function to redirect the page.

the header function will fail if there is any output on the page before it.

Sign in to reply to this post

daniel279790

Thanks for the help Jason

I think I was being too clever for my own good with the creation of the init.php file, I'm going to go back to basics and try again, hopefully the re-diredct will work then. :)

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...