Forum Moderators: open
<?php
if (!isset($_SESSION['username']) ¦¦!$result ¦¦ mysql_num_rows($result) == 0 ) {
echo "<IFRAME src='join.php' name='right' width='296' height='302' scrolling='no' name='right'></IFRAME>";
} else {
if(!isset($var)){
echo "<IFRAME src='user.php' name='right' width='296' height='302' scrolling='no' name='right'></IFRAME>";
}elseif($var == "var00"){
echo "<IFRAME src='news.php' name='right' width='295' height='302' scrolling='no' name='right'></IFRAME>";
}elseif($var == "var01"){
echo "<IFRAME src='search.php' name='right' width='295' height='302' scrolling='no' name='right'></IFRAME>";
}elseif($var == "var02"){
echo "<IFRAME src='theory.php' name='right' width='295' height='302' scrolling='no' name='right'></IFRAME>";
}elseif($var == "var03"){
echo "<IFRAME src='collaboration.php' name='right' width='295' height='302' scrolling='no' name='right'></IFRAME>";
}elseif($var == "var04"){
echo "<IFRAME src='songwriting.php' name='right' width='295' height='302' scrolling='no' name='right'></IFRAME>";
}else{
echo "have a nice day.";
}
}
?>
So if that information is relevant, JavaScript won't do.
In JavaScript it is possible to parse the query-part of a URL: it's called location.search , and methods such as split() and substr() can be useful.
As you have not mentioned whether there is a query string - you also forgot to mention what the script is supposed to do - it's hard to say more. If I were you, I'd stick to PHP working, as its output is not dependent on browser settings.