lalonde4 Posted May 29, 2012 Share Posted May 29, 2012 Now when I send the activation link in an email to a user. They go to the activate page and then enter in their info but then the method doesnt work. Can anyone see where that might be. I have done a few debugging. but not all. <?php $title = "Productions - Activations"; ?> <?php require("styles/top.php"); ?> <div id='full'> <?php $getcode = $_GET['code']; $form = "<form action='activate.php method='post'> <table> <tr> <td>Activate Code:</td> <td><input type='text' name='code' value='$getcode'></td> </tr> <tr> <td>Username:</td> <td><input type='text' name='username'></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='password'></td> </tr> <tr> <td></td> <td><input type='submit' name='submitbtn' value='activate'></td> </tr> </table> </form>"; if ($_POST['submitbtn']){ $code = strip_tags($_POST['code']); $username = strip_tags($_POST['username']); $password = strip_tags($_POST['password']); if ($code && $username && $password){ if (strlen($code) == 25){ $pass = md5($password); require("scripts/config.php"); $query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$pass'"); $numrows = mysql_num_rows($query); if ($numrows == 1){ $row = mysql_fetch_assoc($query); $dbcode = $row['code']; if ($code == $dbcode){ mysql_query("UPDATE users SET active='1' WHERE username='$username'"); echo $sql; mysql_query($query) or die(mysql_error()); echo "Your account is now active you may now login.<a href='login.php'>Click here to login.</a>"; } else echo "Your acttivation code was incorrect. $form"; } else echo "Your username and password are invalid. $form"; } else echo "You have not registered your information. $form"; } else echo "You did not fill out the entire form. $form"; } else echo "$form"; ?> </div> <?php require("styles/bottom.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/ Share on other sites More sharing options...
Psycho Posted May 29, 2012 Share Posted May 29, 2012 "doesn't work" is not a helpful explanation. What DOES it do and what is it supposed to be doing differently? If you've tried some debugging, what have you tried and what were the results? Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349598 Share on other sites More sharing options...
lalonde4 Posted May 29, 2012 Author Share Posted May 29, 2012 Yeah i tried displaying like the db connection see if it connected and it does but do you have any other debugging im new in php actually so Im kinda getting on my feet if you can understand you all are a big help. Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349599 Share on other sites More sharing options...
lalonde4 Posted May 29, 2012 Author Share Posted May 29, 2012 When I go to the link in the email it takes me to activate.php and then i enter in my username and password and then hit activate. Problem that comes is after hitting the submit it takes me to a 404 error web page. Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349601 Share on other sites More sharing options...
requinix Posted May 29, 2012 Share Posted May 29, 2012 Well, there's </pre> <form action="'activate.php" method="'post'">< Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349604 Share on other sites More sharing options...
lalonde4 Posted May 29, 2012 Author Share Posted May 29, 2012 Well, there's <form action='activate.php method='post'> Well its set as that already just I can't get the page to get the information. That's what it seems anyway. Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349605 Share on other sites More sharing options...
Drummin Posted May 29, 2012 Share Posted May 29, 2012 Well, there's <form action='activate.php method='post'> Well its set as that already just I can't get the page to get the information. That's what it seems anyway. Look at your quoting. Missing something? Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349609 Share on other sites More sharing options...
lalonde4 Posted May 29, 2012 Author Share Posted May 29, 2012 What do you see? I don't. Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349615 Share on other sites More sharing options...
Drummin Posted May 29, 2012 Share Posted May 29, 2012 <form action='activate.php' method='post'> Missing that end quote after activate.php. Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349634 Share on other sites More sharing options...
kicken Posted May 29, 2012 Share Posted May 29, 2012 $form = "<form action='activate.php method='post'> Your missing a quote. $form = "<form action='activate.php' method='post'> Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349639 Share on other sites More sharing options...
lalonde4 Posted May 29, 2012 Author Share Posted May 29, 2012 Yeah i fixed that a while ago but no it was with my hosting provider I figured it out. thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/263339-any-ideas-on-method/#findComment-1349646 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.