What do you want to have happen.
I'm having a heck of a time with redirecting to another page. Using DataAssist, making all the pages allowed in the dialog box, the redirects work fine between those pages.
Adding an Add To Cart button to the detail page will not redirect the page to bring up the cart. I open the server behaviors to look at the redirect text box and it contains "/cart.php". Seems like it should work. Trying "../cart.php" and "cart.php" doesn't work either. I can add a View Cart button to the Detail page and it works fine. The item went to the cart when Add To Cart was clicked, but the redirect is broken.
When I get to the cart and click Continue Shopping, the redirect back to the sending page won't work. When I click Clear Contents. It works, but then I'm stuck in the cart with no way to get back instead of being redirected to another page (such as the sending page).
On the cart page: Update works fine. Clear clears, but does not redirect, Checkout does nothing (I've run the checkout wizard), Continue Shopping does nothing.
Can someone please give me some ideas so I can break out of this loop?
God Bless you.
If you miss BASIC wait until you wander into the OOP swamp. PHP can flow like basic, so it's not that far removed. Pay attention to WHERE your code gets inserted because it can impact the success you might have. Dreamweaver is bad about putting stuff in places that get the logic out of sequence.
In the case that you mentioned of the Add to Cart button, my question was "what does he want to have happen?" Normally, add to cart would serve as a trigger to post the form to the cart. Are you saying you want that button to send the user some place else first?
If you really wanted to have an item posted to the cart, look at the code to see if the add to cart button is correctly referenced.
For example, the code for the add to cart button on a form of mine reads
<input type="image" src="WA_eCart/Images/Deep Jungle/Btn1_EN_addtocart.gif" border="0" value="Add to Cart" name="eCart1_1_ATC">
It is in a form in the body of the page.
The code that executes when the button gets clicked resides at the top of the page and reads:
<?php
// WA eCart AddToCart
if (isset($_POST["eCart1_1_ATC"]) || isset($_POST["eCart1_1_ATC_x"])) {
$ATC_itemID = $_POST["eCart1_1_ID_Add"];
$ATC_AddIfIn = 0;
$ATC_RedirectAfter = "https://www.THECLIENTswebsite/public_shoppingcart.php";
..omitted for brevity
if ($ATC_RedirectAfter != "" && $eCart1->redirStr == "") {
$eCart1->redirStr = $ATC_RedirectAfter;
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
}
else {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
}
}
}
?>
Basically, the way the logic flows is that the whole page loads and does nothing.
Then when the user clicks the add to cart button, the page gets submitted to the server again and begins processing from the top down.
At that point, your button should test true and the subsequent steps would be executed.
You can insert die(mysql_error()); statements in the code to force the page to stop at any point.
You could echo backs vars that you have a question about or user var_dump or print_r prior to the die() command.
WebAssist also has some handy debug routines in some of their stuff.
Ask about them when you submit a ticket.