Jump to content

Mythic Fr0st

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Mythic Fr0st's Achievements

Member

Member (2/5)

0

Reputation

  1. Im trying to see if username is in that "one" row, should I use that code?
  2. Thats what im trying to do, just check if "any" of them in that row are matching the data in $user I can do what boo_lolly said (PS Thanks for the code boo_lolly) easily enough, but its quite large lol, I dont wanna have alot of those in my code
  3. Thanks, but not quite what I meant I mean, like I wanna check if the data in $user, is in the database, so you can't signup with someone elses name / Email address How do I do that? E.G if ($user = any data from the row "user" So Like For ($i = 0; $i < number of registered users in my db; $i++) { if ($user == $row.1.['user']; } I wanna check to make sure $user has not been used
  4. This stores all my info into those variables, however I need to loop through my database, and check if there is any info in "user" that matches the entered username (to signup)... if ($user == $row['user']) will return the first bit of information stored in my row 'user', wont it? if so how do I return ALL of it, and could you give me an example please, thanks in advance <?php //req files require("C:\Program Files\EasyPHP1-8\www\Main Files\Require Files\Notice.php"); require("C:\Program Files\EasyPHP1-8\www\Main Files\Require Files\Banner.php"); require("C:\Program Files\EasyPHP1-8\www\Main Files\Require Files\mysqlconnect.php"); require("C:\Program Files\EasyPHP1-8\www\Main Files\Require Files\buttons.css"); //begin login check $user = $_POST['user']; $pw1 = $_POST['pw1']; $pw2 = $_POST['pw2']; $em1 = $_POST['em1']; $em2 = $_POST['em2']; $hph = $_POST['hph']; $mph = $_POST['mph']; $loc = $_POST['locn']; $postcode = $_POST['pc']; $heard = $_POST['heard']; $con = $_POST['con']; $city = $_POST['city']; $result = mysql_query("SELECT * FROM `signup`")or die(return_error (__FILE__,__LINE__,mysql_error())); $row = mysql_fetch_array($result); //add Where $id = 'id' $ident = array(); if ($user == mysql_query("INSERT INTO signup(`user`,`pw1`,`pw2`) VALUES('$user','$pw1','$pw2')")or die (return_error(__FILE__,__LINE__,mysql_error())); ?> <html> <head> <title> Girl Cafe </title> </head> <body bgcolor="pink"> </body> </html>
  5. using them in terms of $_POST from a forum, when I use isset() it acts like it can't see the variable, like it doesn't exist, as isset returns false, therefore, I disable them lol... Thanks
  6. I wanna disable the notices im getting, how can I do this its something to do with E_NOTICE blah something Im not sure, I dont quite remember
  7. Thanks guys, I'll look into that trigger error() a bit later... it works great ~ spfoonnewb
  8. I want to use _LINE_ to get the line of an error.. I get the error Notice: Use of undefined constant _LINE_ - assumed '_LINE_' in C:\Program Files\EasyPHP1-8\www\Main Files\Require Files\mysqlconnect.php on line 7 CODE: <?php $con = mysql_connect("localhost", "cheryl", "bubby"); if (!$con) { die('An error has occured, please retry in 30 minutes ['.mysql_error().']'); } mysql_select_db('an') or die("mysqlconnect "._LINE_); ?> I want it to die, then give me the line of the error... but it just gives errors\ So can anyone tell me how do I use it correctly? also im not sure if die() is the right command im using? is it?
  9. and thanks G_F_D How come I cant edit posts, am I missing the option somewhere or something?
  10. Techniquely play, I got it working, then somehow it got messed up... and my game is text based RPG and im going fine with it ^_^, forms are just a pain
  11. Well... sorry to double post [code] if (isset($_POST['username']))     {     $username = $_POST['username'];     if (strlen($username) < 5)         {         $bool[1]=false;         echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Your username must be no less then 5 characters long.<br /></i></font>';         }     }[/code] is the code I used on username, and it just stopped appearing all together... also check out the problem at www.mythicaeons.com go to signup, and then click the "SIGNUP" button on the page, you'll see
  12. well, the code I had didnt work... error_reporting = E_ALL & ~E_NOTICE How do I log the NOTICES?
  13. hmm But if I do $username = $_POST['username'] I get the error "Undefined index 'username'" and, if I also had the problem doing it like this if (isset($_POST['username']))     {     $username=$_POST['username'];     } still was always less than 5, but thanks I see why thats happen, any idea's how to fix it
  14. Currently, my "Mailed" function, which when you sign up, checks if your username, is less than 5, if it is, it sets a boolean to false, and at the end I have if (Bool[1] && Bool[2] == true) and so on... so it wont go through, IF... that doesn't check out properly... However... the only 3 out of 6, that show up are Username is too short Password too short Confirm Password too short BUT, even if they're 5 characters or more, it still shows! it should be Username is too short Password is too short Confirm Password is too short Passwords do not match Emails do not match Terms and Conditions box has not been ticked if anyone can tell me why this is happening, I'll greatly appreciate it... Considering some how it just stopped working (was working before O_O, and i didnt change anything I dont think!) CODE: [code]<?php session_start(); ?> <html> <head> <style type="text/css"> body { background-image: url('SilverBG.jpg') } </style> </head> <DIV STYLE='Position: absolute; top: 0; left: 0;'> <!--<img src="Mythic Aeons Banner.jpg" width="1024" height="112">--> </div> <body> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <?php //<!-- $username = ""; $pw1 = ""; $pw = ""; $bool[1]=true; $bool[2]=true; $bool[3]=true; // the booleans $bool[4]=true; $bool[5]=true; $bool[6]=true; function noerror()     {     $var131='<div style=\'Position: absolute; top: 104; left: 0;\'>     <a href="Home.php"><img src="Home Button.gif" style="border: 0px;"></a>     </div>     <div style=\'Position: absolute; top: 144; left: 0;\'>     <img src="BlackButton.gif" width="130" height="35">     </div>     <div style=\'Position: absolute; top: 177; left: 0;\'>     <a href="Story.php"><img src="Story Button.gif" style="border: 0px;"></a>     </div>     <div style=\'Position: absolute; top: 217; left: 0;\'>     <img src="BlackButton.gif" width="130" height="35">     </div>     <div style=\'Position: absolute; top: 250; left: 0;\'>     <a href="Signup.php"><img src="Signup Button.gif" style="border: 0px;"></a>     </div>     <div style=\'Position: absolute; top: 290; left: 0;\'>     <img src="BlackButton.gif" width="130" height="35">     </div>     <div style=\'Position: absolute; top: 323; left: 0;\'>     <a href=""><img src="Forum Button.gif" style="border: 0px;"></a>     </div>     <div style=\'Position: absolute; top: 363; left: 0;\'>     <img src="BlackButton.gif" width="130" height="35">     </div>     <div style=\'Position: absolute; top: 397; left: 0;\'>     <a href="contact us.php"><img src="contact us.gif" style="border: 0px;"></a>     </div>     <div style=\'Position: absolute; top: 437; left: 0;\'>     <img src="BlackButton.gif" width="130" height="35">     </div>     <div style=\'Position: absolute; top: 470; left: 0;\'>     <a href=""><img src="membership button.gif" width=\'130\' style="border: 0px;"></a>     </div>';     echo $var131;     } $st='</div> <div align=\'center\'>'; echo $st; $username = (isset($_POST['username'])); $pw1 = (isset($_POST['password1'])); $pw2 = (isset($_POST['password2'])); $em1 = (isset($_POST['email1'])); // the emails, usernames, passwords, and if t&c (terms and conditions) $em2 = (isset($_POST['email2']));// box was checked $tc=(isset($_POST['t&c'])); if (strlen($username) < 5)     {     $bool[1]=false;     echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Your username must be no less then 5 characters long.<br /></i></font>';     } if (strlen($pw1) < 5)     {     $bool[2]=false;     echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Your password must be no less then 5 characters long.<br /></i></font>';     } if (strlen($pw2) < 5)     {     $bool[3]=false;     echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Your confirm password must be no less then 5 characters long.<br /></i></font>';     } if ($em1!==$em2)     {     echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Your e-mail\'s do not match.<br /></i></font>';     $bool[4]=false;     } if ($pw1 !== $pw2)     {     echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Your passwords do not match.<br /></i></font>';     $bool[5]=false;     } if ($tc == "on")     {     echo '<font color="blue" size="4">Error:</font><font color="blue" size="3"><i> Please check the terms & conditions box.<br /></i></font>';     $bool[6]=false;     } $i=0; for ( $i = 1; $i < 7; $i++)     {     if (!$bool[$i])         {         $i=20;         $var2="<div align='center'><input type='button' value='Return' onClick='history.go(-1)'></div>";         echo $var2;         }     } if ($bool[1] == true && $bool[2] == true && $bool[3] == true && $bool[4] == true && $bool[5] == true && $bool[6] == true)     {     $con=mysql_connect("localhost","mythicae_MythicA","rainmaker");     if (!$con)         {         die("Poo ".mysql_error());         }     $username=(isset($_POST['username']));     $password1=(isset($_POST['password1']));     $email1=(isset($_POST['email1']));     mysql_select_db("mythicae_chars", $con)or die("Mailed ".mysql_error());     mysql_query("INSERT INTO `users` SET     `username` = '$username',     `userpass` = '$password1',     `email` = '$email1'");     $inv = array("Iron Dagger", "Ignite");     $inv=serialize($inv);     $tcn=$username;     mysql_query("INSERT INTO chars SET     `mlvl` = 1,     `charname` = '$tcn',     `strlvl` = 1,     `strdmg` = 0,     `strxp` = 0,     `strdiv` = 1,     `dexlvl` = 1,     `dexcth` = 0,     `dexxp` = 0,     `dexdiv` = 1,     `currlife` = 20,     `maxlife` = 20,     `deflvl` = 1,     `defxp` = 0,     `defda` = 0,     `defdiv` = 1,     `intlvl` = 1,     `intxp` = 0,     `intdiv` = 1,     `foclvl` = 1,     `focxp` = 0,     `focdiv` = 1,     `mag` = 10,     `weapon` = 'Iron Dagger',     `spell` = 'Ignite',     `gold` = 0,     `bankedgold` = 10,     `phd` = 0,     `sa` = 1,     `tstr` = 1,     `tdex` = 0,     `tdef` = 0,     `tint` = 0,     `tfoc` = 0,     `currmonster` = 0,     `magmax` = 10,     `helm` = 'None',     `bp` = 'None',     `lp` = 'None',     `shield` = 'None',     `boots` = 'None',     `amulet` = 'None',     `ring` = 'None',     `misc` = 'None',     `wdmg` = 0,     `vert` = 0,     `horz` = 0,     `currtown` = 'Open Plains',     `inv` = '$inv'     `equipment` = 0,     `wisq` = 0,     `belt` = 'None',     `currlifemon` = 0,     `currmaxlifemon` = 0,     `dse` = 0,     `lastfight` 0");     $msg='<font color="darkred" size="4">Welcome to Mythic Aeons</font>';     $subject='Activation Code';     $from='[email protected]';     $headers='From: '.$from;     mail($email1,$subject,$msg,$headers);     mysql_close($con);     } //--> /*noerror(); echo "<font color='blue' size='4'>Welcome to Mythic Aeons <br /></b><i>Please go to your e-mail and follow the instructions on the e-mail to activate your account</i></font>"; $var47="<div align='center'><input type='button' value='Continue to login' onClick=\"location='Home.php'\"></div>"; echo $var47;*/ ?> </div> </div> </body> </html>[/code] Thanks
  15. What? when I have 2 submit buttons, they BOTH do the same action, it doesn't work
×
×
  • 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.