Jump to content

PHP breeding game help with some CALCULATIONS ???


Recommended Posts

OKAY, so i just joined this forum and i like it .

heres my question:

 

okay i am building a breeding game for ball pythons and i need help with the breed procces.

heres what i got so far-

----source code ---

// if someone decided to breed

if(isset($_POST['breed'])&&($_GET['breed_key'])&&($_POST['b_key'])){

// check if a male was specifed

$errors = array();

if(!isset($_POST['male'])){ $errors[] = "You Must Select A male to breed!" ;}

//check if a female was speciefied

if(!isset($_POST['female'])){ $errors[] = "You Must Select A female to breed!" ;}

// her we go !

// store our name into varibles!

$male = $_POST['male'];

$female = $_POST['female'];

 

STOP :confused:

my post data comes from data stored on my mysql database/ looped out into a select menu like this:

<select>

<option value= "<?

$_row['gene'] ex. rec/co/dom ... etc etc and the trait it is ex. albino

?>

"

</select>

my post data value would come to my next page looking like this:

ex.  albino

now the following slash separates genes the snake carries

or ex. albino /(gene)- pied ......

now i am exploding my post data like so:

// explode the male  name so we can see if its het for anything

$atribute = explode("/",$male);

wich should give me

co / pastel / wat ever its het for ex. albino / clown /

:wtf:

how can i get the gene backgorund  (co) by itself to input it into a if statement

how can i get the morph  ( pastel ) by itself to input it into a if statement

how can i get the hets..  ( albino etc.etc.) by itself to input it into a if statement

and check how many traits the snake is het for 1,2,3 ex. ex. it would help if someone was a reptile breeder or had a clue about ball python then this would be a peace of cake to you

 

please help if you can online all night !

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.