YoungNate_Black_coder Posted June 19, 2011 Share Posted June 19, 2011 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 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 / 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 ! Quote Link to comment https://forums.phpfreaks.com/topic/239766-php-breeding-game-help-with-some-calculations/ Share on other sites More sharing options...
trq Posted June 19, 2011 Share Posted June 19, 2011 Please, we have tags for use when posting code, please use them. Quote Link to comment https://forums.phpfreaks.com/topic/239766-php-breeding-game-help-with-some-calculations/#findComment-1231699 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.