I’ve got an iframe that is sending variables in the url. Problem is I’ve got 2 variables that is being send in the url, when I echo the first variable, it also displays the value of the 2nd variable:
PAGE1
<?php
$tid = $_SESSION['tid'];
$userid = $_SESSION['userid'];
echo "<IFRAME SRC='timer.php?tid=$tid?userid=$userid' WIDTH='500' HEIGHT='500' frameborder='0'></IFRAME>";
TIMER.PHP
session_start();
$tid = $_GET['tid'];
echo "tid:";
echo $tid;
OUTPUT:
tid:8?userid=999
The output should only be tid:8 why the ?userid=999
The URL should be
timer.php?tid=$tid&userid=$useridnotice I replaced the second?with a&. You use a?to separate the variables from the rest of the URL, and the&to separate the variables from eachother.