You can use sessions to achieve this.
You have a syntax error here.
<td>".$row["name"]."</td> </tr>
It shall be fixed by
<td><?php echo $row['name'] ?></td> </tr>
[ Or the way Hanky 웃 Panky suggested ]
You can have it in your session by
<?php
session_start();
$_SESSION['name'] = $row['name']
?>
And retrieve it on another page by
<?php
session_start();
echo $_SESSION['name'];
?>
Update :
If you have this in your url and you want to have your tp_no
globally available then you should replace the $row['name']
by $_GET['tp_no']
http://localhost:88/web/SMSindex.php?tp_no={%27tel:94771122336%27}
You should get the tp_no by
$_GET['tp_no']
But I don't know the reason you wrap around {}
Update :
As you don't want to see the url in the page.
Here's a tiny workaround to overcome it.
<?php
session_start();
if (isset($_GET['tp_no']))
{
$_SESSION['tp_no'] = $_GET['tp_no'];
unset($_GET['tp_no']);
$url = $_SERVER['SCRIPT_NAME'].http_build_query($_GET);
header("Refresh:0; url=".$url);
}
elseif (isset($_SESSION['tp_no']))
{
echo $_SESSION['tp_no'];
session_unset();
session_destroy();
}
else
{
echo "Direct / Illegal Access not allowed";
}
?>
An Explained Version
<?php
session_start(); #Starting the Session
if (isset($_GET['tp_no'])) #Checking whether we have $_GET value from the url
{
$_SESSION['tp_no'] = $_GET['tp_no']; # We are assiging the tp_no to session
unset($_GET['tp_no']); #Here we are unsetting the value that we get from url
$url = $_SERVER['SCRIPT_NAME'].http_build_query($_GET); #Here we are removing gettgint the url and removing the tp_no from it
header("Refresh:0; url=".$url); #Now we are redirecting/refreshing the page with tp_no - As you said you need it :)
}
elseif (isset($_SESSION['tp_no']))
#Here is the else if condition once we refresh the page we won't have $_GET so the it will come inside this loop
{
echo $_SESSION['tp_no']; #Displaying the value that is from the session
session_unset(); #Unsetting the session value for secure
session_destroy(); #Destroying the entire session value for secure
}
else
{
#The compiler will come to this part if both session or url is not set, So this is illegal area
echo "Direct / Illegal Access not allowed";
#There might be some hackers/genius persons who will try to access directly this page, to avoid them we are showing them the above warning message
}
?>