darkwarz823 Posted June 26, 2007 Share Posted June 26, 2007 Ok im haveing a problem with me register page if you read the code wich i have attached to this post there are errors for like if you don't fill out all fields the normal ok my problem is if you do commit an error it doesn't tell you and if you fill out the form completely and click signup it just refreshes the page as a signup action and nothing is inserted to the database and te account you tried to sign up doesn't exsiest so if you could read over the code and you see ne problems please help me out <? $need_to_login=no; $title = "Signup"; include("header.php"); ?> <form method=post action=register.php?action=signup> <table> <tr><td>Username:</td><td><input type=text name=name></td></tr> <tr><td>Email:</td><td><input type=text name=email></td></tr> <tr><td>Password:</td><td><input type=password name=pass></td></tr> <tr><td>Verify Password:</td><td><input type=password name=vpass></td></tr> <tr><td>Sex:</td><td><select name=sex><option value=Male>Male</option><option value=Female>Female</option></select></td></tr> </table> <table> <tr><td> <textarea cols=50 rows=10 readonly> Terms Of Service - Revised 1/1/06 Overview Vice Wars is a fun environment for Gamers to play on. It is a multiplayer online massive role playing game. This terms of service is here for you to read and it is a guildline of things you must follow when playing the game. The purpose of this Vice Wars Terms of Use is to inform you, as a registered user or visitor of Vice Wars, (1) of the registration process and keeping your username and password private (2) the rules of playing (3) the rules of conduct and (4) our liability. Proprietary Rights; Copyrights and Trademarks. Much of the Content available on ViceWars.com is owned by ViceWars.com or our licensors, and is protected by copyrights, trademarks, and other intellectual property rights. You shall not copy or download any Content from ViceWars.com unless we have expressly authorized you to do so. You shall not copy, transmit, modify, distribute, show in public or in private, modify or create any derivative works from the Content you find on ViceWars.com, unless it's in gameplay use from players.You may not also. Making unauthorized copies of any Content found on ViceWars.com can lead to the termination of your account(s) and may subject you to further legal action. Similarly, other content owners may take criminal or civil action against you. If this happens we are not responsible for any actions that is taken against you and therefore nothing can be taken against us. Registration To play Vice Wars, we require each user to have a unique user name and password combination in order to use the features and functions of the Site and we may, from time to time, also provide users with additional codes or passwords necessary to perform certain functions on the Site. Your user name and password are personal to you and you may not allow any others to use your user name or password under any circumstances. We are not liable for any harm caused or related to the theft or misappropriation of your user name or password, disclosure of your user name or password, or your authorization anyone else to use your user name or password. You agree to immediately notify us if you become aware of or believe there is or may have been any unauthorized use of (or activity using) your user name or password or any other need to deactivate your user name or password due to security concerns. During registration (and possibly at certain other times to enable your use of other features or functions or for security purposes), you will be required to register and provide us with certain information about you ("User Information"), in order for us to allow you to use the features and functions of the Site, including chat rooms, message boards, electronic mail services, messaging services, registration and member profile pages. We are NOT held responsible for anything that may be done to your account in the future from other players. We will however help you if any problems arises with your account at any time as long as it is true. Postings Portions of this Site provide you and other users an opportunity to submit, post, display, transmit and/or exchange information, ideas, opinions, photographs, images, creative works or other information, messages, transmissions or material to us, the Site or others ("Post" or "Postings"). In no event shall ViceWars have or be construed to have any responsibility or liability for or in connection with any Posting whatsoever that is NOT on the homepage; however, if it is on the homepage we do hold responsibility. However, in our sole discretion and judgment, that any Posting does or may violate any of the terms of this agreement, we reserve the right, at any time and without limiting any and all other rights we may have under this agreement, at law or in equity, to: (a) refuse to allow you to Post; (b) remove and delete Postings; (c) revoke your right to use the Site; and/or (d) use any technological, legal, operational or other means available to Vice Wars to enforce the provisions of this agreement, including, without limitation, blocking specific IP addresses or deactivating your registration on ViceWars.com. If you violate this by posting Foul Language or Something that may Offend another player. We have every right to do whatever we want with the post{s} or the writing in your profile etc... If you believe that any content on the Site (including, without limitation, Postings) violates any of the terms of this agreement, please Contact us about it. Points If you purchase or recieve points of any kind, we reserve the right to take them away/delete them from your account at any time, without any refund of money. Once money is recieved by us either by paypal, mail, mail-order, or any other method, you do not have the right to a refund. If points are taken away from your account, crew, or anything else in ViceWars you agree not to take any legal action against ViceWars, Kyle Piontek, or any other party affiliated with ViceWars. Once again, we reserve the right to take away/delete points at any time for any reason. Pictures We do not hold responsibility for ANY Harm done to someone by seeing Nudity on the site. We do NOT allow this and if you see any nude pictures on the site that show In appropiate graphics then please contact us. We will delete the profile picture and or contact the person about it and it could lead to them being suspended/banned. Rules of Conduct Your use of the Site is subject to all applicable local, state, national laws and regulations and, in some cases, international treaties. You are solely responsible for all activities, acts and omissions that occur in, from, through or under your user name or password. You shall not use, allow enable others to use the Site, or knowingly condone use of this Site by others, in any manner that is, attempts to, or is likely to: * affect us adversely or reflect negatively on us, the Site, our goodwill, name or reputation or cause duress, distress or discomfort to us or anyone else, or discourage any person, firm or enterprise from using all or any portion, features or functions of the Site, or from advertising, linking or becoming a supplier to us in connection with the Site; * send or result in the transmission of junk messages, or "spamming" of any of the messaging or recruiting features of the website; * be used for commercial or business purposes, including, without limitation, advertising, marketing or offering goods or services, whether or not for a charge or through linking with any other web site or web pages; * You also agree by clicking "I agree to these terms of service" that you will act accordingly and will not mistreat others and you will act appropiate on the site. Please do not use foul language or in appropiate things on the site or it could lead to Termination or Suspension of your account. Online conduct should be guided by common sense and basic etiquette. You must also obey rules for use of third party tools, and rules of interactive service providers, state, local, federal laws, or foreign or international law where appropriate. We will terminate use of ViceWars.com and cooperate with law enforcement for illegal behavior. You agree that you will be personally responsible for any programs that you make for ViceWars.com and if it leads in suspension/termination of others that we are not responsible; But infact the owner of the program is held responsible because of his/her actions to give the program out to others. Termination of Account. ViceWars.com and you both have the right to terminate or cancel your account at any time. You understand and agree that the cancellation of your account is your sole right and remedy with respect to any dispute with ViceWars.com. This includes, but is not limited to, any dispute related to, or arising out of. Membership We are not responsible for any loss that you may have while obtaining the Membership inside ViceWars.com. If at anytime you feel that the membership is not up to your standards you may cancel at anytime. Keep in mind any money lost in the membership is not our faults but will be handled accordingly. Additions In signing these terms of service you agree to any additions we add in the future that may have an effect on your account inside ViceWars.com and you at anytime have your opinions and may speak of your opinions about anything added, But you may not rebel or form any type of group against what we are doing. You also may not use any type of Slain language. Any rebelious type of manner in any situations on ViceWars or anything added may and can get you Suspended/Terminated/Banned and you agree to this. Money In any rare events that occur where your Real money is lost in ViceWars.com, ViceWars is NOT responsible. However we will do EVERYTHING in our power to look into it and try to resolve anything that may happen while playing ViceWars.com Disclaimer and Limitations of Liability THIS SITE, AND ALL MATERIALS, PRODUCTS AND POSTINGS ARE MADE AVAILABLE ON AN "AS IS" AND "AS AVAILABLE" BASIS, WITHOUT ANY REPRESENTATION OR WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, OR ANY GUARANTY OR ASSURANCE THE SITE WILL BE AVAILABLE FOR USE, OR THAT ALL PRODUCTS, FEATURES, FUNCTIONS OR OPERATIONS WILL BE AVAILABLE OR PERFORM AS DESCRIBED. YOU UNDERSTAND AND AGREE THAT, TO THE FULLEST EXTENT PERMISSIBLE BY LAW, NEITHER ViceWars or ANY OF ITS SUBSIDIARIES, AFFILIATES, ITS OR THEIR RESPECTIVE OFFICERS, DIRECTORS, EMPLOYEES, AGENTS, LICENSORS, REPRESENTATIVES OR SUPPLIERS SHALL BE LIABLE FOR ANY LOSS OR DAMAGE, OF ANY KIND, DIRECT OR INDIRECT, IN CONNECTION WITH OR ARISING FROM USE OF THE SITE OR FROM THIS AGREEMENT, INCLUDING, BUT NOT LIMITED TO, COMPENSATORY, CONSEQUENTIAL, INCIDENTAL, INDIRECT, SPECIAL OR PUNITIVE DAMAGES. Indemnification You agree to indemnify, defend and hold Kyle Piontek, ViceWars, its subsidiaries and affiliates, and their respective officers, directors, employees, agents, licensors, representatives and suppliers, harmless from and against any and all claims, actions, losses, expenses, damages and costs, resulting from any breach or violation of this agreement by you. We reserve the right to edit/change any and all data in ViceWars without any legal action taken against us. MISCELLANEOUS. You agree that these Terms of Service are not intended to confer and do not confer any rights or remedies upon any person other than the parties to this agreement. You also understand and agree that the ViceWars.com Terms of Service and the ViceWars.com Privacy Policy, including ViceWars's enforcement of those policies, are not intended to confer, and do not confer, any rights or remedies upon any person. If any part of this agreement is held invalid or unenforceable, that portion shall be construed in a manner consistent with applicable law to reflect, as nearly as possible, the original intentions of the parties, and the remaining portions shall remain in full force and effect. </textarea> <br> <select name=tos><option value=1>I Do Not Agree To The Terms Of Service</option><option value=2>I Agree To The Terms Of Service</option></select> </tr> </td> </table> <table> <tr><td colspan=2 align=center><input type=submit class=submit value=Signup></td></tr> </table> <? if ($parentid) { print " <input type=hidden name=parentid value=$parentid> <input type=hidden name=parentname value=$parentname>"; } ?> </form> <br> <? if ($action == signup) { if ($_SESSION['registered']) { print "<script language='javascript'>alert('ERROR: You have already created an account.sess');</script>"; } $ip = $REMOTE_ADDR; if (!$name || !$pass || !$email || !$vpass || !$tos) { print "<script language='javascript'>alert('ERROR: You must fill out all fields.');</script>"; include("footer.php"); exit; } $length=strlen($name); if ($length > 30) { print "ERROR: Your username must be less then 30 characters."; include("footer.php"); exit; } if ($length <= 3) { print "ERROR: Your username must be more then 3 characters."; include("footer.php"); exit; } $dupe1 = mysql_num_rows(mysql_query("select * from users where name='$name'")); if ($dupe1 > 0) { print "ERROR: Someone already has that username."; include("footer.php"); exit; } $dupe2 = mysql_num_rows(mysql_query("select * from users where email='$email'")); if ($dupe2 > 0) { print "ERROR: There is already an account using that email address."; include("footer.php"); exit; } $dupe3 = mysql_num_rows(mysql_query("select * from users where ip='$ip'")); if ($dupe3 > 1) { print "ERROR: You already have two accounts."; include("footer.php"); exit; } if ($pass != $vpass) { print "ERROR: The passwords do not match."; include("footer.php"); exit; } if ($tos != 2) { print "ERROR: You must agree to the terms of service."; include("footer.php"); exit; } $spaces=substr_count($name," "); if ($spaces >= 1) { print "ERROR: No spaces allowed in usernames."; include("footer.php"); exit; } if ($parentid) { mysql_query("insert into users (name, email, pass, sex, parentid, parentname, ip) values('$name','$email','$pass','$sex','$parentid','$parentname','$ip')")or die("Could not register."); } else { mysql_query("insert into users (name, email, pass, sex, ip) values('$name','$email','$pass','$sex','$ip')")or die("Could not register."); } print "You have successfully created your account, <b>$name</b>! You may now login to your account and start playing. "; } include("footer.php"); ?> [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
trq Posted June 26, 2007 Share Posted June 26, 2007 Sorry. Id'e say you need to go back to the drawing board on that one. Executing mutliple queries like that is just rediculous. You also have alot of undefined variables. For instance... where do all these variables get defined? $name,$pass,$email,$vpass,$tos Honestly... this is a long way from working code. I'd elike to help out but it pretty much wants rewritting. Quote Link to comment Share on other sites More sharing options...
darkwarz823 Posted June 26, 2007 Author Share Posted June 26, 2007 would this on work ne better <?$title = "Signup"; include("header.php"); ?> <form method=post action=register.php?action=signup> <table> <tr><td>Username:</td><td><input type=text name=name></td></tr> <tr><td>Email:</td><td><input type=text name=email></td></tr> <tr><td>Password:</td><td><input type=password name=pass></td></tr> <tr><td>Verify Password:</td><td><input type=password name=vpass></td></tr> <tr><td>League:</td><td><select name=league><option value=1>Eternal</option><option value=2>Competitive</option></select></td></tr> <tr><td>Sex:</td><td><select name=sex><option value=Male>Male</option><option value=Female>Female</option></select></td></tr> </table> <table> <tr><td> <textarea cols=50 rows=10> Terms Of Service Overview Vice Wars is a fun environment for Gamers to play on. It is a multiplayer online massive role playing game. This terms of service is here for you to read and it is a guildline of things you must follow when playing the game. The purpose of this Vice Wars Terms of Use is to inform you, as a registered user or visitor of Vice Wars, (1) of the registration process and keeping your username and password private (2) the rules of playing (3) the rules of conduct and (4) our liability. Proprietary Rights; Copyrights and Trademarks. Much of the Content available on ViceWars.com is owned by ViceWars.com or our licensors, and is protected by copyrights, trademarks, and other intellectual property rights. You shall not copy or download any Content from ViceWars.com unless we have expressly authorized you to do so. You shall not copy, transmit, modify, distribute, show in public or in private, modify or create any derivative works from the Content you find on ViceWars.com, unless it's in gameplay use from players.You may not also. Making unauthorized copies of any Content found on ViceWars.com can lead to the termination of your account(s) and may subject you to further legal action. Similarly, other content owners may take criminal or civil action against you. If this happens we are not responsible for any actions that is taken against you and therefore nothing can be taken against us. Registration To play Vice Wars, we require each user to have a unique user name and password combination in order to use the features and functions of the Site and we may, from time to time, also provide users with additional codes or passwords necessary to perform certain functions on the Site. Your user name and password are personal to you and you may not allow any others to use your user name or password under any circumstances. We are not liable for any harm caused or related to the theft or misappropriation of your user name or password, disclosure of your user name or password, or your authorization anyone else to use your user name or password. You agree to immediately notify us if you become aware of or believe there is or may have been any unauthorized use of (or activity using) your user name or password or any other need to deactivate your user name or password due to security concerns. During registration (and possibly at certain other times to enable your use of other features or functions or for security purposes), you will be required to register and provide us with certain information about you ("User Information"), in order for us to allow you to use the features and functions of the Site, including chat rooms, message boards, electronic mail services, messaging services, registration and member profile pages. We are NOT held responsible for anything that may be done to your account in the future from other players. We will however help you if any problems arises with your account at any time as long as it is true. Postings Portions of this Site provide you and other users an opportunity to submit, post, display, transmit and/or exchange information, ideas, opinions, photographs, images, creative works or other information, messages, transmissions or material to us, the Site or others ("Post" or "Postings"). In no event shall ViceWars have or be construed to have any responsibility or liability for or in connection with any Posting whatsoever that is NOT on the homepage; however, if it is on the homepage we do hold responsibility. However, in our sole discretion and judgment, that any Posting does or may violate any of the terms of this agreement, we reserve the right, at any time and without limiting any and all other rights we may have under this agreement, at law or in equity, to: (a) refuse to allow you to Post; (b) remove and delete Postings; (c) revoke your right to use the Site; and/or (d) use any technological, legal, operational or other means available to Vice Wars to enforce the provisions of this agreement, including, without limitation, blocking specific IP addresses or deactivating your registration on ViceWars.com. If you violate this by posting Foul Language or Something that may Offend another player. We have every right to do whatever we want with the post{s} or the writing in your profile etc... If you believe that any content on the Site (including, without limitation, Postings) violates any of the terms of this agreement, please Contact us about it. Pictures We do not hold responsibility for ANY Harm done to someone by seeing Nudity on the site. We do NOT allow this and if you see any nude pictures on the site that show In appropiate graphics then please contact us. We will delete the profile picture and or contact the person about it and it could lead to them being suspended/banned. Rules of Conduct Your use of the Site is subject to all applicable local, state, national laws and regulations and, in some cases, international treaties. You are solely responsible for all activities, acts and omissions that occur in, from, through or under your user name or password. You shall not use, allow enable others to use the Site, or knowingly condone use of this Site by others, in any manner that is, attempts to, or is likely to: * affect us adversely or reflect negatively on us, the Site, our goodwill, name or reputation or cause duress, distress or discomfort to us or anyone else, or discourage any person, firm or enterprise from using all or any portion, features or functions of the Site, or from advertising, linking or becoming a supplier to us in connection with the Site; * send or result in the transmission of junk messages, or "spamming" of any of the messaging or recruiting features of the website; * be used for commercial or business purposes, including, without limitation, advertising, marketing or offering goods or services, whether or not for a charge or through linking with any other web site or web pages; * You also agree by clicking "I agree to these terms of service" that you will act accordingly and will not mistreat others and you will act appropiate on the site. Please do not use foul language or in appropiate things on the site or it could lead to Termination or Suspension of your account. Online conduct should be guided by common sense and basic etiquette. You must also obey rules for use of third party tools, and rules of interactive service providers, state, local, federal laws, or foreign or international law where appropriate. We will terminate use of ViceWars.com and cooperate with law enforcement for illegal behavior. You agree that you will be personally responsible for any programs that you make for ViceWars.com and if it leads in suspension/termination of others that we are not responsible; But infact the owner of the program is held responsible because of his/her actions to give the program out to others. Termination of Account. ViceWars.com and you both have the right to terminate or cancel your account at any time. You understand and agree that the cancellation of your account is your sole right and remedy with respect to any dispute with ViceWars.com. This includes, but is not limited to, any dispute related to, or arising out of. Membership We are not responsible for any loss that you may have while obtaining the Membership inside ViceWars.com. If at anytime you feel that the membership is not up to your standards you may cancel at anytime. Keep in mind any money lost in the membership is not our faults but will be handled accordingly. Additions In signing these terms of service you agree to any additions we add in the future that may have an effect on your account inside ViceWars.com and you at anytime have your opinions and may speak of your opinions about anything added, But you may not rebel or form any type of group against what we are doing. You also may not use any type of Slain language. Any rebelious type of manner in any situations on ViceWars or anything added may and can get you Suspended/Terminated/Banned and you agree to this. Money In any rare events that occur where your Real money is lost in ViceWars.com, ViceWars is NOT responsible. However we will do EVERYTHING in our power to look into it and try to resolve anything that may happen while playing ViceWars.com Disclaimer and Limitations of Liability THIS SITE, AND ALL MATERIALS, PRODUCTS AND POSTINGS ARE MADE AVAILABLE ON AN "AS IS" AND "AS AVAILABLE" BASIS, WITHOUT ANY REPRESENTATION OR WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, OR ANY GUARANTY OR ASSURANCE THE SITE WILL BE AVAILABLE FOR USE, OR THAT ALL PRODUCTS, FEATURES, FUNCTIONS OR OPERATIONS WILL BE AVAILABLE OR PERFORM AS DESCRIBED. YOU UNDERSTAND AND AGREE THAT, TO THE FULLEST EXTENT PERMISSIBLE BY LAW, NEITHER ViceWars or ANY OF ITS SUBSIDIARIES, AFFILIATES, ITS OR THEIR RESPECTIVE OFFICERS, DIRECTORS, EMPLOYEES, AGENTS, LICENSORS, REPRESENTATIVES OR SUPPLIERS SHALL BE LIABLE FOR ANY LOSS OR DAMAGE, OF ANY KIND, DIRECT OR INDIRECT, IN CONNECTION WITH OR ARISING FROM USE OF THE SITE OR FROM THIS AGREEMENT, INCLUDING, BUT NOT LIMITED TO, COMPENSATORY, CONSEQUENTIAL, INCIDENTAL, INDIRECT, SPECIAL OR PUNITIVE DAMAGES. Indemnification You agree to indemnify, defend and hold ViceWars, its subsidiaries and affiliates, and their respective officers, directors, employees, agents, licensors, representatives and suppliers, harmless from and against any and all claims, actions, losses, expenses, damages and costs, resulting from any breach or violation of this agreement by you. MISCELLANEOUS. You agree that these Terms of Service are not intended to confer and do not confer any rights or remedies upon any person other than the parties to this agreement. You also understand and agree that the ViceWars.com Terms of Service and the ViceWars.com Privacy Policy, including ViceWars's enforcement of those policies, are not intended to confer, and do not confer, any rights or remedies upon any person. If any part of this agreement is held invalid or unenforceable, that portion shall be construed in a manner consistent with applicable law to reflect, as nearly as possible, the original intentions of the parties, and the remaining portions shall remain in full force and effect. </textarea> <br> <select name=tos><option value=1>I Do Not Agree To The Terms Of Service</option><option value=2>I Agree To The Terms Of Service</option></select> </tr> </td> </table> <table> <tr><td colspan=2 align=center><input type=submit class=submit value=Signup></td></tr> </table> </form> <br> <? if ($action == signup) { if (!$name || !$pass || !$email || !$vpass || !$league || !$tos) { print "ERROR: You must fill out all fields."; include("footer.php"); exit; } $dupe1 = mysql_num_rows(mysql_query("select * from users where name='$name'")); if ($dupe1 > 0) { print "ERROR: Someone already has that username."; include("footer.php"); exit; } $dupe2 = mysql_num_rows(mysql_query("select * from users where email='$email'")); if ($dupe2 > 0) { print "ERROR: There is already an account using that email address."; include("footer.php"); exit; } if ($pass != $vpass) { print "ERROR: The passwords do not match."; include("footer.php"); exit; } if ($tos != 2) { print "ERROR: You must agree to the terms of service."; include("footer.php"); exit; } if ($league >=3 or $league <= 0){ print "ERROR: You must pick a valid league."; include("footer.php"); exit; } mysql_query("insert into users (name, email, pass, league, sex) values('$name','$email','$pass','$league','$sex')")or die("Could not register."); print "You have successfully created your account, <b>$name</b>! You may now login to your account and start playing. "; } include("footer.php"); ?> 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.