Jump to content

MrKaraokeSteve

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MrKaraokeSteve's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I apologize, I submitted that too soon.. I got that from my apache error_log.. I keep getting a 500 error evertime I log in with my login script!
  2. the link has the correct confirmnumber thats in the table. if that is what you are asking
  3. yes.. everything is correct. but I dont think its checking the database to make sure the confirmnumber is the same as in the db, but I am not sure!
  4. okay I made that correction that you suggested.. This is the error I am getting on the website: The confirmation number does not match the username you are trying to use!!!
  5. I am working on a karaoke website, that is based on review system and a rating system. currently I am stuck on the registration section of the website. What I am doing is allowing people to register, what they will do is fill out the form, and then it will email them an email with the username/password along with a link to click . The link will apear like this: http://www.website.com/user_activate.php?ConfirmNumber=12345678901234567890 (a 20 diget random number). Then they will click on that link and it will take it that page, and they will be prompted to enter thier username/password that they registered with. and then the script will do the following.. 1. Check to make sure they entered a username/pass. 2. Check to make sure username/password are correct 3. Check to make sure the ConfirmNumber is correct for the username that they entered... (ie I dont want any username and password to work). 4. Check to make sure they have not already been activated. the part that is not working is: the confirm number part. I am not sure what I need to do to fix it.. could you please help me? below is the code: <?php include ('top.php'); if(isset($_POST['submit'])) { $user = $_POST['user']; $ConfirmNumber = $_GET['$ConfirmNumber']; $pass = base64_encode($_POST['pass']); if((!$_POST['user']) || (!$_POST['pass'])) { echo "Sorry you didnt enter an username or password, please got back and try again"; } else { $jap_data = mysql_query("SELECT pass, active, ConfirmNumber FROM users WHERE addicted_id='$user'") or die(mysql_error()); $jap_output = mysql_fetch_array($jap_data); if($pass != $jap_output['pass']) { echo "The password you entered was incorrect, please go back and try again"; } else { if($jap_output['active'] != 0) { echo "It appears that you have already confirmed your account!"; } else { if((!$_POST['ConfirmNumber']) || (!$_POST['ConfirmNumber'])) { echo "The confirmation number does not match the username you are trying to use!!!"; } else { $ConfirmNumber = $_GET['ConfirmNumber']; mysql_query("UPDATE users SET Active='1' WHERE ConfirmNumber='$ConfirmNumber'") or die(mysql_error()); echo 'Your Account has been confirmed!'; } } } } } else { ?> <p><center>Please enter your username and password that you just signed up for to confirm your account </center></p> <form action="user_activate.php?ConfirmNumber=<?php echo $_GET['ConfirmNumber']; ?>" method="POST"> <table cellpadding="2" cellspacing="2" width="69%" style="font-size: 12px; "> <tr> <td colspan="3" class="h"><div align="center"><strong>Username and Password </strong></div></td> </tr> <tr> <td class="h"><a href="" onMouseOver="return escape(' This is the hint ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td> <td class="h"><div align="left">UserName</div></td> <td><input name="user" type="text" /></td> </tr> <tr> <td class="h"><a href="" onMouseOver="return escape(' This is the hint ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td> <td class="h"><div align="left">Password</div></td> <td><input name="pass" type="password" /></td> </tr> <tr> <td> </td> <td><center><input type="submit" name="submit" value="Confirm"> </center></td> <td> </td> </tr> </table> </form> <?php } include("bottom.php"); ?>
  6. Hi, I am having issues with this script.. When a user registered on my site they are sent an email with the following: http://www.sitename.com/user_activate.php?ConfirmNumber=1234567890123456789 (20 digit random #) I am trying to do several differnt things with the script 1. check to make sure username and password are entered 2. check to make sure username and password are correct 3. check to make sure the "ConfirmNumber" matches the "ConfirmNumber" that is in the users db 4. check to make sure account is not already activated <?php include ('top.php'); if(isset($_POST['submit'])) { $user = $_POST['user']; $pass = base64_encode($_POST['pass']); if((!$_POST['user']) || (!$_POST['pass'])) { echo "Sorry you didnt enter an username or password, please got back and try again"; } else { $jap_data = mysql_query("SELECT pass, active, ConfirmNumber FROM users WHERE addicted_id='$user'") or die(mysql_error()); $jap_output = mysql_fetch_array($jap_data); if($pass != $jap_output['pass']) { echo "The password you entered was incorrect, please go back and try again"; } else { if($jap_output['active'] != 0) { echo "It appears that you have already confirmed your account!"; } else { if($ConfirmNumber != $jap_output['ConfirmNumber']) { echo "Check your username and make sure you are entering the correct username"; } else { $Venue_ID = $_GET['Venue_ID']; mysql_query("UPDATE users SET Active='1' WHERE ConfirmNumber='$ConfirmNumber'") or die(mysql_error()); echo 'Your Account has been confirmed!'; } } } } } else { ?> <p><center>Please enter your username and password that you just signed up for to confirm your account </center></p> <form action="user_activate.php?ConfirmNumber=<?php echo $_GET['ConfirmNumber']; ?>" method="POST"> <table cellpadding="2" cellspacing="2" width="69%" style="font-size: 12px; "> <tr> <td colspan="3" class="h"><div align="center"><strong>Username and Password </strong></div></td> </tr> <tr> <td class="h"><a href="" onMouseOver="return escape(' This is the hint ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td> <td class="h"><div align="left">UserName</div></td> <td><input name="user" type="text" /></td> </tr> <tr> <td class="h"><a href="" onMouseOver="return escape(' This is the hint ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td> <td class="h"><div align="left">Password</div></td> <td><input name="pass" type="password" /></td> </tr> <tr> <td> </td> <td><center><input type="submit" name="submit" value="Confirm"> </center></td> <td> </td> </tr> </table> </form> <?php } include("bottom.php"); ?>
  7. Got it working thanks! I used this code:
  8. hmm when I inserted your code: I get this error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/16389/domains/addictedtokaraoke.com/html/main.php on line 13 This is the code that I used: <?php $query = mysql_query("SELECT COUNT(*) FROM Venues"); $row = mysql_fetch_assoc($query); echo "Currently we have $row['COUNT(*)'] venues listed in our database!"; ?>
  9. hey guys, first im a complete newb... so please bear with me.. Here is what I am trying to do, and dont understand how to do it! so if all you cans can help me woult be greatly appricated. I am trying to count how many venues I have in this database. I know that I could use: $sql = 'SELECT COUNT(*) FROM Venues'; but the questions is how do I display the results on the webpage..
×
×
  • 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.