0

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

Edited by Arsench: n/a

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Arsench
0
<?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"; 
?>
0
<?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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.