Methode: 1
<a href="urlink.php?myvalueone=1&myvaluetwo=2">Pass Values</a>
In urlink.php
<?php
echo $_REQUEST["myvalueone"];
// OR
echo $_GET["myvalueone"];
//AND
echo $_REQUEST["myvaluetwo"];
//OR
echo $_GET["myvaluetwo"];
//Process your actions here
?>
In urlink.php
<?php
echo $_REQUEST["myvalueone"];
// OR
echo $_GET["myvalueone"];
//AND
echo $_REQUEST["myvaluetwo"];
//OR
echo $_GET["myvaluetwo"];
//Process your actions here
?>
Result: 1122
Methode: 2
<form action="urlink.php" method="POST">
<input type="hidden" name="myvalueone" value="1" />
<input type="hidden" name="myvaluetwo" value="2" />
<a href="#" onclick="this.parentNode.submit()">Pass Values</a>
</form>
In urlink.php
<?php
echo $_REQUEST["myvalueone"];
// OR
echo $_POST["myvalueone"];
//AND
echo $_REQUEST["myvaluetwo"];
//OR
echo $_POST["myvaluetwo"];
//Process your actions here
?>
<input type="hidden" name="myvalueone" value="1" />
<input type="hidden" name="myvaluetwo" value="2" />
<a href="#" onclick="this.parentNode.submit()">Pass Values</a>
</form>
In urlink.php
<?php
echo $_REQUEST["myvalueone"];
// OR
echo $_POST["myvalueone"];
//AND
echo $_REQUEST["myvaluetwo"];
//OR
echo $_POST["myvaluetwo"];
//Process your actions here
?>
Result: 1122
Methode: 3
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<a href="#NOD" rel="2" id="myvalues">Pass Value</a>
<script type="text/javascript">
$(document).ready(function() {
$('#myvalues').click(function() {
$.ajax({
type: "POST",
url: "urlink.php",
data: {'myvalue' : $(this).attr('rel')},
success: function(data) {
alert(data);
}
});
});
});
</script>
In urlink.php
<?php
//Process your actions here
echo $_POST['myvalue'];
?>
//Process your actions here
echo $_POST['myvalue'];
?>