How to send or pass data through anchor tag in PHP
Demo.php
[dm_code_snippet background=”yes” background-mobile=”yes” bg-color=”#abb8c3″ theme=”dark” language=”php” wrapped=”no”]
<?php
echo “<h1>Send single data using anchor tag</h1><br>”;
$id = 5;
$student_data = “Demo_another.php?send_id=”.$id;
?>
[/dm_code_snippet]
Demo_another.php
[dm_code_snippet background=”yes” background-mobile=”yes” bg-color=”#abb8c3″ theme=”dark” language=”php” wrapped=”no”]
<?php
echo “<h1>Get single data using anchor tag</h1><br>”;
echo $_REQUEST[‘send_id’];
?>
<a href=”<?php echo $student_id; ?>” target=”_blank”>Send Data</a>
[/dm_code_snippet]
Send multipe data using anchor tag
Demo.php
[dm_code_snippet background=”yes” background-mobile=”yes” bg-color=”#abb8c3″ theme=”dark” language=”php” wrapped=”no”]
<?php
echo “<h1>Send multiple data using anchor tag</h1><br>”;
$id = 5;
$name = “codelizar”;
$student_data = “Demo_another.php?send_id=”.$id.”&name_val=”.$name;
?>
<a href=”<?php echo $student_data; ?>” target=”_blank”>Send Multiple Data</a>
[/dm_code_snippet]
Demo_another.php
[dm_code_snippet background=”yes” background-mobile=”yes” bg-color=”#abb8c3″ theme=”dark” language=”php” wrapped=”no”]
<?php
echo “<h1>Get multiple data using anchor tag</h1><br>”;
echo $_REQUEST[‘send_id’].”<br>”;
echo $_REQUEST[‘name_val’].”<br>”;
?>
[/dm_code_snippet]