I have a PHP page which accepts two variables
<?php
$formurl = "listen.html" ;
$playerurl = "player.php" ;
$mymp3 = $_POST["mp3name"];
$mytitl = $_POST["titlname"];
/* echo "MP3 Name: ".$mymp3."<br>" ;
echo "Chapter Name: ".$mytitl; */
header( "Location: $playerurl?mp3name=$mymp3& ?titlname=$mytitl");
exit ;
?>
but when I open player.php,
<table width="519" border="0" align="center">
<tr>
<?php
$mymp3=$ _GET[ "mp3name"];
$mytitl=$ _GET[ "titlname"];
?>
<td width="513" height="63" class="TopNav" align="center">You are listening to
<?php echo $mytitl; ?>
</td>
</tr>
<tr>
<td align="center">
<audio autoplay controls preload="auto">
<source src="/MP3s/<?php echo $mymp3; ?>.ogg" type="audio/ogg" />
<source src="/MP3s/<?php echo $mymp3; ?>.mp3" />Your browser does not support the audio tag.</audio>
</td>
</tr>
<tr>
<td> </td>
</tr>
only one variable (mp3name) gets displayed. Please help.
should be
the first query string key starts
?and the rest start with&.I have added the spaces and
.(concetenation) to make it easier to read (not required)Wikipedia link to info about the query string
Update
As @ernie pointed out in the comments …
http_build_querydoes this for you … and encodes the paramters .. you use it like this :