Jump to content

interpim

Members
  • Posts

    303
  • Joined

  • Last visited

    Never

Everything posted by interpim

  1. Here is my changed code... still outputting a blank page. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); include('config.php'); include('includes/functions.php'); $user=$_POST['username']; $pword=$_POST['password']; $pword2=$_POST['password2']; $email=$_POST['email']; if (empty($user) || empty($pword) || empty($email)) { header("Location: register.php?err=1"); exit(); } mysql_connect($server,$username,$password); mysql_select_db($database) or die("unable to select database"); $query="SELECT * FROM main WHERE user_name='$user'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); if ($num!=0) { echo "That username has already been taken, please try again<br> <a href='register.php'>Register</a>"; exit(); } elseif ($pword!=$pword2) { echo "The supplied passwords you gave do not match<br><a href='register.php'>Try Again</a><br>"; exit(); } mysql_connect($server,$username,$password); mysql_select_db($database) or die("unable to select database"); $af=0; $query = "INSERT INTO main VALUES('','$user','$pword','','','','','','','','','','','','$af','','$code','','','','','','','$email','','','')"; mysql_query($query); mysql_close(); setcookie("user","$user"); setcookie("loggedin","true",time()+(86400*5)); $code=code_gen(); $reg_sub="Ambassade Game Registration confirmation email"; $reg_body="Thank you for registering for Ambassade... before you can log in, you must confirm your email by entering the following code on our website./n/n/n/n $code /n/n/n/n Thank you again, /n/n Team Ambassade."; mail($email,$reg_sub,$reg_body); echo "Thank you for registering... you will shortly receive an email with a confirmation code<br>"; echo "<a href="members.php">Go there now</a></br>"; ?>
  2. in a form, use password for type instead of text.
  3. ok... removed the @'s and put that code you posted at the top... I still get a blank page back.
  4. I created a registration script, and had it working fine... I wanted to add a email verification to this, basically creating a random code, emailing it, and having the user input this random code before the account could be validated... Well, now the script outputs nothing I've checked the random script code, and it works here is a link of just the random code generator function in action http://interpim.com/ambassade/testfunction.php the registration code is <?php include('config.php'); include('includes/functions.php'); $user=$_POST['username']; $pword=$_POST['password']; $pword2=$_POST['password2']; $email=$_POST['email']; if (empty($user) || empty($pword) || empty($email)) { header("Location: register.php?err=1"); exit(); } mysql_connect($server,$username,$password); @mysql_select_db($database) or die("unable to select database"); $query="SELECT * FROM main WHERE user_name='$user'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); if ($num!=0) { echo "That username has already been taken, please try again<br> <a href='register.php'>Register</a>"; } elseif ($pword!=$pword2) { echo "The supplied passwords you gave do not match<br><a href='register.php'>Try Again</a><br>"; exit(); } mysql_connect($server,$username,$password); @mysql_select_db($database) or die("unable to select database"); $af=0; $query = "INSERT INTO main VALUES('','$user','$pword','','','','','','','','','','','','$af','','$code','','','','','','','$email','','','')"; mysql_query($query); mysql_close(); setcookie("user","$user"); setcookie("loggedin","true",time()+(86400*5)); $code=code_gen(); $reg_sub="Ambassade Game Registration confirmation email"; $reg_body="Thank you for registering for Ambassade... before you can log in, you must confirm your email by entering the following code on our website./n/n/n/n$code/n/n/n/n Thank you again,/n/nTeam Ambassade."; mail($email,$reg_sub,$reg_body); echo "Thank you for registering... you will shortly receive an email with a confirmation code<br>"; echo "<a href="members.php">Go there now</a></br>"; ?> anyone help me figure otu what I did wrong?
  5. well... my lawn could use a mow too... how about it Redarrow?
  6. I think what Redarrow is suggesting is, to write a script you think will work, be it off of a tutorial or someone else's validation script... then if you are having problems with that post back here with the symptoms you are having with that script and any errors it may be giving you. Then we can go through and help you fix that code. Everyone here can use google just the same as you, except we want you to try.
  7. where you have echo "Login succesful"; echo a link, or use a header to automatically redirect the user to another page... such as header("Location :members.php"); or echo "<a href='members.php'>Member's Page</a>";
  8. Not sure where to post this, but if it's in the wrong spot please let me know... I want to set up a local email server for my laptop, I go on trips constantly for work, and don't always have internet access to test my scripts on. I have WAMP server installed and is good for testing those scripts, but I want to install a test email server to test if my email functions are working correctly... does anyone have a link to an email server that is good for this type work?
  9. session or cookie variables... just load them on the pages you want to know the info...
  10. lol you need to close out the else statement on line 180 now... keep going, read the error outputs, then figure it out as you go.
  11. <? if(isset($HTTP_COOKIE_VARS["users_resolution"])) $screen_resolution = $HTTP_COOKIE_VARS["users_resolution"]; else //means cookie is not found set it using Javascript { ?> <script language="javascript"> <!-- writeCookie(); function writeCookie() { var today = new Date(); var the_date = new Date("December 31, 2010"); var the_cookie_date = the_date.toGMTString(); var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height; var the_cookie = the_cookie + ";expires=" + the_cookie_date; document.cookie=the_cookie location = 'show-user-screen-resolution-php.php.php'; } //--> </script> <? } ?>
  12. html can be in same file as php... not the other way around... just remember to open/close your php before you start writing html or echo the html to the output. but php files need to be ran with a .php extension
  13. http://www.phpfreaks.com/forums/index.php/board,58.0.html
  14. use single quotes instead of double quotes when you are echoing html
  15. change <form ="lab_1d.php" method="post"> to this <form action="lab_1d.php" method="post">
  16. if(isset($_POST['input'])) { $input=$_POST['input']; $myFile = "testFile.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "$input \n"; fwrite($fh, $stringData); fclose($fh); }
  17. just create a test script to echo curent server time and base it according to that
  18. whatever the script output page is... right click, view source... that is your html output
  19. Hello all, I just wanted to ask what you guys used for getting custom graphics onto your sites etc... I am working on a game, mainly to learn on, but I want to incorporate some graphics into this game, to kill the monotony of plain text. I refuse to re-use someone else's artwork since A. im not a thief, and B. I don't wanna pay LOL... I am a fairly good artist, but only with pen and paper. Drawing on the computer with a mouse is damn near impossible. If anyone knows a good way to get a decent digital copy of artwork into my computer from my paper pad, that would be excellent if you could clue me in... Or tell me a way to actually draw on the computer without making it look like a 5 year old got ahold of a box of crayons and went to town.
  20. count rows of db first... set up a while loop to write until the number of rows is reached, such as $i=0; while($i<$num_rows){ write row with radio button value=$i; $i++; }
×
×
  • 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.