Jump to content

[SOLVED] problem with $_GET


FireDrake

Recommended Posts

Hi everyone  :)

 

when I'm on my php index and click "wedstrijden" (an url link), it will go to ~/index.php?link=wedstrijden. Now comes the problem. Within the "case "wedstrijden":" in my php is a form, which will link you to ~/index.php?sport=(chosensport)&sportknop=Bekijk while it has to go to ~/index.php?link=wedstrijden&sport=(chosensport)&sportknop=Bekijk

 

Can some please help me figuring out what this error is  :-\

 

Here is the php part of the code that contains the error(quite long :P )

 

<?php	

echo "<div class=\"alink\" id=\"browsebar2\">";

if (isset ($_GET['link'])){
switch ($_GET['link']) {
case "wedstrijden":
echo "<span>Welke sporten? Kies uit:</span>";

$query = "select * from sport";

$result = mysql_query($query);

echo "<form method=GET name=sportform>";
echo "<select name='sport'>";

	while ($rij = mysql_fetch_array($result))
		{ 
		$sportcode = $rij['scode']; 
		$soms = $rij['soms'];

		echo "<option value='$sportcode'>".$soms.""; 
		}

echo "</select>";
echo "<input type=submit name=sportknop value='Bekijk'></form>";


echo"</div>";	
echo"<div class=\"stream-ads\">";
echo"<div class=\"ads\">";	
echo"<img src=\"/Goal.jpg\">";		
echo"<div class=\"c pt\">";			
echo"</div>";			
echo"</div>";	
echo"<div class=\"stream\">";	


if ($_GET['link'] == wedstrijden)
{
	if ($_GET['sport'] == Handbal)
	{
	echo "<div><span><span class=\"shadow\">";
	echo "<a href=\"/handbal1.jpg\" title=\"Foto van de wedstrijd\"><i>Foto1: </i><img width=\"150\" height=\"113\" src=\"/handbal1.jpg\"/></a></span></span></div>";
	echo "<div><span><span class=\"shadow\">";
	echo "<a href=\"/handbal2.jpg\" title=\"Foto van de wedstrijd\"><i>Foto2: </i><img width=\"150\" height=\"113\" src=\"/handbal2.jpg\"/></a></span></span></div>";
	echo "<div><span><span class=\"shadow\">";
	echo "<a href=\"/handbal3.jpg\" title=\"Foto van de wedstrijd\"><i>Foto3: </i><img width=\"150\" height=\"113\" src=\"/handbal3.jpg\"/></a></span></span></div>";
	}
}

echo"<br/><br/><br/></div><br/><div class=\"stream2\">";

$query = "select * from sport";

$result = mysql_query($query);

/*while ($rij = mysql_fetch_array($result))
{
echo "Sportcode ";
echo $rij['scode'];
echo " is: <br>";
echo $rij['soms'];
echo "<br><br>";
}
echo "<form method=GET name=sportform>";
echo "<select name='sport'>";
while ($rij = mysql_fetch_array($result))
{ 
$sportcode = $rij['scode']; $soms = $rij['soms'];
echo "<option value='$sportcode'>$soms"; 
}
echo "</select>";
echo "<input type=submit name=sportknop value='Bekijk'></form>";*/
echo "<center><br><br>Gespeelde wedstrijd:<br><br><br><br>";
if (isset ($_GET['sportknop']))
	{
		if ($_GET['sport'] == Handbal)
			{
				/*$tabellen = mysql_list_tables ("GOAL!");
				$i=2;
				while ($i < mysql_num_rows($tabellen))
					{  
						$t_name[$i] = mysql_tablename ($tabellen, $i);
						echo $t_name[$i]. "<br>";
						$i++;
					}*/
				$query = "SELECT * FROM wedstrijd WHERE wid = '1'";
				$result = mysql_query($query);
				while ($rij = mysql_fetch_array($result))
					{
						echo "<table><tr><td>Wedstrijd nummer: ";
						echo "<td>".$rij['wid'];echo "<tr><tr><tr><tr>";
						echo "<td> Sport: ";
						echo "<td>".$rij['sport'];echo "<tr><tr><tr><tr>";
						echo "<td> Team Thuis: ";
						echo "<td>".$rij['team'];echo "<tr><tr><tr><tr>";
						echo "<td> Tegenstanders: ";
						echo "<td>".$rij['tegenstander'];echo "<br><tr><tr><tr><tr>";
						echo "<td> Datum: ";
						echo "<td>".$rij['wanneer'];echo "<tr><tr><tr><tr>";
						echo "<td> Eindstand: ";
						echo "<td>".$rij['voor'];echo "-";
						echo $rij['tegen'];echo "<tr><tr><tr><tr>";
						echo "<td>Team Thuis heeft: ";
							If ($rij['voor']>$rij['tegen'])
								{
									echo "<td>Gewonnen</table>";
								}
							else if ($rij['voor']<$rij['tegen'])
								{
									echo "<td>Verloren</table>";
								}
							else 
								{
									echo "<td>Gelijkgespeeld</table>";
								}
					}
			}
		else if ($_GET['sport'] == Voetbal)
			{
				$query = "SELECT * FROM wedstrijd WHERE wid = '9'";
				$result = mysql_query($query);
				while ($rij = mysql_fetch_array($result))
					{
						echo "<table><tr><td>Wedstrijd nummer: ";
						echo "<td>".$rij['wid'];echo "<tr><tr><tr><tr>";
						echo "<td> Sport: ";
						echo "<td>".$rij['sport'];echo "<tr><tr><tr><tr>";
						echo "<td> Team Thuis: ";
						echo "<td>".$rij['team'];echo "<tr><tr><tr><tr>";
						echo "<td> Tegenstanders: ";
						echo "<td>".$rij['tegenstander'];echo "<br><tr><tr><tr><tr>";
						echo "<td> Datum: ";
						echo "<td>".$rij['wanneer'];echo "<tr><tr><tr><tr>";
						echo "<td> Eindstand: ";
						echo "<td>".$rij['voor'];echo "-";
						echo $rij['tegen'];echo "<tr><tr><tr><tr>";
						echo "<td>Team Thuis heeft: ";
							If ($rij['voor']>$rij['tegen'])
								{
									echo "<td>Gewonnen</table>";
								}
							else if ($rij['voor']<$rij['tegen'])
								{
									echo "<td>Verloren</table>";
								}
							else 
								{
									echo "<td>Gelijkgespeeld</table>";
								}
					}
			}
		else if ($_GET['sport'] == Basketbal)
			{
				$query = "SELECT * FROM wedstrijd WHERE wid = '4'";
				$result = mysql_query($query);
				while ($rij = mysql_fetch_array($result))
					{
						echo "<table><tr><td>Wedstrijd nummer: ";
						echo "<td>".$rij['wid'];echo "<tr><tr><tr><tr>";
						echo "<td> Sport: ";
						echo "<td>".$rij['sport'];echo "<tr><tr><tr><tr>";
						echo "<td> Team Thuis: ";
						echo "<td>".$rij['team'];echo "<tr><tr><tr><tr>";
						echo "<td> Tegenstanders: ";
						echo "<td>".$rij['tegenstander'];echo "<br><tr><tr><tr><tr>";
						echo "<td> Datum: ";
						echo "<td>".$rij['wanneer'];echo "<tr><tr><tr><tr>";
						echo "<td> Eindstand: ";
						echo "<td>".$rij['voor'];echo "-";
						echo $rij['tegen'];echo "<tr><tr><tr><tr>";
						echo "<td>Team Thuis heeft: ";
							If ($rij['voor']>$rij['tegen'])
								{
									echo "<td>Gewonnen</table>";
								}
							else if ($rij['voor']<$rij['tegen'])
								{
									echo "<td>Verloren</table>";
								}
							else 
								{
									echo "<td>Gelijkgespeeld</table>";
								}
					}
			}
		else if ($_GET['sport'] == Tennis)
			{
				$query = "SELECT * FROM wedstrijd WHERE wid = '5'";
				$result = mysql_query($query);
				while ($rij = mysql_fetch_array($result))
					{
						echo "<table><tr><td>Wedstrijd nummer: ";
						echo "<td>".$rij['wid'];echo "<tr><tr><tr><tr>";
						echo "<td> Sport: ";
						echo "<td>".$rij['sport'];echo "<tr><tr><tr><tr>";
						echo "<td> Team Thuis: ";
						echo "<td>".$rij['team'];echo "<tr><tr><tr><tr>";
						echo "<td> Tegenstanders: ";
						echo "<td>".$rij['tegenstander'];echo "<br><tr><tr><tr><tr>";
						echo "<td> Datum: ";
						echo "<td>".$rij['wanneer'];echo "<tr><tr><tr><tr>";
						echo "<td> Eindstand: ";
						echo "<td>".$rij['voor'];echo "-";
						echo $rij['tegen'];echo "<tr><tr><tr><tr>";
						echo "<td>Team Thuis heeft: ";
							If ($rij['voor']>$rij['tegen'])
								{
									echo "<td>Gewonnen</table>";
								}
							else if ($rij['voor']<$rij['tegen'])
								{
									echo "<td>Verloren</table>";
								}
							else 
								{
									echo "<td>Gelijkgespeeld</table>";
								}
					}
			}
				else 
					{
						$sport = ($_GET['sport']);
						$query = "SELECT * FROM wedstrijd WHERE sport='".$sport."'";
						$result = mysql_query($query);
						while ($rij = mysql_fetch_array($result))
							{
								echo $rij['wid'];echo "<br>";
								echo $rij['sport'];echo "<br>";
								echo $rij['team'];echo "<br>";
								echo $rij['tegenstander'];echo "<br>";
								echo $rij['wanneer'];echo "<br>";
								echo $rij['voor'];echo "-";
								echo $rij['tegen'];echo "<br>";
									If ($rij['voor']>$rij['tegen'])
										{
											echo "Winnaars<br><br>";
										}
									else if ($rij['voor']<$rij['tegen'])
										{
											echo "Verliezers<br><br>";
										}
									else 
										{
											echo "Gelijkspel<br><br>";
										}
							}
					}
	}
	}
	}
echo "</center>";
//else { die ("<center><br><br><br><br>Er kon geen verbinding worden gemaakt met de Database.<br><b>".mysql_error()."</b></center>"); }
mysql_close();
?>

 

Help please  ???  ::)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.