Jump to content

[SOLVED] Help With Error one last time


cry of war

Recommended Posts

I get another blank page

 

<?php
if (!isset($_POST['add'])){
$finish = 0;
$urlnum = 0;
$url = "A";
?>
<html>
<head>
<title>SGWRAIDER</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
PLEASE CLICK INSIDE OF THE SGW SPY LOG AREA AND PRESS CTRL+A THEN CTRL+C THEN CLICK IN THE
TEXT AREA BELOW WHERE IT SAYS "INSERT HERE".
<textarea rows="20" cols="20" name= "info">INSERT HERE</textarea><br />
ENTER ID: <INPUT TYPE="TEXT" name="id" value="INPUT ID HERE"><br />
<input type="submit" value="add" name="add"><input type="submit" value="submit" name="submit">
</form>
<?php
}
elseif {isset($_POST['submit'])}
{
   for($urlnum = 0; $urlnum = $finish; $urlnum++)
    {
    echo "$$url.$urlnum\n";
}
} elseif {isset($_POST['add'])}{
$finish++;
$urlnum++;
$info = $_POST['info'];
$info2 = $_POST['info'];
$id   = $_POST['id'];
$find = array('Mercenaries', 'Jaffa Army', 'Super Soldiers', 'Drones', 'Clones', 'bot', 'Units', 'Human Form troop7', 'Soldier', 'NID Agent', 'Army', '  ', ',');
$replace = array('troop1','troop2','troop3','troop4','troop5','troop6','troop7','troop8','troop9','troop10','troop11', ' ', '');
$info = str_replace($find, $replace, $info);
$info = explode(" ", $info);
$find2 = array( '  ', ','); 
$replace2 = array(' ', '');
$info2 = str_replace($find2, $replace2, $info2);
preg_match_all('/.+ [0-9]+/', $info2, $a);
foreach ($a[0] as $k => $v) {
preg_match_all('/([^0-9]+) ([0-9 ]+)/', $v, $b);
$c[$b[1][0]] = explode(' ',$b[2][0]);
}
//print_r($c);
//$fild_for_sum = array('bot', 'Units', 'Human Form Units','Covert Operatives:','Anti-Covert Operatives:');
$fild_for_sum = array('Mercenaries', 'Soldier', 'NID Agent','Covert Operatives:','Anti-Covert Operatives:');
$u = array('');
foreach ($fild_for_sum as $k) $u = array_merge($u, $c[$k]);
for ($i = 1; $i < 12; $i++) {
$n = 'unit'.$i;
$$n = $u[$i];
}
$AT = $c['Attack Turns:'][0];
$unitp = $c['Unit Production:'][0];
$armysize= ($unit1 + $unit2 + $unit3 + $unit4 + $unit5 + $unit7 + $unit8 + $unit9 + $unit10 + $unit11);

if ($info[82]== "troop7") {
        $race = '~';
    } else if ($info[82] == "troop2") {
        $race = '~~';
    } else if ($info[82] == "troop4") {
        $race = '~~~';
    } else if ($info[82] == "troop9") {
        $race = '~~~~';
    } else if ($info[82] == "troop11") {
        $race = '****';
    } else {
        $race = '????';
    }
    if ($AT <= 2500) {
        $active = 'ACTIVE';
    } else {
        $active = '';
    }
    if ($active=='ACTIVE') {
        if ($urlnum == "") {
		$urlnum = 0;
            $finish = 0;
		$$url.$urlnum="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info[16]($unitp ~ $unit6)</a>$race<br />";
        } else {
            $urlnum = $urlnum++;
            $finish = $finish++;
		$$url.$urlnum="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info[16]($unitp ~ $unit6)</a>$race<br />";
    }
} else {
if ($urlnum == "") {
		$urlnum = 0;
            $finish = 0;
		$$url.$urlnum="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info[16]($armysize ~ $unitp ~ $unit6)</a>$race<br />";
    } else {
        $urlnum = $urlnum++;
        $finish = $finish++;
        $$url.$urlnum="$race<a href=http://www.stargatewars.com/stats.php?id=$id target=_blank>$active $info[16]($armysize ~ $unitp ~ $unit6)</a>$race<br />";
}
}
?>
<html>
<head>
<title>SGWRAIDER2</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
PLEASE CLICK INSIDE OF THE SGW SPY LOG AREA AND PRESS CTRL+A THEN CTRL+C THEN CLICK IN THE
TEXT AREA BELOW WHERE IT SAYS "INSERT HERE".
<textarea rows="20" cols="20" name= "info">INSERT HERE</textarea><br />
ENTER ID: <INPUT TYPE="TEXT" name="id" value="INPUT ID HERE"><br />
<input type="submit" value="add" name="add"><input type="submit" value="submit" name="submit">
</form>
<?php
} else 
{
echo "How did you get here";
}
echo "</body>";
echo "</html>";
?>

Link to comment
Share on other sites

elseif {isset($_POST['submit'])}

 

you need parentheses, not braces:

 

elseif (isset($_POST['submit']))

 

you should really be turning error reporting on and crank the notice level if you're going to be debugging, instead of having to come here everytime:

 

ini_set('display_errors', TRUE);
error_reporting(E_ALL);

 

(at the top of your page)

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.