0

hey i need some helpn with some conversion

the link currently links the item id to the shopping basket

i currently have a submit button on my site which looks like this

<!--<input type="button" value="Add to Cart" onclick="addtocart(<?=$row['itemid']?>)" />-->

and is linked to this script

<!--<script language="javascript">
    function addtocart(pid){
        document.form1.productid.value=pid;
        document.form1.command.value='add';
        document.form1.submit();
    }
</script>-->

but i would preferably use html/php (see below) and use this instead but i do not know how to properly implement it:

<!--<a href="basket.php?action=add&id=<?php echo $row["itemid"];?>">Add Item</a>-->

any help towards the right direction will be greaty appreciated

Regards

Foad Izagaren

Edited by Reverend Jim: Fixed formatting

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by pclfw
0

How do I put this.

When your user clicks on the SUBMIT button, well, PHP has bin and gone and has nothing to do with the page any more.

PHP runs on the SERVER.

Javascript runs on the CLIENT in the clients BROWSER.

Now that should be hint enough for you to workout how to complete your submit function.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.