Jump to content

revraz

Members
  • Posts

    6,911
  • Joined

  • Last visited

    Never

Everything posted by revraz

  1. Your account has been tried to access by IP xxx.xxx.xxx.xxx at date/time?
  2. Do you know how to do a MySQL UPDATE statement? http://dev.mysql.com/doc/refman/5.0/en/update.html http://www.w3schools.com/php/php_mysql_update.asp http://www.tizag.com/mysqlTutorial/mysqlupdate.php
  3. And that error is....? Where is the semi colon?
  4. I wonder why people put a LIMIT on their update queries. If there is more than 1 row that matches the query, how do you know which row is updated? Plus, if done correctly, there should only be 1 result.
  5. It all depends on you for what you want to store. No one can tell you what you need to store, that's something you need to determine.
  6. Hard to say without knowing the details of your project.
  7. Doesn't matter how you populate the variable.
  8. But to answer your actual question, you would use LIMIT in your SQL call.
  9. revraz

    PHP login

    Another thing to check, make sure you write the password the same way you read it (2 hashes) and also make sure you DB Field length is long enough to hold it.
  10. http://php.net/manual/en/function.empty.php
  11. So are you asking for someone to do this for you? If so, try the Freelance section.
  12. Every action someone does, you log it in the DB with the time and their ID
  13. A common answer to this, is store a time stamp of their activity, then check it for a time frame (say 5 mins) then show them as active or not based on that. This is answered almost weekly, so you should find ideas about this topic already in the forums.
  14. When something like that doesn't work, try putting your query in a variable, then echo the variable so you can see what is actually being passed. Will help a lot in troubleshooting.
  15. You need to use session_start at the top of each page you want to use sessions. Then you store data in the $_SESSION variable that you want to use on each page that uses sessions.
  16. Because you can't. What's wrong with $_SESSION['variable'] ? Look at a Session tutorial, sounds like you are just unsure how they work.
  17. And let's say for some reason no one is on your site or they have javascript disabled. Why would you rely on that, makes no sense.
  18. How will that javascript/ajax run if they close the browser? Cron job to check the last time stamp is probably the surest way.
  19. That's because it's a resource and not the result. Use the examples that were provided.
  20. Google PHP and MySQL Tutorials to start.
  21. Doesn't really help with just showing that code.
  22. <?php require_once('../../includes/header.php'); if (file_exists(SITE_ROOT.'/themes/'.THEME.'/account/register.php')){//account register from the theme! require_once(SITE_ROOT.'/themes/'.THEME.'/account/register.php'); } else{//not found in theme ?> <h2><?php _e("Register")?></h2> <?php $show_form = true; if ($_POST && checkCSRF('register_user')){ if(checkMathCaptcha('register')) { $name = cP('name'); $email = cP('email'); $password = cP('password'); $password_confirmation = cP('password_confirmation'); $mailinglist = cP('mailinglist'); $agree_terms = cP('agree_terms'); if( isset($_POST['mailinglist']) ) { $mailinglist = 1; } else { $mailinglist = 0; } if ($agree_terms == "yes"){ if (isEmail($email)){ if ($password == $password_confirmation){ $account = new Account($email); if ($account->exists){ echo "<div id='sysmessage'>".T_("Account already exists")."</div>"; } else { if ($account->Register($name,$email,$password)){ $token=$account->token(); $url=accountRegisterURL(); if (strpos($url,"?")) $url.='&account='.$email.'&token='.$token.'&action=confirm'; else $url.='?account='.$email.'&token='.$token.'&action=confirm'; $message='<p>'.T_("Click the following link or copy and paste it into your browser address field to activate your account").'</p> <p><a href="'.$url.'">'.T_("Confirm account").'</a></p><p>'.$url.'</p>'; $array_content[]=array("ACCOUNT", $name); $array_content[]=array("MESSAGE", $message); $bodyHTML=buildEmailBodyHTML($array_content); sendEmail($email,T_("Confirm your account")." - ".SITE_NAME,$bodyHTML);//email registration confirm request $show_form = false; echo "<div id='sysmessage'>".T_("Instructions to confirm your account has been sent").". ".T_("Please, check your email")."</div>"; } else _e("An unexpected error has occurred trying to register your account"); } } else echo "<div id='sysmessage'>".T_("Passwords do not match")."</div>"; } else echo "<div id='sysmessage'>".T_("Wrong email")."</div>"; } else echo "<div id='sysmessage'>".T_("Terms agreement is required")."</div>"; } else echo "<div id='sysmessage'>".T_("Wrong captcha")."</div>";//wrong captcha } if (trim(cG('account'))!="" && trim(cG('token'))!="" && trim(cG('action'))=="confirm"){ $show_form = false; $email = trim(cG('account')); $token = trim(cG('token')); $account = new Account($email); if ($account->exists){ if ($account->Activate($token)){ echo "<div id='sysmessage'>".T_("Your account has been succesfully confirmed")."</div>"; $bodyHTML="<p>".T_("NEW account registered")."</p><br/>".T_("Email").": ".$account->email." - ".$account->signupTimeStamp(); sendEmail(NOTIFY_EMAIL,T_("NEW account")." - ".SITE_NAME,$bodyHTML);//email to the NOTIFY_EMAIL $account->logOn($account->password()); echo '<p><a href="'.accountURL().'">'.T_("Welcome").' '.$account->name.'</a></p><br/>'; } else echo "<div id='sysmessage'>".T_("An unexpected error has occurred trying to confirm your account")."</div>"; } else echo "<div id='sysmessage'>".T_("Account not found")."</div>"; } if ($show_form){ ?> <div> <form id="registerForm" action="" onsubmit="return checkForm(this);" method="post"> <p><label for="name"><?php _e("Name")?>:<br /> <input type="text" id="name" name="name" value="<?php echo $name;?>" maxlength="250" onblur="validateText(this);" lang="false" /></label></p> <p><label for="email"><?php _e("Email")?>:<br /> <input type="text" id="email" name="email" value="<?php echo $email;?>" maxlength="145" onblur="validateEmail(this);" lang="false" /></label></p> <p><label for="password"><?php _e("Password")?>:<br /> <input type="password" id="password" name="password" value="" onblur="validateText(this);" lang="false" /></label></p> <p><label for="password_confirmation"><?php _e("Confirm password")?>:<br /> <input type="password" id="password_confirmation" value="" name="password_confirmation" onblur="validateText(this);" lang="false" /></label></p> <p><label for="mailinglist"><input type="checkbox" id="mailinglist" name="mailinglist" value="<?php echo $mailinglist;?>" style="width: 10px;" /></label>Join Mailing List</p> <p><label for="agree_terms"><input type="checkbox" id="agree_terms" name="agree_terms" value="yes" style="width: 10px;" /> <?php _e("Accept")?> <a href="<?php echo termsURL();?>"><?php _e("Terms")?></a> - <?php echo SITE_NAME?></label></p> <br /> <?php if (CAPTCHA){ mathCaptcha('register');?> <p><input id="math" name="math" type="text" size="2" maxlength="2" onblur="validateNumber(this);" onkeypress="return isNumberKey(event);" lang="false" /></p> <br /><?php }?> <?php createCSRF('register_user');?> <p><input name="submit" id="submit" type="submit" value="<?php _e("Submit")?>" /></p> </form> </div> <?php } }//if else require_once('../../includes/footer.php'); ?>
×
×
  • 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.