criminal wars Posted April 24, 2011 Share Posted April 24, 2011 basically on register.php file there is some where, that you can pick a gender male or female so i have made a new drop down menu where it say's starter gift and the 2 options you can pick is 10 crystal's $500 game cash these are 2 gifts you can pick when signing up but i need to put a coding in the file to make it work if anyone can give em a hand .... Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted April 24, 2011 Share Posted April 24, 2011 I dont understand how you find this difficult. The code is already there. Just add to the query for adding the user, password etc. Quote Link to comment Share on other sites More sharing options...
Danny696 Posted April 24, 2011 Share Posted April 24, 2011 Surley after nick telling you exacally what you need to do, you would be able to do it. You cant even follow instructions Not a drop down menu, he said a radiogroup. Its a simple if statement. Then edit the insert query on register. Simple really. Surley if your going to own a game you should either know how to code, have an in-house coder, or pay someone to do the work, and not just scav of other peoples good will. Mabey these sites will help: Site One and Site Two 1 Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted April 24, 2011 Share Posted April 24, 2011 Hahaha scav rated you up for that one Danny Quote Link to comment Share on other sites More sharing options...
criminal wars Posted April 24, 2011 Author Share Posted April 24, 2011 please am nooby can you just code it for me.. Quote Link to comment Share on other sites More sharing options...
Danny696 Posted April 24, 2011 Share Posted April 24, 2011 Become unn00by and learn how t code, its VERY basic stuff your asking for.. And thanks Ruler :) Quote Link to comment Share on other sites More sharing options...
criminal wars Posted April 24, 2011 Author Share Posted April 24, 2011 i cant reall find the if statement of gender on my file oitherwise i can do it Quote Link to comment Share on other sites More sharing options...
criminal wars Posted April 24, 2011 Author Share Posted April 24, 2011 can you gie me and axample of the coding thats need done Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted April 24, 2011 Share Posted April 24, 2011 google php forms and then follow what danny posted below. cant believe you got told how to do this and still came asking Quote Link to comment Share on other sites More sharing options...
Danny696 Posted April 24, 2011 Share Posted April 24, 2011 Wow, thats actually genis. if(blahh == ljdhs) { do this } else { do this } then edit the query ;) Quote Link to comment Share on other sites More sharing options...
criminal wars Posted April 24, 2011 Author Share Posted April 24, 2011 Ok im really noobie at this little dont know why i cant figure this out and everything else i can do i've tried everything the only thing am stuc at is for it to be credied i added the radio group and now i need the post or if statement for it to credit them... Quote Link to comment Share on other sites More sharing options...
Dominion Posted April 24, 2011 Share Posted April 24, 2011 Show what you have... Quote Link to comment Share on other sites More sharing options...
criminal wars Posted April 24, 2011 Author Share Posted April 24, 2011 (edited) <td width='30%'>Username</td> <td width='40%'><input type=text class="other" size="12" name=username onkeyup='CheckUsername(this.value);'></td> <td width='30%'><div id='usernameresult'></div></td> <tr> <td>Password</td> <td><input type=password id='pw1' class="other" size="12" name=password onkeyup='CheckPasswords(this.value);PasswordMatch();'></td> <td><div id='passwordresult'></div></td> </tr> <tr> <tr> <td>Confirm Password</td><td><input type=password class="other" size="12" name=cpassword id='pw2' onkeyup='PasswordMatch();'></td> <td><div id='cpasswordresult'></div></td> </tr> <tr> <td>Email</td><td><input type=text class="other" size="12" name=email onkeyup='CheckEmail(this.value);'></td> <td><div id='emailresult'></div></td> </tr> <tr> <td>Gender</td> <td colspan='2'><select name='gender' type='dropdown'> <option value='Male'>Male <option value='Female'>Female</select></td> </tr> <tr> <td>Starter Gift:</td> <td><input type="radio" name="group1" value="10c"> 10 crystal's<br> <input type="radio" name="group1" value="500cash" checked> $500 cash</td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2" style="width: 150px;"> </td> </tr> <tr> <td style="width: 100px;"> </td> <td><input class="nor_but" type="submit" name="submit" value="" /></td> </tr> </table> <center><a href='login.php'><u>Return to Login</u></a></center><br /> </form> </center> <!-- Begin Main Content --> EOF; $IP = $_SERVER['REMOTE_ADDR']; $IP=addslashes($IP); $IP=mysql_real_escape_string($IP); $IP=strip_tags($IP); if(file_exists('ipbans/'.$IP)) { die("<b><font color=red size=+1>Your IP has been banned, there is no way around this.</font></b></body></html>"); } if($_POST['username']) { if($set['regcap_on']) { if(!$_SESSION['captcha'] or $_SESSION['captcha'] != $_POST['captcha']) { unset($_SESSION['captcha']); die("<font style=color:red> Captcha Test Failed</font><br /> <a href='register.php'>>Back<</a>"); } unset($_SESSION['captcha']); } if(!valid_email($_POST['email'])) { die("<font style=color:red>Sorry, the email is invalid.</font><br /> <a href='register.php'>>Back<</a>"); } if(strlen($_POST['username']) < 4) { die("<font style=color:red>Sorry, the username is too short.</font><br /> <a href='register.php'>>Back<</a>"); } $sm=100; if($_POST['promo'] == "") { $sm+=0; } $username=$_POST['username']; $username=str_replace(array("<", ">"), array("<", ">"), $username); $q=$db->query("SELECT * FROM users WHERE username='{$username}' OR login_name='{$username}'"); $q2=$db->query("SELECT * FROM users WHERE email='{$_POST['email']}'"); if($db->num_rows($q)) { print "<font style=color:red>Username already in use. Choose another.</font><br /> <a href='register.php'>>Back<</a>"; } else if($db->num_rows($q2)) { print "<font style=color:red>E-Mail already in use. Choose another.</font><br /> <a href='register.php'>>Back<</a>"; } else if($_POST['password'] != $_POST['cpassword']) { print "<font style=color:red>The passwords did not match, go back and try again.</font><br /> <a href='register.php'>>Back<</a>"; } else { if($db->num_rows($q)) { die("<font style=color:red>No creating referral multies. Bad dog.</font><br /> <a href='register.php'>>Back<</a>"); } This is all you now can you check it out for me and fix what am talking about as you will see the gift are there but need the if states ment etc.. done for it to work Edited April 24, 2011 by Dave Macaulay Code tags added. Quote Link to comment Share on other sites More sharing options...
Dominion Posted April 24, 2011 Share Posted April 24, 2011 (edited) I have not looked, but I take your word for it; that you have given it a go. As said, set variables for amount of money/crystals you start with based on what the user selected. Basic if() if ($_POST['bonus'] == 'cash') { $money = 500; $crystals = 10; } else { $money = 200; $crystals = 50; } As you said you have the button (not looked, but I take your word for it) All you need to really do at this point is make sure the insert query has the variables in it. How variables work in an insert is easy, the example is right there in the query you now need to edit, since username, password etc are all variables. Edited April 24, 2011 by Dominion Quote Link to comment Share on other sites More sharing options...
scorpiic venom Posted April 25, 2011 Share Posted April 25, 2011 you are asking for easy stuff how you going to go run a game if you cant do this stuff try this if ($_POST['group1']=='10c') { $db->query("UPDATE `users` SET `crystals`=`crystals`+10 WHERE `userid`=".$i); } else { $db->query("UPDATE `users` SET `money`=`money`+500 WHERE `userid`=".$i); } not working? then try this if ($_POST['group1']=='10c') { $db->query("UPDATE users SET crystals=crystals+10 WHERE userid=".$i); } else { $db->query("UPDATE users SET money=money+500 WHERE userid=".$i); } Quote Link to comment Share on other sites More sharing options...
Danny696 Posted April 25, 2011 Share Posted April 25, 2011 Sorry, the first one is actually correct, the later is just a n00bs way..... you are asking for easy stuff how you going to go run a game if you cant do this stuff try this surele then that means you wont be able to run a game, as $i isnt defined, as the user hasnt been created yet. Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted April 25, 2011 Share Posted April 25, 2011 ok why does this look hard for you to do? You already have female and male option why not copy that part and change it to crystals or money and Insert the query? im surprised at the fact you know how to make a drop-down lol. Quote Link to comment Share on other sites More sharing options...
Dominion Posted April 25, 2011 Share Posted April 25, 2011 you are asking for easy stuff how you going to go run a game if you cant do this stuff try this if ($_POST['group1']=='10c') { $db->query("UPDATE `users` SET `crystals`=`crystals`+10 WHERE `userid`=".$i); } else { $db->query("UPDATE `users` SET `money`=`money`+500 WHERE `userid`=".$i); } not working? then try this if ($_POST['group1']=='10c') { $db->query("UPDATE users SET crystals=crystals+10 WHERE userid=".$i); } else { $db->query("UPDATE users SET money=money+500 WHERE userid=".$i); } Why have extra queries when you can just edit the insert already being done? That, and what Danny said about $i ... Quote Link to comment 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.