Hello everybdoy!
I'm new in php and I need urgently help.
I am doing online shopping for my website.
The user can enter the shopping basket (cart.php) from different pages.
In cart.php I put three html buttons of which one is to continue the purchases.
So, is necesary to return to the page from which the user came to cart.php, I mean from different product type php pages
I tried this:
product1.php
============
<?php
...
$SESSION['frompage']=$SERVER['REQUEST_URI'];
...
?>
cart.php
========
<?php
...
$frompagecome = $_SESSION['frompage'];
...
?>
<script type="text/javascript">
function returnPrev(){
alert(' de donde viene ... : ' + <?php echo $frompagecome; ?>);
}
</script>
...
<button type="button" onClick="<?php echo returnPrev(); ?>">Continue purchase</td>
...
But, don't work when I click button to Continue purchase, in function returnPrev() don't work alert().
Where I'm wrong??? Can somebody help me, please?
Thank you!!
DungaDunga