Hey guys,
I have a php question. I have a php eccommerce site I am working on and have a particular problem.
Currently when a user presses one of my "Add To Kart" buttons it will add a product to the users cart without changing the current URL, which at that point would be something like "http:www.mydomain.com/index.php?mod=product&id_prd=5"
I have a shared SSL certificate on my server and want to redirect the user to a secure URL after they press the "Add To Kart" button, but before the product is submitted to the shopping cart; and in that order (but both after the same "Add To Kart" button is pushed). The secure redirect form displays the same unsecure URL: "http:www.mydomain.com/index.php?mod=product&id_prd=5" in the following secure manner: "https://servername.host.com/~username/mydomain/html/index.php?mod=product&id_prd=5"
The product is added to the cart by the following "Add To Cart" form:
<form name="chooseProperties" method="post" action="<?php
$KT_Temp = new AddToKartRegister();
$KT_Temp->registerField('id', $row_rsPrd['id_prd']);
$KT_Temp->registerField('name', $row_rsPrd['name_prd']);
$KT_Temp->registerField('price', $row_rsPrd['price_prd']);
$KT_Temp->registerField('quantity', 1);
$KT_Temp->registerField('weight', $row_rsPrd['weight_prd']);
echo $KT_Temp->getAddToKartLink('MXKart/addToKart.php') ?>">
<input name="AddToCart" type="submit" class="orangeButton" id="AddToCart" value="Add To Cart">
My "redirect" form has the following code:
<form name="redirect" method="post" action="<?php echo 'https://servername.host.com/~username/mydomain/html/index.php?'.$_SERVER['QUERY_STRING']; ?>">
<label>
<input type="submit" name="Submit" value="Submit">
What I would like to know is if there is some way to submit the "redirect" FIRST and then submit the "Add To Kart" form second, after the user hits the "Add To Kart" button?
Specifically is there any way to do this by calling functions and different pages in PHP without the use of Javascript? If not, what is the most efficient way to do this with the least amount of client side scripting as possible?
Any and all suggestions or help will be greatly appreciated.
Thanks