Jump to content
php.lv forumi

WingTsun

Reģistrētie lietotāji
  • Content count

    8
  • Joined

  • Last visited

About WingTsun

  • Rank
    Māceklis

Recent Profile Visitors

1347 profile views
  1. PHP Programmētājs

    Ir jau gandrīz 10 gadu pieredze. Valodas: ☆ PHP ☆ MySQL, MySQLi ☆ Javascript ☆ Jquery (Frameworks) ☆ AJAX ☆ HTML(5) ☆ CSS (3) ☆ XML Dizains: ☆ Photoshop Dizains (Lapas, Bannera, Plakata, utt..), arī animācijas ☆ HTML(5), CSS (3) - FrontEnd Dizains ☆ Foruma posta dizains Frameworks: ☆ Bootstrap ☆ Font-Awesome ☆ Bootstrap ☆ Twig ☆ Font-Awesome Tehnoloģijas: ☆ Vairāki CMS/MVC ☆ Copmposer ☆ GIT/BitBucket (SVN) Papildus: ☆ Liela pieredze ar maksājumu sistēmu API implementāciju (AutoMaksajumiem) ☆ Ir veidotas ļoti daudzu tipu lapas, sākot no maziem portfeļiem, internetveikaliem, līdz lielām finansiālām platformām. Visu ir neiespējami uzskaitīt =) ☆ Liela pieredze drošibas kļūdu/caurumu (Penetretion Testing), ka arī atrasto problēmu risināšanā ☆ SEO
  2. .htaccess $_GET Problemo

    Ar so informaciju ir pietiekami, lai varetu uzrakstit ejosu .htaccess Pec neskaitamiem meginajumiem, izdevas to izdarit. Ja kads uzduras uz problemu, veidot ModRewrite Referral/Affiliate linkus Luk ir stradajos kods: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^devil-([A-Za-z0-9]*)$ /index.php?ref=$1 [NC,L,QSA]
  3. .htaccess $_GET Problemo

    Sveiki! Es veidoju saitu, kur man ir implementets ref links. Tur viss ir ok.. ka piem *.com/?ref=1 (Lietojot $_GET) Vot es gribu uztaisit ar ModRewrite palidzibu linku, kas izskatas vairak ka *.com/join-1 Izmeginaju visadas versijas, neviena negaja, tapec versos pie masteriem seit :)
  4. Composer!

    Sveiki! Uzduros nelielai problemai ar Composer. Lietoju windows uz sava local dev servera. Composer ir uzinstalets, un pats par sevi strada. Problema ir, ka, kad es meginu palaizt install komandu: "php composer.phar install", man met erroru: fatal: Not a git repository (or any of the parent directories): .git fatal: Not a git repository (or any of the parent directories): .git abort: no repository found in 'C:\xampp\htdocs\Project109' (.hg not found)! 'svn' is not recognized as an internal or external command, operable program or batch file. Luk seit ir saturs no "composer.json": { "require": { "blocktrail/blocktrail-sdk": "1.1.*" } } Nevaru iebraukt, kadel nestrada. Esmu iesacejs ar Composer, bet man ir shita lieta jaieshari :) Paldies par palidzibu, WingTsun™
  5. You have an error

    <?php include('datubaaze.php'); mysql_query("UPDATE `wall` SET `read`='yes'") or die(mysql_error()); ?> Pamēģini šitā! Iespējams, ka kļūda ir citā kverijā. Ieteiktu papētīt "datubaaze.php". Pamēģini to include noņemt, un paskaties, vai tad arī ir kļūda, ja nav, tad zināsi, ka kļūda rodas tur.
  6. Pietiekami nodrošināta Reģistrācija

    Paldies par atbildēm. Ņemšu vērā ieteikumus, un izveidošu atsevišķu Class, kas veiks vairākas populāras darbības, kuras man nācies atkārtot šeit reģistrācija, un kuru pēctam varēšu pielietot citur.
  7. Pietiekami nodrošināta Reģistrācija

    Paldies par atbildi. Ņemšu to turpmāk vērā. Bet nu šajā skriptā nav daudz funkciju, kas nebūtu Custom, pietam validate klasi es iekļāvu. Varbūt es esmu kautko nepareizi sapratis, tapēc lūdzu neuzbrukt, jo esmu iesācējs. Galvenais jautājums ir, vai pamatā skripts ir ņemams, un pietiekami drošs, vai arī sķībs? :)
  8. Sveiki! Es neesmu profesionālis, tapec nenodiršam mani uzreiz.. :) PHP esmu apguvis pašmācība, un jau kādu laiciņu neatlaidīgi strādāju. Tātad, es pabeidzu reģistrācijas skriptu, bet es vēlēteos uzināt jūsu viedokli, vai šis skripts ir pietiekami nodrošināts, lai šo varētu lietot publiskā saitā. Viņš šobrīd lieto MySQLi prepare un bind params.. SqlQuery ir sagatavota funkcija, ar ko tu veicu. Lūk pati reģistrācija: <?php /* Signup */ # Load Modules require('./system/class.validator.php'); ###################################################################################################################################################### ##| Registration Data verification and processing |## ###################################################################################################################################################### if(isset($_POST['signup_finish'])) { # Define Variables and Objects $failed = false; $Validator = new Validate; # Username, Required # Min: 5, Max: 25 # Numbers and Letters Only # Unique $USERNAME = ($Validator -> ValidString($_POST['USERNAME'], 1, 5, 25) == 'success' ? $_POST['USERNAME'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['username'][$Validator -> ValidError()])); if($USERNAME) { $Query = "SELECT `username` FROM `users` WHERE `username`=?"; $Params = array($USERNAME); $Sqlresult = SqlQuery($Sqli, $Query, 's', $Params); if($Sqlresult ) { $failed = true; $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['username']['exists']); } } # Email, Required # Specific email format Only # Unique $EMAIL = ($Validator -> ValidEmail($_POST['EMAIL']) ? $_POST['EMAIL'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['email']['invalid'])); if($EMAIL) { $Query = "SELECT `email` FROM `users` WHERE `email`=?"; $Params = array($EMAIL); $Sqlresult = SqlQuery($Sqli, $Query, 's', $Params); if($Sqlresult ) { $failed = true; $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['email']['exists']); } } # Passwords, Required # Min: 8, Max: 50 # Numbers and Letters Only # Must Match $PASSWORD1 = ($Validator -> ValidString($_POST['PASSWORD1'], 1, 8, 50) ? $_POST['PASSWORD1'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['password'][$Validator -> ValidError()])); $PASSWORD2 = ($Validator -> ValidString($_POST['PASSWORD2'], 1, 8, 50) ? $_POST['PASSWORD2'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['password'][$Validator -> ValidError()])); if($PASSWORD1 != $PASSWORD2) { $failed = true; $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['password']['match']); } # Name, Required # Min: 2, Max: 50 # Letters Only $NAME = ($Validator -> ValidString($_POST['NAME'], 3, 3, 50) == 'success' ? $_POST['NAME'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['name'][$Validator -> ValidError()])); # Surname, Required # Min: 2, Max: 50 # Letters Only $SURNAME = ($Validator -> ValidString($_POST['SURNAME'], 3, 3, 50) == 'success' ? $_POST['SURNAME'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['surname'][$Validator -> ValidError()])); # Phone, Optional # Min: 8, Max: 30 # Letters Only if($_POST['PHONE']){ $PHONE = ($Validator -> ValidString($_POST['PHONE'], 2, 8, 30) == 'success' ? $_POST['PHONE'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['phone'][$Validator -> ValidError()])); } # Skype, Optional # Min: 6, Max: 30 # All if($_POST['SKYPE']){ $SKYPE = ($Validator -> ValidString($_POST['SKYPE'], 4, 6, 30) == 'success' ? $_POST['SKYPE'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['skype'][$Validator -> ValidError()])); } # Captcha, Required # Min, Max: 6 # Letter and Nummers Only # Must Match $CAPTCHA = ($Validator -> ValidString($_POST['CAPTCHA'], 1, 6, 6) == 'success' ? $_POST['CAPTCHA'] : $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['captcha'][$Validator -> ValidError()])); if($_SESSION['security_code'] != $CAPTCHA) { $failed = true; $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['captcha']['wrong']); } # Rules # Must be Checked if(!isset($_POST['RULES'])) { $failed = true; $iMessage -> SetIMessage('ERROR', $global['signup']['form']['error']['rules']['empty']); } # Referred By # Min: 1, Max: 25 # Letters Only if($_POST['REFERRED_BY']){ $REFERRED_BY = ($Validator -> ValidString($_POST['REFERRED_BY'], 2, 1, 25) == 'success' ? $_POST['REFERRED_BY'] : $iMessage -> false); } ## Start the Registration of a New User ## ########################################################################################################################## if(!$failed && !$Validator -> ValidError()) { $SqlQuery = $Sqli -> prepare("INSERT INTO `users` (`username`, `name`, `surname`, `email`, `password`, `phone`, `language`, `signup_date`, `referred_by`, `ip`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $SqlQuery -> bind_param('sssssisiis', $USERNAME, $NAME, $SURNAME, $EMAIL, md5($PASSWORD1), $PHONE, $userLang, time(), $REFERRED_BY, $IP); if($SqlQuery -> execute()) { $iMessage -> SetIMessage('SUCCESS', $global['signup']['success']['email_sent']); } $HideForm = true; } } } } ?> <?php /* Data Validator Module */ class Validate { # Store Variables public $ErrorType; # String # $string: String to Validate # $type: 1 = Numbers and Letters, 2 = Numbers, 3 = Letters, 4 = All # $min: The minimum length of the string # $max: The maximum length of the string # Returns ErrorType if Failed function ValidString($string, $type, $min, $max) { $failed = false; if(strlen($string) < $min) { $this -> ErrorType = 'short'; $failed = true; } if(strlen($string) > $max) { $this -> ErrorType = 'long'; $failed = true; } # Type 1: Numbers and Letters if($type == 1) { if(!ctype_alnum($string)) { $this -> ErrorType = 'invalid'; $failed = true; } } # Type 2: Numbers only if($type == 2) { if(!is_numeric($string)) { $this -> ErrorType = 'invalid'; $failed = true; } } # Type 1: Letters only if($type == 3) { if(!ctype_alpha($string)) { $this -> ErrorType = 'invalid'; $failed = true; } } if(!$failed) { return 'success'; } } # Email # $email: Email to Validate # MaxLength: 50 # Returns False if Failed, else returns True function ValidEmail($email) { if(strlen($email) > 50) { return false; } else { $email = strtolower($email); if (preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $email)) { return true; } else { return false; } } } # Output the ErrorType function ValidError() { return $this -> ErrorType; } } ?>
×