Any clue why this wont work?
Posted: Mon Jan 13, 2003 3:05 pm
OK, here's the deal. I'm involved in a fantasy wrestling federation. I'm using it as a place to practice writing/using PHP and MySQL. I have set up a database to record the information for each show. I want to havea user type in who will face who and for what title if applicable in a form and have PHP enter it into a datbase and display it properly. So a match would display
blah vs. blah or blah vs blah(World Title Match) if the title field was filled in. My code worked for everything for one match. But when I repeated a portion of my ciode that would check if the title filed for a match was filled in it stopped displaying it. The PHP page still got called and the form variables got enetered into the database fine but nothing else got displayed. Now if anyone wants to look at the code great, thanks. I understand its kind of a mess and I know it would've been a lot less code if I used arrays but I'm still new at this and I think of ways to simplify things when its to late. Heres the code. I've labeled the problem area, its near the bottom.
<html>
<head>
<title>Staff - Card Update</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#3F5268" text="#000066">
<?PHP
$s = addslashes($_POST['show']);
$d = addslashes($_POST['date']);
$m1w1 = addslashes($_POST['match1_wrestler1']);
$m1w2 = addslashes($_POST['match1_wrestler2']);
$m1w3 = addslashes($_POST['match1_wrestler3']);
$m1w4 = addslashes($_POST['match1_wrestler4']);
$m2w1 = addslashes($_POST['match2_wrestler1']);
$m2w2 = addslashes($_POST['match2_wrestler2']);
$m2w3 = addslashes($_POST['match2_wrestler3']);
$m2w4 = addslashes($_POST['match2_wrestler4']);
$m3w1 = addslashes($_POST['match3_wrestler1']);
$m3w2 = addslashes($_POST['match3_wrestler2']);
$m3w3 = addslashes($_POST['match3_wrestler3']);
$m3w4 = addslashes($_POST['match3_wrestler4']);
$m4w1 = addslashes($_POST['match4_wrestler1']);
$m4w2 = addslashes($_POST['match4_wrestler2']);
$m4w3 = addslashes($_POST['match4_wrestler3']);
$m4w4 = addslashes($_POST['match4_wrestler4']);
$m5w1 = addslashes($_POST['match5_wrestler1']);
$m5w2 = addslashes($_POST['match5_wrestler2']);
$m5w3 = addslashes($_POST['match5_wrestler3']);
$m5w4 = addslashes($_POST['match5_wrestler4']);
$m6w1 = addslashes($_POST['match6_wrestler1']);
$m6w2 = addslashes($_POST['match6_wrestler2']);
$m6w3 = addslashes($_POST['match6_wrestler3']);
$m6w4 = addslashes($_POST['match6_wrestler4']);
$m7w1 = addslashes($_POST['match7_wrestler1']);
$m7w2 = addslashes($_POST['match7_wrestler2']);
$m7w3 = addslashes($_POST['match7_wrestler3']);
$m7w4 = addslashes($_POST['match7_wrestler4']);
$m8w1 = addslashes($_POST['match8_wrestler1']);
$m8w2 = addslashes($_POST['match8_wrestler2']);
$m8w3 = addslashes($_POST['match8_wrestler3']);
$m8w4 = addslashes($_POST['match8_wrestler4']);
$m9w1 = addslashes($_POST['match9_wrestler1']);
$m9w2 = addslashes($_POST['match9_wrestler2']);
$m9w3 = addslashes($_POST['match9_wrestler3']);
$m9w4 = addslashes($_POST['match9_wrestler4']);
$m10w1 = addslashes($_POST['match10_wrestler1']);
$m10w2 = addslashes($_POST['match10_wrestler2']);
$m10w3 = addslashes($_POST['match10_wrestler3']);
$m10w4 = addslashes($_POST['match10_wrestler4']);
$m1m = addslashes($_POST['match1_match']);
$m2m = addslashes($_POST['match2_match']);
$m3m = addslashes($_POST['match3_match']);
$m4m = addslashes($_POST['match4_match']);
$m5m = addslashes($_POST['match5_match']);
$m6m = addslashes($_POST['match6_match']);
$m7m = addslashes($_POST['match7_match']);
$m8m = addslashes($_POST['match8_match']);
$m9m = addslashes($_POST['match9_match']);
$m10m = addslashes($_POST['match10_match']);
$m1t = addslashes($_POST['match1_title']);
$m2t = addslashes($_POST['match2_title']);
$m3t = addslashes($_POST['match3_title']);
$m4t = addslashes($_POST['match4_title']);
$m5t = addslashes($_POST['match5_title']);
$m6t = addslashes($_POST['match6_title']);
$m7t = addslashes($_POST['match7_title']);
$m8t = addslashes($_POST['match8_title']);
$m9t = addslashes($_POST['match9_title']);
$m10t = addslashes($_POST['match10_title']);
$main_event = "<font color='red'> (MAIN EVENT) </font><br>";
@ $db = mysql_pconnect("localhost", "root", "xxxxxx");
if(!$db)
{
echo "error";
exit;
}
mysql_select_db("sft");
$query1 = "DELETE FROM $s";
$result1 = mysql_query($query1);
$query = "insert into $s values('".$d."', '".$m1w1."', '".$m1w2."', '".$m1w3."', '".$m1w4."', '".$m1m."', '".$m1t."'),
('".$d."', '".$m2w1."', '".$m2w2."', '".$m2w3."', '".$m2w4."', '".$m2m."', '".$m2t."'), ('".$d."', '".$m3w1."', '".$m3w2."', '".$m3w3."', '".$m3w4."', '".$m3m."', '".$m3t."'),
('".$d."', '".$m4w1."', '".$m4w2."', '".$m4w3."', '".$m4w4."', '".$m4m."', '".$m4t."'),
('".$d."', '".$m5w1."', '".$m5w2."', '".$m5w3."', '".$m5w4."', '".$m5m."', '".$m5t."'),
('".$d."', '".$m6w1."', '".$m6w2."', '".$m6w3."', '".$m6w4."', '".$m6m."', '".$m6t."'),
('".$d."', '".$m7w1."', '".$m7w2."', '".$m7w3."', '".$m7w4."', '".$m7m."', '".$m7t."'),
('".$d."', '".$m8w1."', '".$m8w2."', '".$m8w3."', '".$m8w4."', '".$m8m."', '".$m8t."'),
('".$d."', '".$m9w1."', '".$m9w2."', '".$m9w3."', '".$m9w4."', '".$m9m."', '".$m9t."'),
('".$d."', '".$m10w1."', '".$m10w2."', '".$m10w3."', '".$m10w4."', '".$m10m."', '".$m10t."')";
$result = mysql_query($query);
if($result)
{
echo mysql_affected_rows(). " records inserted.";
}
echo "<p><p>";
echo "YOU HAVE INSERTED THE FOLLOWING MATCHES INTO THE $s CARD: <br> ";
$match1 = "$m1w1 vs. $m1w2";
$match2 = "$m2w1 vs. $m2w2";
$match3 = "$m3w1 vs. $m3w2";
$match4 = "$m4w1 vs. $m4w2";
$match5 = "$m5w1 vs. $m5w2";
$match6 = "$m6w1 vs. $m6w2";
$match7 = "$m7w1 vs. $m7w2";
$match8 = "$m8w1 vs. $m8w2";
$match9 = "$m9w1 vs. $m9w2";
$match10 = "$m10w1 vs. $m10w2";
/*****************************MATCH 1*****************************/
switch($m1w3)
{
case "" :
break;
default:
$match1 = $match1 . " vs. $m1w3";
switch($m1w4)
{
case "" :
break;
default:
$match1 = $match1 . " vs. $m1w4";
break;
}
}
/*****************************MATCH 2*****************************/
switch($m2w3)
{
case "" :
break;
default:
$match2 = $match2 . " vs. $m2w3";
switch($m2w4)
{
case "" :
break;
default:
$match2 = $match2 . " vs. $m2w4";
break;
}
}
/*****************************MATCH 3*****************************/
switch($m3w3)
{
case "" :
break;
default:
$match3 = $match3 . " vs. $m3w3";
switch($m3w4)
{
case "" :
break;
default:
$match3 = $match3 . " vs. $m3w4";
break;
}
}
/*****************************MATCH 4*****************************/
switch($m4w3)
{
case "" :
break;
default:
$match4 = $match4 . " vs. $m1w4";
switch($m1w4)
{
case "" :
break;
default:
$match4 = $match4 . " vs. $m4w4";
break;
}
}
/*****************************MATCH 5*****************************/
switch($m5w3)
{
case "" :
break;
default:
$match5 = $match5 . " vs. $m5w3";
switch($m5w4)
{
case "" :
break;
default:
$match5 = $match5 . " vs. $m5w4";
break;
}
}
/*****************************MATCH 6*****************************/
switch($m6w3)
{
case "" :
break;
default:
$match6 = $match6 . " vs. $m6w3";
switch($m6w4)
{
case "" :
break;
default:
$match6 = $match6 . " vs. $m6w4";
break;
}
}
/*****************************MATCH 7*****************************/
switch($m7w3)
{
case "" :
break;
default:
$match7 = $match7 . " vs. $m7w3";
switch($m7w4)
{
case "" :
break;
default:
$match7 = $match7 . " vs. $m7w4";
break;
}
}
/*****************************MATCH 8*****************************/
switch($m8w3)
{
case "" :
break;
default:
$match8 = $match8 . " vs. $m8w3";
switch($m8w4)
{
case "" :
break;
default:
$match8 = $match8 . " vs. $m8w4";
break;
}
}
/*****************************MATCH 9*****************************/
switch($m9w3)
{
case "" :
break;
default:
$match9 = $match9 . " vs. $m9w3";
switch($m9w4)
{
case "" :
break;
default:
$match9 = $match9 . " vs. $m9w4";
break;
}
}
/*****************************MATCH 10*****************************/
switch($m10w3)
{
case "" :
break;
default:
$match10 = $match10 . " vs. $m10w3";
switch($m10w4)
{
case "" :
break;
default:
$match10 = $match10 . " vs. $m10w4";
break;
}
}
/***********************MAIN EVENT VALIDATION**********************************/
switch($m10w1)
{
case "" :
$match10 = "";
break;
default:
$match10 = $main_event.$match10;
break;
}
switch($m9w1)
{
case "" :
$match9 = "";
break;
default:
switch($m10w1)
{
case "" :
$match9 = $main_event.$match9;
break;
default:
break;
}
break;
}
switch($m8w1)
{
case "" :
$match8 = "";
break;
default:
switch($m9w1)
{
case "" :
$match8 = $main_event.$match8;
break;
default:
break;
}
break;
}
switch($m7w1)
{
case "" :
$match7 = "";
break;
default:
switch($m8w1)
{
case "" :
$match7 = $main_event.$match7;
break;
default:
break;
}
break;
}
switch($m6w1)
{
case "" :
$match6 = "";
break;
default:
switch($m7w1)
{
case "" :
$match6 = $main_event.$match6;
break;
default:
break;
}
break;
}
switch($m5w1)
{
case "" :
$match5 = "";
break;
default:
switch($m6w1)
{
case "" :
$match5 = $main_event.$match5;
break;
default:
break;
}
break;
}
switch($m4w1)
{
case "" :
$match4 = "";
break;
default:
switch($m5w1)
{
case "" :
$match4 = $main_event.$match4;
break;
default:
break;
}
break;
}
switch($m3w1)
{
case "" :
$match3 = "";
break;
default:
switch($m4w1)
{
case "" :
$match3 = $main_event.$match3;
break;
default:
break;
}
break;
}
switch($m2w1)
{
case "" :
$match2 = "";
break;
default:
switch($m3w1)
{
case "" :
$match2 = $main_event.$match2;
break;
default:
break;
}
break;
}
switch($m1w1)
{
case "" :
$match1 = "";
break;
default:
switch($m2w1)
{
case "" :
$match1 = $main_event.$match1;
break;
default:
break;
}
break;
}
/****************************ADDING TITLE AND MATCH INFORMATION*******************/
/*******MATCH 1************/
/*When I typed in the staff for match one the three echo tags at the bottom worked pefectly but when I used the code for matches 2-9 the echo tags would not display. Its the same code except the variables are different. The variables work fine too because they get enetered into the db correctly.*/
if($m1m == "" && $m1t =="")
{
exit;
}
elseif($m1m == "" && $m1t !="")
{
$match1 = $match1." ($m1t Title Match)";
}
elseif($m1m != "" && $m1t == "")
{
$match1 = $match1." ($m1m Match)";
}
elseif($m1m != "" && $m1t !="")
{
$match1 = $match1." ($m1t Title $m1m Match)";
}
/*I typed the above on its own and it worked, but adding the rest amde it stop working, it never gets to the cecho tags at the bottom.*/
/*******MATCH 2************/
if($m2m == "" && $m2t =="")
{
exit;
}
elseif($m2m == "" && $m2t !="")
{
$match2 = $match2." ($m2t Title Match)";
}
elseif($m2m != "" && $m2t == "")
{
$match2 = $match2." ($m2m Match)";
}
elseif($m2m != "" && $m2t !="")
{
$match2 = $match2." ($m2t Title $m2m Match)";
}
/*******MATCH 3************/
if($m3m == "" && $m3t == ""){
exit;}
elseif($m3m == "" && $m3t != ""){
$match3 = $match3." ($m3t Title Match)";}
elseif($m3m != "" && $m3t == ""){
$match3 = $match3." ($m3m Match)";}
elseif($m3m != "" && $m3t !=""){
$match3 = $match3." ($m3t Title $m3m Match)";}
/*******MATCH 4************/
if($m4m == "" && $m4t =="")
exit;
elseif($m4m == "" && $m4t !="")
$match4 = $match4." ($m4t Title Match)";
elseif($m4m != "" && $m4t == "")
$match4 = $match4." ($m4m Match)";
elseif($m4m != "" && $m4t !="")
$match4 = $match4." ($m4t Title $m4m Match)";
/*******MATCH 5************/
if($m5m == "" && $m5t ==""){
exit;}
elseif($m5m == "" && $m5t !=""){
$match5 = $match5." ($m5t Title Match)";}
elseif($m5m != "" && $m5t == ""){
$match5 = $match5." ($m5m Match)";}
elseif($m5m != "" && $m5t !=""){
$match5 = $match5." ($m5t Title $m5m Match)";}
/*******MATCH 6************/
if($m6m == "" && $m6t ==""){
exit;}
elseif($m6m == "" && $m6t !=""){
$match4 = $match6." ($m6t Title Match)";}
elseif($m6m != "" && $m6t == ""){
$match4 = $match6." ($m6m Match)";}
elseif($m6m != "" && $m6t !=""){
$match4 = $match6." ($m6t Title $m6m Match)";}
/*******MATCH 7************/
if($m7m == "" && $m7t ==""){
exit;}
elseif($m7m == "" && $m7t !=""){
$match7 = $match7." ($m7t Title Match)";}
elseif($m7m != "" && $m7t == ""){
$match7 = $match7." ($m7m Match)";}
elseif($m7m != "" && $m7t !=""){
$match7 = $match7." ($m7t Title $m7m Match)";}
/*******MATCH 8************/
if($m8m == "" && $m8t ==""){
exit;}
elseif($m8m == "" && $m8t !=""){
$match8 = $match8." ($m8t Title Match)";}
elseif($m8m != "" && $m8t == ""){
$match8 = $match8." ($m8m Match)";}
elseif($m8m != "" && $m8t !=""){
$match8 = $match8." ($m8t Title $m8m Match)";}
/*******MATCH 9************/
if($m9m == "" && $m9t ==""){
exit;}
elseif($m9m == "" && $m9t !=""){
$match9 = $match9." ($m9t Title Match)";}
elseif($m9m != "" && $m9t == ""){
$match9 = $match9." ($m9m Match)";}
elseif($m9m != "" && $m9t !=""){
$match9 = $match9." ($m9t Title $m9m Match)";}
/*******MATCH 10************/
if($m10m == "" && $m10t ==""){
exit;}
elseif($m10m == "" && $m10t !=""){
$match10 = $match10." ($m10t Title Match)";}
elseif($m10m != "" && $m10t == ""){
$match10 = $match10." ($m10m Match)";}
elseif($m10m != "" && $m10t !=""){
$match10 = $match10." ($m10t Title $m10m Match)";}
echo "<font color='#ffffff' face='tahoma' size='2'>";
echo "$match1 <br> $match2 <br> $match3 <br> $match4 <br> $match5 <br> $match6 <br> $match7 <br> $match8 <br> $match9 <br> $match10 <br>";
echo "</font>Testing";
?>
</body>
</html>
Thanks if anyone can find a problem or if anyone even makes it this far lol.
blah vs. blah or blah vs blah(World Title Match) if the title field was filled in. My code worked for everything for one match. But when I repeated a portion of my ciode that would check if the title filed for a match was filled in it stopped displaying it. The PHP page still got called and the form variables got enetered into the database fine but nothing else got displayed. Now if anyone wants to look at the code great, thanks. I understand its kind of a mess and I know it would've been a lot less code if I used arrays but I'm still new at this and I think of ways to simplify things when its to late. Heres the code. I've labeled the problem area, its near the bottom.
<html>
<head>
<title>Staff - Card Update</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#3F5268" text="#000066">
<?PHP
$s = addslashes($_POST['show']);
$d = addslashes($_POST['date']);
$m1w1 = addslashes($_POST['match1_wrestler1']);
$m1w2 = addslashes($_POST['match1_wrestler2']);
$m1w3 = addslashes($_POST['match1_wrestler3']);
$m1w4 = addslashes($_POST['match1_wrestler4']);
$m2w1 = addslashes($_POST['match2_wrestler1']);
$m2w2 = addslashes($_POST['match2_wrestler2']);
$m2w3 = addslashes($_POST['match2_wrestler3']);
$m2w4 = addslashes($_POST['match2_wrestler4']);
$m3w1 = addslashes($_POST['match3_wrestler1']);
$m3w2 = addslashes($_POST['match3_wrestler2']);
$m3w3 = addslashes($_POST['match3_wrestler3']);
$m3w4 = addslashes($_POST['match3_wrestler4']);
$m4w1 = addslashes($_POST['match4_wrestler1']);
$m4w2 = addslashes($_POST['match4_wrestler2']);
$m4w3 = addslashes($_POST['match4_wrestler3']);
$m4w4 = addslashes($_POST['match4_wrestler4']);
$m5w1 = addslashes($_POST['match5_wrestler1']);
$m5w2 = addslashes($_POST['match5_wrestler2']);
$m5w3 = addslashes($_POST['match5_wrestler3']);
$m5w4 = addslashes($_POST['match5_wrestler4']);
$m6w1 = addslashes($_POST['match6_wrestler1']);
$m6w2 = addslashes($_POST['match6_wrestler2']);
$m6w3 = addslashes($_POST['match6_wrestler3']);
$m6w4 = addslashes($_POST['match6_wrestler4']);
$m7w1 = addslashes($_POST['match7_wrestler1']);
$m7w2 = addslashes($_POST['match7_wrestler2']);
$m7w3 = addslashes($_POST['match7_wrestler3']);
$m7w4 = addslashes($_POST['match7_wrestler4']);
$m8w1 = addslashes($_POST['match8_wrestler1']);
$m8w2 = addslashes($_POST['match8_wrestler2']);
$m8w3 = addslashes($_POST['match8_wrestler3']);
$m8w4 = addslashes($_POST['match8_wrestler4']);
$m9w1 = addslashes($_POST['match9_wrestler1']);
$m9w2 = addslashes($_POST['match9_wrestler2']);
$m9w3 = addslashes($_POST['match9_wrestler3']);
$m9w4 = addslashes($_POST['match9_wrestler4']);
$m10w1 = addslashes($_POST['match10_wrestler1']);
$m10w2 = addslashes($_POST['match10_wrestler2']);
$m10w3 = addslashes($_POST['match10_wrestler3']);
$m10w4 = addslashes($_POST['match10_wrestler4']);
$m1m = addslashes($_POST['match1_match']);
$m2m = addslashes($_POST['match2_match']);
$m3m = addslashes($_POST['match3_match']);
$m4m = addslashes($_POST['match4_match']);
$m5m = addslashes($_POST['match5_match']);
$m6m = addslashes($_POST['match6_match']);
$m7m = addslashes($_POST['match7_match']);
$m8m = addslashes($_POST['match8_match']);
$m9m = addslashes($_POST['match9_match']);
$m10m = addslashes($_POST['match10_match']);
$m1t = addslashes($_POST['match1_title']);
$m2t = addslashes($_POST['match2_title']);
$m3t = addslashes($_POST['match3_title']);
$m4t = addslashes($_POST['match4_title']);
$m5t = addslashes($_POST['match5_title']);
$m6t = addslashes($_POST['match6_title']);
$m7t = addslashes($_POST['match7_title']);
$m8t = addslashes($_POST['match8_title']);
$m9t = addslashes($_POST['match9_title']);
$m10t = addslashes($_POST['match10_title']);
$main_event = "<font color='red'> (MAIN EVENT) </font><br>";
@ $db = mysql_pconnect("localhost", "root", "xxxxxx");
if(!$db)
{
echo "error";
exit;
}
mysql_select_db("sft");
$query1 = "DELETE FROM $s";
$result1 = mysql_query($query1);
$query = "insert into $s values('".$d."', '".$m1w1."', '".$m1w2."', '".$m1w3."', '".$m1w4."', '".$m1m."', '".$m1t."'),
('".$d."', '".$m2w1."', '".$m2w2."', '".$m2w3."', '".$m2w4."', '".$m2m."', '".$m2t."'), ('".$d."', '".$m3w1."', '".$m3w2."', '".$m3w3."', '".$m3w4."', '".$m3m."', '".$m3t."'),
('".$d."', '".$m4w1."', '".$m4w2."', '".$m4w3."', '".$m4w4."', '".$m4m."', '".$m4t."'),
('".$d."', '".$m5w1."', '".$m5w2."', '".$m5w3."', '".$m5w4."', '".$m5m."', '".$m5t."'),
('".$d."', '".$m6w1."', '".$m6w2."', '".$m6w3."', '".$m6w4."', '".$m6m."', '".$m6t."'),
('".$d."', '".$m7w1."', '".$m7w2."', '".$m7w3."', '".$m7w4."', '".$m7m."', '".$m7t."'),
('".$d."', '".$m8w1."', '".$m8w2."', '".$m8w3."', '".$m8w4."', '".$m8m."', '".$m8t."'),
('".$d."', '".$m9w1."', '".$m9w2."', '".$m9w3."', '".$m9w4."', '".$m9m."', '".$m9t."'),
('".$d."', '".$m10w1."', '".$m10w2."', '".$m10w3."', '".$m10w4."', '".$m10m."', '".$m10t."')";
$result = mysql_query($query);
if($result)
{
echo mysql_affected_rows(). " records inserted.";
}
echo "<p><p>";
echo "YOU HAVE INSERTED THE FOLLOWING MATCHES INTO THE $s CARD: <br> ";
$match1 = "$m1w1 vs. $m1w2";
$match2 = "$m2w1 vs. $m2w2";
$match3 = "$m3w1 vs. $m3w2";
$match4 = "$m4w1 vs. $m4w2";
$match5 = "$m5w1 vs. $m5w2";
$match6 = "$m6w1 vs. $m6w2";
$match7 = "$m7w1 vs. $m7w2";
$match8 = "$m8w1 vs. $m8w2";
$match9 = "$m9w1 vs. $m9w2";
$match10 = "$m10w1 vs. $m10w2";
/*****************************MATCH 1*****************************/
switch($m1w3)
{
case "" :
break;
default:
$match1 = $match1 . " vs. $m1w3";
switch($m1w4)
{
case "" :
break;
default:
$match1 = $match1 . " vs. $m1w4";
break;
}
}
/*****************************MATCH 2*****************************/
switch($m2w3)
{
case "" :
break;
default:
$match2 = $match2 . " vs. $m2w3";
switch($m2w4)
{
case "" :
break;
default:
$match2 = $match2 . " vs. $m2w4";
break;
}
}
/*****************************MATCH 3*****************************/
switch($m3w3)
{
case "" :
break;
default:
$match3 = $match3 . " vs. $m3w3";
switch($m3w4)
{
case "" :
break;
default:
$match3 = $match3 . " vs. $m3w4";
break;
}
}
/*****************************MATCH 4*****************************/
switch($m4w3)
{
case "" :
break;
default:
$match4 = $match4 . " vs. $m1w4";
switch($m1w4)
{
case "" :
break;
default:
$match4 = $match4 . " vs. $m4w4";
break;
}
}
/*****************************MATCH 5*****************************/
switch($m5w3)
{
case "" :
break;
default:
$match5 = $match5 . " vs. $m5w3";
switch($m5w4)
{
case "" :
break;
default:
$match5 = $match5 . " vs. $m5w4";
break;
}
}
/*****************************MATCH 6*****************************/
switch($m6w3)
{
case "" :
break;
default:
$match6 = $match6 . " vs. $m6w3";
switch($m6w4)
{
case "" :
break;
default:
$match6 = $match6 . " vs. $m6w4";
break;
}
}
/*****************************MATCH 7*****************************/
switch($m7w3)
{
case "" :
break;
default:
$match7 = $match7 . " vs. $m7w3";
switch($m7w4)
{
case "" :
break;
default:
$match7 = $match7 . " vs. $m7w4";
break;
}
}
/*****************************MATCH 8*****************************/
switch($m8w3)
{
case "" :
break;
default:
$match8 = $match8 . " vs. $m8w3";
switch($m8w4)
{
case "" :
break;
default:
$match8 = $match8 . " vs. $m8w4";
break;
}
}
/*****************************MATCH 9*****************************/
switch($m9w3)
{
case "" :
break;
default:
$match9 = $match9 . " vs. $m9w3";
switch($m9w4)
{
case "" :
break;
default:
$match9 = $match9 . " vs. $m9w4";
break;
}
}
/*****************************MATCH 10*****************************/
switch($m10w3)
{
case "" :
break;
default:
$match10 = $match10 . " vs. $m10w3";
switch($m10w4)
{
case "" :
break;
default:
$match10 = $match10 . " vs. $m10w4";
break;
}
}
/***********************MAIN EVENT VALIDATION**********************************/
switch($m10w1)
{
case "" :
$match10 = "";
break;
default:
$match10 = $main_event.$match10;
break;
}
switch($m9w1)
{
case "" :
$match9 = "";
break;
default:
switch($m10w1)
{
case "" :
$match9 = $main_event.$match9;
break;
default:
break;
}
break;
}
switch($m8w1)
{
case "" :
$match8 = "";
break;
default:
switch($m9w1)
{
case "" :
$match8 = $main_event.$match8;
break;
default:
break;
}
break;
}
switch($m7w1)
{
case "" :
$match7 = "";
break;
default:
switch($m8w1)
{
case "" :
$match7 = $main_event.$match7;
break;
default:
break;
}
break;
}
switch($m6w1)
{
case "" :
$match6 = "";
break;
default:
switch($m7w1)
{
case "" :
$match6 = $main_event.$match6;
break;
default:
break;
}
break;
}
switch($m5w1)
{
case "" :
$match5 = "";
break;
default:
switch($m6w1)
{
case "" :
$match5 = $main_event.$match5;
break;
default:
break;
}
break;
}
switch($m4w1)
{
case "" :
$match4 = "";
break;
default:
switch($m5w1)
{
case "" :
$match4 = $main_event.$match4;
break;
default:
break;
}
break;
}
switch($m3w1)
{
case "" :
$match3 = "";
break;
default:
switch($m4w1)
{
case "" :
$match3 = $main_event.$match3;
break;
default:
break;
}
break;
}
switch($m2w1)
{
case "" :
$match2 = "";
break;
default:
switch($m3w1)
{
case "" :
$match2 = $main_event.$match2;
break;
default:
break;
}
break;
}
switch($m1w1)
{
case "" :
$match1 = "";
break;
default:
switch($m2w1)
{
case "" :
$match1 = $main_event.$match1;
break;
default:
break;
}
break;
}
/****************************ADDING TITLE AND MATCH INFORMATION*******************/
/*******MATCH 1************/
/*When I typed in the staff for match one the three echo tags at the bottom worked pefectly but when I used the code for matches 2-9 the echo tags would not display. Its the same code except the variables are different. The variables work fine too because they get enetered into the db correctly.*/
if($m1m == "" && $m1t =="")
{
exit;
}
elseif($m1m == "" && $m1t !="")
{
$match1 = $match1." ($m1t Title Match)";
}
elseif($m1m != "" && $m1t == "")
{
$match1 = $match1." ($m1m Match)";
}
elseif($m1m != "" && $m1t !="")
{
$match1 = $match1." ($m1t Title $m1m Match)";
}
/*I typed the above on its own and it worked, but adding the rest amde it stop working, it never gets to the cecho tags at the bottom.*/
/*******MATCH 2************/
if($m2m == "" && $m2t =="")
{
exit;
}
elseif($m2m == "" && $m2t !="")
{
$match2 = $match2." ($m2t Title Match)";
}
elseif($m2m != "" && $m2t == "")
{
$match2 = $match2." ($m2m Match)";
}
elseif($m2m != "" && $m2t !="")
{
$match2 = $match2." ($m2t Title $m2m Match)";
}
/*******MATCH 3************/
if($m3m == "" && $m3t == ""){
exit;}
elseif($m3m == "" && $m3t != ""){
$match3 = $match3." ($m3t Title Match)";}
elseif($m3m != "" && $m3t == ""){
$match3 = $match3." ($m3m Match)";}
elseif($m3m != "" && $m3t !=""){
$match3 = $match3." ($m3t Title $m3m Match)";}
/*******MATCH 4************/
if($m4m == "" && $m4t =="")
exit;
elseif($m4m == "" && $m4t !="")
$match4 = $match4." ($m4t Title Match)";
elseif($m4m != "" && $m4t == "")
$match4 = $match4." ($m4m Match)";
elseif($m4m != "" && $m4t !="")
$match4 = $match4." ($m4t Title $m4m Match)";
/*******MATCH 5************/
if($m5m == "" && $m5t ==""){
exit;}
elseif($m5m == "" && $m5t !=""){
$match5 = $match5." ($m5t Title Match)";}
elseif($m5m != "" && $m5t == ""){
$match5 = $match5." ($m5m Match)";}
elseif($m5m != "" && $m5t !=""){
$match5 = $match5." ($m5t Title $m5m Match)";}
/*******MATCH 6************/
if($m6m == "" && $m6t ==""){
exit;}
elseif($m6m == "" && $m6t !=""){
$match4 = $match6." ($m6t Title Match)";}
elseif($m6m != "" && $m6t == ""){
$match4 = $match6." ($m6m Match)";}
elseif($m6m != "" && $m6t !=""){
$match4 = $match6." ($m6t Title $m6m Match)";}
/*******MATCH 7************/
if($m7m == "" && $m7t ==""){
exit;}
elseif($m7m == "" && $m7t !=""){
$match7 = $match7." ($m7t Title Match)";}
elseif($m7m != "" && $m7t == ""){
$match7 = $match7." ($m7m Match)";}
elseif($m7m != "" && $m7t !=""){
$match7 = $match7." ($m7t Title $m7m Match)";}
/*******MATCH 8************/
if($m8m == "" && $m8t ==""){
exit;}
elseif($m8m == "" && $m8t !=""){
$match8 = $match8." ($m8t Title Match)";}
elseif($m8m != "" && $m8t == ""){
$match8 = $match8." ($m8m Match)";}
elseif($m8m != "" && $m8t !=""){
$match8 = $match8." ($m8t Title $m8m Match)";}
/*******MATCH 9************/
if($m9m == "" && $m9t ==""){
exit;}
elseif($m9m == "" && $m9t !=""){
$match9 = $match9." ($m9t Title Match)";}
elseif($m9m != "" && $m9t == ""){
$match9 = $match9." ($m9m Match)";}
elseif($m9m != "" && $m9t !=""){
$match9 = $match9." ($m9t Title $m9m Match)";}
/*******MATCH 10************/
if($m10m == "" && $m10t ==""){
exit;}
elseif($m10m == "" && $m10t !=""){
$match10 = $match10." ($m10t Title Match)";}
elseif($m10m != "" && $m10t == ""){
$match10 = $match10." ($m10m Match)";}
elseif($m10m != "" && $m10t !=""){
$match10 = $match10." ($m10t Title $m10m Match)";}
echo "<font color='#ffffff' face='tahoma' size='2'>";
echo "$match1 <br> $match2 <br> $match3 <br> $match4 <br> $match5 <br> $match6 <br> $match7 <br> $match8 <br> $match9 <br> $match10 <br>";
echo "</font>Testing";
?>
</body>
</html>
Thanks if anyone can find a problem or if anyone even makes it this far lol.