I think this...
PHP Code:
if($newID != $aID){
$stop = 1;
$article_title = "Error";
$article_date = date('Y-m-d');
$article_content = "This Digimon is not available for adoption. <a href='adopt.php'>Go back</a>.";
}
//Can the user afford the adoptable?
if($money < $cost){
$article_title = "Oops";
$article_date = date('Y-m-d');
$article_content = "You can't afford this Digimon.";
}
else {
//Creature is valid, let's adopt the sucker...
//Procedure for giving the user's adoptable a name
Needs to be:
PHP Code:
if($newID != $aID){
$stop = 1;
$article_title = "Error";
$article_date = date('Y-m-d');
$article_content = "This Digimon is not available for adoption. <a href='adopt.php'>Go back</a>.";
}
else {
//Creature is valid, let's adopt the sucker...
//Procedure for giving the user's adoptable a name
//Can the user afford the adoptable?
if($money < $cost){
$article_title = "Oops";
$article_date = date('Y-m-d');
$article_content = "You can't afford this Digimon.";
}
else{
// The code to actually adopt the pet goes here...
} // End the else that processes the actual adoption
So, first we check that the pet is valid. Then we check that the user has enough money to adopt. If both those are true then we adopt the pet. :)
Try that.