Jump to content
php.lv forumi

decembris

Reģistrētie lietotāji
  • Posts

    7
  • Joined

  • Last visited

Posts posted by decembris

  1. Šāds ir "izkodums" no skripta:

     

     

    (šeit ir pats skripta sākums)(nesanāca ar numerāciju nokopēt)

     

    <?php

     

     

     

    session_start();

     

     

     

    header("Cache-control: private");

     

     

     

    $dateRegistered=time();

     

     

     

    $currentTime=date("YmdHis");

     

     

     

    $userId=md5("$currentTime".$_SERVER['REMOTE_ADDR']);

     

     

     

     

     

     

     

    if($_POST[userName]!="" && $_POST[Password1]!="" && $_POST[Password2]!="" && $_POST!="" && $_POST[Name] !="" && $_POST[Country] !="" && $_POST[state] !="" && $_POST[City] !=""&& $_POST[ZipCode] !="" && $_POST[Adress] !=""){

     

     

     

    $errorMsg="";

     

     

     

    include ("../dbase.php");

     

     

     

    include ("../settings.php");

     

     

     

    //check if we have a user with the same id

     

     

     

    $userExists=false;

     

     

     

    $replacevalues = array('&','/'," ","?","+","%","$","#","@");

     

     

     

    $username=str_replace($replacevalues,"", $_POST['UserName']);

     

     

     

    $result = mysql_query("SELECT user FROM chatusers WHERE user='$username'");

     

     

     

     

     

     

     

    if (mysql_num_rows($result)==1){

     

     

     

    $errorMsg="Username exists, please choose another one!";

     

     

     

    } else if($_POST[Password1]!=$_POST[Password2]) {

     

     

     

    $errorMsg="Passwords do not match";

     

     

     

    }else if(strlen($_POST[Password1])<6){

     

     

     

    $errorMsg="Passwords must be at least 6 characters long";

     

     

     

    }else{

     

     

     

     

     

     

     

     

     

     

     

    if(!mysql_query("INSERT INTO chatusers ( id , user , password , email , name , country , state , city , zip , adress , dateRegistered,lastLogIn, emailnotify ,smsnotify,status,emailtype )

     

     

     

    VALUES ('$userId','$username', '$_POST[Password1]', '$_POST', '$_POST[Name]', '$_POST[Country]', '$_POST[state]','$_POST[City]', '$_POST[ZipCode]', '$_POST[Adress]', '$dateRegistered', '$currentTime','0','0','pending','$_POST[emailtype]')"))

     

     

     

    {

     

     

     

    $errorMsg="Could not modify database";

     

     

     

    } else {

     

     

     

     

     

     

     

    }

     

     

     

    }

     

     

     

    mysql_free_result($result);

     

     

     

    if ($errorMsg==""){

     

     

     

     

     

     

     

    $subject = "Your account activation at $siteurl";

     

     

     

     

     

     

     

    if ($_POST['emailtype']=="text"){

     

     

     

    $charset="Content-type: text/plain; charset=iso-8859-1\r\n";

     

     

     

    $message = "Thank you for registering at $siteurl

     

     

     

    In order to activate your newly created account copy and paste the link below in your browser:

     

     

     

     

     

     

     

    $siteurl/actm.php?UID=$userId

     

     

     

     

     

     

     

    Once you activate your membership you will receive a mail with your login information.

     

     

     

     

     

     

     

    Thanks!

     

     

     

     

     

     

     

    This is an automated response, please do not reply!";

     

     

     

     

     

     

     

    } else if($_POST['emailtype']=="html"){

     

     

     

     

     

     

     

    $charset="Content-type: text/html; charset=iso-8859-1\r\n";

     

     

     

    $message = "Thank you for registering at $siteurl

     

     

     

    In order to activate your newly created account copy and paste the link below in your browser:<br><br>

     

     

     

     

     

     

     

    <a href='$siteurl/actm.php?UID=$userId'>$siteurl/actm.php?UID=$userId</a><br><br>

     

     

     

     

     

     

     

    Once you activate your membership you will receive a mail with your login information.<br><br>

     

     

     

     

     

     

     

    Thanks! <br>

     

     

     

    manssaits <br>

     

     

     

    This is an automated response, please do not reply!<br>";

     

     

     

     

     

     

     

    }

     

     

     

     

     

     

     

    mail($_POST['Email'], $subject, $message, "MIME-Version: 1.0\r\n".$charset."From:'$registrationemail'\r\nReply-To:'$registrationemail'\r\n"."X-Mailer:PHP/".phpversion() );

     

     

     

     

    (un tur vel turpinās skripts)

  2. Nu kā tad man vajadzēja rakstīt?

     

    Ne velti atrodos iesācēju sadaļā.

     

    NU KĀ- IR SAITS, PIEREĢISTRĒJIES-AIZPILDI LAUCIŅUS, UN UZ E PASTU JĀATNĀK MAILAM-UZSPIED,LAI AKTIVIZĒTU BLA BLA BLA! NU MAILS NEATNĀK! KUR MEKLĒT PROBLĒMU-KODĀ VAI KUR CITUR, PIE TAM,JA ES NEZINU KĀDAM IR JĀBŪT PAREIZAJAM KODAM! Kur meklēt kādam ir jāizskatās 'pareizajam' kodam? Ja nav kodā vaina, kur tad?

     

    Tagad ir daudz maz skaidrs?

×
×
  • Create New...