How to send data with anchor tag in php from one page to another page

How to send or pass data through anchor tag in PHP

Demo.php 
                    
<?php

echo “<h1>Send single data using anchor tag</h1><br>”;

$id = 5;

$student_data = “Demo_another.php?send_id=”.$id;

?>

Demo_another.php
                    

<?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>

Send multipe data using anchor tag

Demo.php 
                    

<?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>

Demo_another.php
                    

<?php

echo “<h1>Get multiple data using anchor tag</h1><br>”;

echo $_REQUEST[‘send_id’].”<br>”;

echo $_REQUEST[‘name_val’].”<br>”;

?>

Leave a Reply

Your email address will not be published. Required fields are marked *