hello
How to pass value from Javascript to php variable on the second page?
I am giving example of how pass value using javascript.
<html >
<head >
<script type="text/javascript">
}
}
}
</script >
</head >
<body >
<h2>MY Vegetables </h2>
<ul >
<li ><script type="text/javascript">var price1=12, itm1="Amaranth";</script><a href="#" onclick="vegetable( price1, itm1);"><strong>Amaranth</strong> $10</a></li >
<li ><script type="text/javascript">var price2=1, itm2="Bitter Gourd";</script><a href="#" onclick="vegetable( price2, itm2);"><strong>Bitter Gourd</strong> $15</a></li >
<li ><script type="text/javascript">var price3=5, itm3="Broad beans";</script><a href="#" onclick="vegetable( price3, itm3);"><strong>Broad beans</strong> $16</a></li >
<li ><a href="#" onclick="getPrice ( );">click Get Vegetables </a></li >
<li ><script type="text/javascript">var quantity=10;</script><a href="#" onclick="send( quantity);">Submit</a></li >
</ul >
</body >
</html >
<html >
<head >
<? php
$price = $_GET[ 'price'];
$qunatity = $_GET[ 'qunatity '];
?>
</head >
<body >
<? php
echo "<h1>Quanity </h1>";
echo $qunatity;
?>
</body >
</html >
No comments:
Post a Comment
Thank You For Comment