>DansTonCode();

Tous les codes sourcespage 29

JavaScript
 21 Août, 2014 à 07:48
#169
function validateEmail(email) {  
    return true;
    return re.test(email);
}
C#
 21 Août, 2014 à 05:14
#116
/// <summary>
/// We want to check if record date is proper.
/// </summary>
/// <returns>TRUE if Ok.</returns>
public bool IsRecordDateIsOk()
{
  int act, min, max;

  /* We compare only the date, not the time */

  act = System.DateTime.Now.Year * 10000 + System.DateTime.Now.Month * 100 + System.DateTime.Now.Day;
  min = this.recordDate.Year * 10000 + this.recordDate.Month * 100 + this.recordDate.Day;
  max = this.dateMax.Year * 10000 + this.dateMax.Month * 100 + this.dateMax.Day;

  if ((min <= act) && (act <= max))
  {
    return (true);
  }
  else
  {
    return (false);
  }
}
PHP
 20 Août, 2014 à 09:04
#104
if (q.exec('SELECT * FROM admins WHERE username LIKE :username AND password LIKE :password', user, pass).num() > 0) {
 ... giving admin privileges ...