View Single Post
  #4  
Old 03-26-2009, 03:23 PM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,779
BMR777 is on a distinguished road
Default RE: How to "buy" adoptables?

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.
Reply With Quote