Hello world,
I’m trying something very simple but can’t get the result.
I have table from I’m selecting a value which exist, then I want to display the value on the other page, but can’t get the result.

Here is the code. The first page is active.php where goes the following code:

include('db.php'); // connecting to DB
$q=mysql_query("select * from t  where p_name = 'test' ")or die(mysql_error()); 
while($r = mysql_fetch_array($q)){
   $p_name=$r["p_name"];
   $tema1=$r["tema1"];
   $tema2=$r["tema2"];
}
// here is the link that the user hava to click and go to the ex.php //page and the $tema1 value must be displayed on the ex.php //page
echo"<a href=\ex.php?arg=$tema1\><font color=red>$tema1</font></a>";

and here is the ex.php code

<?php
$tem=$arg; 
echo"Tema selected: $tem"; // this is the value that can't display
?>

Can someone help me please?
Thanks in advance

Recommended Answers

All 4 Replies

Member Avatar for diafol
<?php
$tem=$arg; 
echo"Tema selected: $tem"; // this is the value that can't display
?>

try this:

<?php
$tem=$_GET['arg']; 
echo"Tema selected: $tem"; 
?>
<?php
$tem=$arg; 
echo"Tema selected: $tem"; // this is the value that can't display
?>

try this:

<?php
$tem=$_GET['arg']; 
echo"Tema selected: $tem"; 
?>

Hi, thank you very much, that works correctly.
regards

Member Avatar for diafol

wanna mark it solved?

wanna mark it solved?

sorry, DONE :) thanks again:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.