Cranavvo badgshop dosen't load quiet right..

Sniz

New Member
Jun 25, 2012
13
0
Im getting this error.
Code:
Notice: Undefined index: error in C:\xampp\htdocs\badgeshop\assets\errors.php on line 3
 
Notice: Undefined index: addcode in C:\xampp\htdocs\badgeshop\assets\adpro.php on line 13
 
Notice: Undefined index: addprice in C:\xampp\htdocs\badgeshop\assets\adpro.php on line 14
 
Notice: Undefined index: addname in C:\xampp\htdocs\badgeshop\assets\adpro.php on line 15
 
Notice: Undefined index: addsubmit in C:\xampp\htdocs\badgeshop\assets\adpro.php on line 16
 
Notice: Undefined index: badgecode in C:\xampp\htdocs\badgeshop\assets\adpro.php on line 18
 
Notice: Undefined index: remsubmit in C:\xampp\htdocs\badgeshop\assets\adpro.php on line 19

Here is my adpro.php and errors.php.

Adpro.php
PHP:
<?PHP
// ADPRO :o means admin process, cba doing seperate files
// meh :) ME GUSTA
 
//add and remove
 
if($rank<5){
 
 
 
}
else
$a_badgecode = mysql_real_escape_string(strtoupper($_POST['addcode']));
$a_price = mysql_real_escape_string($_POST['addprice']);
$a_name = mysql_real_escape_string($_POST['addname']);
$a_submit = mysql_real_escape_string($_POST['addsubmit']);
 
$r_badgecode = mysql_real_escape_string(strtoupper($_POST['badgecode']));
$r_submit = mysql_real_escape_string($_POST['remsubmit']);
 
// REMOVE
 
if($r_submit){
$r = mysql_query("SELECT * FROM badgeshop WHERE badgecode='{$r_badgecode}'");
$exist = mysql_num_rows($r);
 
if($r_badgecode){
 
if($exist!=0){
 
    $done = mysql_query("DELETE FROM badgeshop WHERE badgecode='{$r_badgecode}'");
    if($done){
 
        header("Location: index.php?error=15");
        mysql_close($server);
        die();
 
    }
    else
    header("Location: index.php?error=2");
    mysql_close($server);
    die();
 
}
else
header("Location: index.php?error=1");
mysql_close($server);
die();
 
}
else
header("Location: index.php?error=6");
mysql_close($server);
die();
 
}
 
 
 
// ADD
 
if($a_submit){
 
$a = mysql_query("SELECT * FROM badgeshop WHERE badgecode='{$badgecode}'");
 
 
if($a_name&&$a_price&&$a_badgecode){
 
if(strlen($a_name)>25){ header("Location: index.php?error=7"); mysql_close($server); die(); }
else
if(strlen($a_price)>9){ header("Location: index.php?error=8"); mysql_close($server); die(); }
else
$exist = mysql_num_rows($a);
if($exist!=1){
 
$addbadge = mysql_query("INSERT INTO badgeshop(id, badgecode, price, badgename) VALUES(NULL , '{$a_badgecode}', '{$a_price}', '{$a_name}')");
 
if($addbadge){
 
header("Location: index.php?error=11");
mysql_close($server);
die();
 
}
else
header("Location: index.php?error=2");
mysql_close($server);
die();
 
 
}
else
header("Location: index.php?error=9");
mysql_close($server);
die();
 
}
else
header("Location: index.php?error=6");
mysql_close($server);
die();
 
}
 
?>
Errors.php
PHP:
<?PHP
 
$error = mysql_real_escape_string($_GET['error']);
 
// *ERRORS*
//1 Badge doesn't exist, which is odd this error will only appear if the user attempts to type it in the url thing blahblahblah
//2 a query failed, oh the joy!
//3 bro, get some credits....
// *SUCCESS*
//1 Operational successfully :)
 
if($error==1){
 
echo "<div id='alert'>The badge doesn't exist!</div>";
 
}
 
if($error==2){
 
echo "<div id='error'>The operation was not successfull. Please contact a system administrator.</div>";
 
}
 
if($error==3){
 
echo "<div id='alert'>It appears you have insufficient funds!</div>";
 
 
}
 
if($error==4){
 
echo "<div id='error'>You already have that badge!</div>";
 
 
}
 
if($error==5){
 
echo "<div id='success'>You've successfully bought the badge!</div>";
 
}
 
if($error==6){
 
echo "<div id='alert'>You didn't enter <b>ALL</b> fields!</div>";
 
 
}
 
if($error==7){
 
echo "<div id='alert'>The name is too big!</div>";
 
 
}
if($error==8){
 
echo "<div id='alert'>Cranavvo says <b>NO</b> to the 9 digit number!</div>";
 
 
}
if($error==9){
 
echo "<div id='alert'>The badge is already on sale!</div>";
 
 
}
if($error==10){
 
echo "<div id='alert'>It appears you already have that badge!</div>";
 
 
}
if($error==11){
 
echo "<div id='success'>You've successfully added the badge!</div>";
 
 
}
if($error==12){
 
echo "<div id='success'>The request was successfully sent!</div>";
 
 
}
if($error==13){
 
echo "<div id='alert'>The badgecode is too big!</div>";
 
 
}
if($error==14){
 
echo "<div id='alert'>The badge requests have reached its limit and your request was not sent!</div>";
 
 
}
if($error==15){
 
echo "<div id='success'>The badge has been successfully removed!</div>";
 
 
}
 
?>

I saw some other thread about this but it didn't look like it was solved..

And if anybody could help me with my news system too it would be amazing.
How do i remove the {newsTitle} thing, and how do i get the news box in the right side of the layout just besides the scroll bar?
 

Users who are viewing this thread

Top