Meta tags:
description= Learn Web Programming. Get free tutorials, scripts, coding tips and tricks for HTML, CSS, PHP, CodeIgniter, Bootstrap, JavaScript and jQuery;
Headings (most frequently used words):
to, how, php, on, laravel, change, port, form, in, should, the, windows, composer, input, gmail, install, settings, smtp, and, csv, file, contain, password, you, email, for, number, be, installing, like, only, first, characters, mysql, apache, secure, using, create, download, use, preg, xampp, must, match, passwords, store, with, alphanumeric, verify, next, of, usercontroller, blade, character, welcome, alphabet, special, length, check, field, id, hash, welcomeuser, password_hash, what, user, http, valid, ini, way, send, function, validate, database, localhost, sending, via, system, requirements, prerequisite, syntax, contact, alphabets, subscribe, may, also, us, facebook, categories, setting, application, key, specific, version, ssl,
Text of the page (most frequently used words):
the (234), and (101), you (84), php (78), #laravel (46), for (41), #file (41), #this (36), #composer (31), how (31), use (29), #your (29), #will (28), #with (28), password (27), can (25), #port (25), #have (24), email (23), install (22), using (21), change (21), #xampp (20), user (19), csv (18), step (18), mysql (17), make (17), here (17), apache (16), also (16), first (16), command (15), below (15), like (15), folder (15), open (15), function (15), are (14), download (14), create (14), mail (14), gmail (13), windows (13), form (13), server (13), that (12), now (12), hash (12), name (12), data (12), machine (12), one (12), see (12), smtp (11), string (10), extension (10), input (10), number (10), store (10), passwords (10), project (10), username (10), must (9), send (9), click (9), characters (9), next (9), used (9), which (9), localhost (9), check (9), not (9), sure (9), settings (9), should (9), expression (8), codeigniter (8), _post (8), preg_match (8), then (8), run (8), 2018 (8), installing (8), save (8), com (8), other (8), please (8), time (8), welcome (8), some (8), secure (8), but (8), case (8), password_hash (8), start (8), contain (8), want (7), path (7), force (7), database (7), let (7), system (7), url (7), read (7), filename (7), artisan (7), installed (7), from (7), set (7), valli (7), posted (7), welcomeuser (7), all (7), hope (6), without (6), key (6), env (6), take (6), default (6), code (6), comment (6), public (6), via (6), class (6), uname (6), window (6), before (6), html (6), above (6), web (6), http (6), line (6), browser (6), character (6), alphabet (6), find (6), just (5), share (5), useful (5), invalid (5), post (5), ssl (5), done (5), need (5), when (5), since (5), inside (5), don (5), along (5), them (5), application (5), enter (5), any (5), alphanumeric (5), version (5), die (5), header (5), message (5), illuminate (5), generate (5), app (5), login (5), field (5), view (5), only (5), right (5), type (5), alphabets (4), about (4), never (4), kodingmadesimple (4), jquery (4), bootstrap (4), conf (4), social (4), include (4), valid (4), changes (4), queue (4), prompt (4), website (4), mailable (4), return (4), provide (4), usercontroller (4), my_laravel_site (4), going (4), latest (4), method (4), content (4), servername (4), write (4), following (4), regular (4), json (4), where (4), successfully (4), same (4), given (4), required (4), md5 (4), ini (4), wamp (4), vulnerable (4), automatically (4), directory (4), new (4), sql (4), mysqli_real_escape_string (4), listen (4), match (4), algorithm (4), registration (4), far (4), what (3), created (3), exe (3), requires (3), select (3), details (3), htdocs (3), route (3), emails (3), property (3), add (3), good (3), tool (3), screen (3), into (3), prefer (3), build (3), controller (3), template (3), blade (3), dist (3), sending (3), break (3), manage (3), circle (3), validations (3), emailid (3), sensitive (3), handling (3), bcrypt (3), result (3), these (3), text (3), both (3), dependency (3), they (3), easily (3), popular (3), validation (3), preg (3), requirements (3), receive (3), hashing (3), verify (3), way (3), installation (3), against (3), instead (3), functions (3), dll (3), readfile (3), length (3), long (3), keep (3), something (3), program (3), locate (3), home (3), service (3), simply (3), access (3), try (3), 443 (3), look (3), once (3), else (3), than (3), affiliate (3), etc (3), links (3), amazon (3), 8012 (3), special (3), our (3), site (3), contact (3), launch (3), files (3), script (3), example (3), 444 (3), even (3), advertising (3), replace (3), simple (3), already (3), prices (2), 3306 (2), send_email (2), may (2), account (2), sendmail (2), likewise (2), returns (2), displayed (2), password_verify (2), users (2), anderson (2), everything (2), mysqli_query (2), con (2), john (2), echo (2), send_mail (2), restart (2), checking (2), has (2), leave (2), host (2), numbers (2), matches (2), offers (2), though (2), changed (2), attack (2), there (2), older (2), someone (2), could (2), convert (2), validating (2), while (2), extremely (2), powerful (2), api (2), development (2), serve (2), things (2), tutorial (2), comes (2), methods (2), developers (2), steps (2), encryption (2), css (2), bin (2), very (2), random (2), salt (2), copy (2), own (2), includes (2), pass (2), lamp (2), variable (2), sent (2), framework (2), uses (2), sha1 (2), represents (2), brute (2), procedure (2), xml (2), pdf (2), root (2), awesome (2), process (2), user_name (2), associates (2), frameworks (2), side (2), second (2), client (2), met (2), many (2), modern (2), 465 (2), more (2), mail_port (2), libraries (2), mail_host (2), dependencies (2), panel (2), control (2), mail_driver (2), tls (2), configure (2), unless (2), move (2), stack (2), dialog (2), option (2), finally (2), ready (2), media (2), versions (2), button (2), laravel_demo (2), array (2), johnson (2), myfile (2), found (2), show (2), fputcsv (2), fire (2), remove (2), security (2), serializesmodels (2), sign (2), _default_ (2), syntax (2), proper (2), body (2), services (2), generally (2), would (2), llc (2), matter (2), title (2), div (2), queueable (2), management (2), directly (2), storing (2), virtualhost (2), securely (2), search (2), head (2), basis (2), formats (2), lines (2), setting, part, installer, okay, usually, said, mydomain, session, zip, notice, paste, hold, best, online, liking, two, patient, merchants, although, being, receives, language, disposition, started, attachment, compensation, encrypting, referred, after, generated, hard, native, specific, respective, earlier, exception, does, named, current, affect, working, clicking, link, product, downloading, products, storage, configuration, miami, little, choose, subject, fopen, rename, manually, sales, snippet, problems, app_key, disk, fclose, various, mentioned, including, creates, hit, alternatively, views, member, disclosure, participant, __construct, void, instance, extends, shouldqueue, contracts, bus, namespace, place, mail_username, doctype, displays, controllers, facade, designed, means, sites, earn, facades, support, fees, routes, passed, your_gmail_id, homecontroller, documentation, tutorials, blog, programming, softwares, reviews, based, cloud, quickly, mails, clean, today, refer, mail_password, explicitly, customized, available, collect, classes, config, utilizes, those, terminal, 587, mail_encryption, your_gmail_password, linking, get, shift, pdo, dive, wasting, planned, anyhow, loads, worth, well, spent, definitely, mastering, openssl, ctype, its, mbstring, tokenizer, reference, prerequisite, npm, node, similar, hearing, obviously, www, works, follow, ever, become, 8000, again, went, worry, google, apps, less, allow, off, turn, bottom, down, scroll, issues, affiliated, most, powered, blogger, box, out, goodies, ships, mvc, another, alternative, great, reason, call, throws, mime, usage, ports, containing, 3310, column, varchar, least, otherwise, false, true, remember, local, itself, rough, 2013, mysqli_fetch_assoc, mysqli_num_rows, goes, fine, page, password_compat, ircmaxell, github, https, password_, servers, helps, 255, considerate, image, thing, restore, tougher, factor, cost, algorithmic, plus, expensive, computationally, makes, applied, compared, slow, stacks, future, values, insert, password_bcrypt, recommended, strongly, therefore, cryptographically, usr, netstat, stronger, much, accommodate, upgrade, library, jpeg, lucky, blank, semicolon, php_sockets, php_curl, php_openssl, ways, setup, wonder, browse, executable, why, answer, unlikely, multiple, occupied, proxy, appears, iis, jboss, pops, simultaneously, finished, cmd, dialogue, separately, latter, fail, 433, anything, extra, httpd, unused, measures, nothing, idea, clear, guess, per, rather, globally, maintain, occupies, update, stop, packages, exit, declare, allows, know, their, symfony, running, days, work, addition, built, sets, incase, appropriate, cannot, guarantee, peak, sneak, accuracy, dwelling, say, lower, upper, end, present, error, basic, each, checks, too, alter, sitemap, privacy, policy, lowercase, uppercase, disclaimer, pattern, attracts, space, securing, display, date, provides, daily, curl, remote, explains, validate, comments, spot, forms, advisable, malicious, strictly, harm, thru, easy, still, java, among, practice, format, received, foremost, processing, hackers, independent, hyphen, protect, fast, huge, htaccess, generates, higher, community, thanks, mind, developer, budding, having, plain, gpu, verification, extensions, subscribe, putting, smartness, outrun, loading, salted, posts, big, decrypt, chance, backup, associate, responsibility, such, plugin, employ, javascript, font, ajax, categories, trick, facebook, twitter, quite, expressions, warm, upload, necessary, common, discussed, article, enjoyed, source, safe, really, school, old, manner, information, precautions, demos,
Text of the page (random words):
mail_driver mail_host mail_port etc but you don t have to directly make changes to this file you can simply provide those details on the env file found in the app root and laravel will automatically find the required settings here go the steps to send mail using gmail smtp server in laravel step 1 first install the latest version of laravel which is 5 6 as of now open up the terminal and fire the below composer command to install it composer create project laravel laravel laravel_demo prefer dist here laravel_demo is your project folder step 2 next open up the env file and configure the email settings i m going to use gmail server for sending the email so we must provide the gmail smtp details here gmail smtp settings host name smtp gmail com smtp port 587 tls 465 ssl encryption tls ssl your env file should look like this mail_driver smtp mail_host smtp gmail com mail_port 465 mail_username your_gmail_id mail_password your_gmail_password mail_encryption ssl step 3 then generate the mailable class fire up the below command on the command prompt php artisan make mail welcomeuser this will create welcomeuser php file inside app mail folder we have created this to send welcome email to user this class is going to contain only one property which is uname this member variable represents the user s name which will be passed from the controller welcomeuser php php namespace app mail use illuminate bus queueable use illuminate mail mailable use illuminate queue serializesmodels use illuminate contracts queue shouldqueue class welcomeuser extends mailable use queueable serializesmodels public uname create a new message instance return void public function __construct uname this uname uname build the message return this public function build return this view email welcome step 4 next create the view file this will contain the template for our email create email folder inside views and place welcome blade php file inside it welcome blade php doctype html html head title welcome user title head body div h2 hi uname welcome to kodingmadesimple com h2 div body html above we have a very simple template that displays welcome message to the user step 5 next generate a controller file with the below artisan command php artisan make controller usercontroller open the usercontroller php file inside app http controllers folder and add send_mail function to it also make sure to include the path for mail facade and welcomeuser class usercontroller php php use illuminate support facades mail use app mail welcomeuser public function send_email user_name john anderson to john anderson gmail com mail to to send new welcomeuser user_name return mail sent successfully step 6 finally add route for our usercontroller s send_mail function open routes web php file and add the below route to it route get user sendmail homecontroller send_email done now start the artisan server php artisan serve open the browser and enter the url http localhost 8000 user sendmail and if everything went right you ll see the below screen if you don t receive the email don t worry do the following changes to your gmail settings gmail settings login to your google account and go to my account sign in security scroll down to the bottom and look for allow less secure apps option if it is set off then turn it on now try it again and you ll receive the mail without any issues read also how to install laravel 5 6 on windows using composer you can even queue the emails just call the queue method instead of send with mail to likewise you can send emails in laravel via gmail smtp i hope you find this post useful please share it on social media if you like it how to install laravel 5 6 on windows using composer posted by valli on 6 19 2018 1 comment so far here let s see how to install laravel on windows using composer ever since its launch laravel has become the most popular php framework and not without a good reason it s a great alternative to codeigniter which is another popular mvc for php laravel ships with so many goodies out of the box than other frameworks do mastering laravel will definitely take some time but the time spent is well worth it in the long run and it will save loads of time in application development anyhow here you are planned to move on to laravel and want to install it for the first time without wasting the time let s dive into the process of installing laravel on windows machine system requirements for laravel as of now the latest laravel version is 5 6 and you have to make sure the below system requirements is met to install and use it on your machine php 7 1 3 openssl php extension pdo php extension json php extension xml php extension ctype php extension mbstring php extension tokenizer php extension reference laravel website prerequisite composer laravel requires composer to manage the project dependencies so before installing laravel make sure you have composer installed on your system in case you are hearing about composer for the first time it s a dependency management tool for php similar to node s npm to install composer on your machine check this post how to install composer on windows using xampp installing laravel on windows follow the below steps to install laravel on windows machine no matter you have xampp wamp stack it works for both on wamp make sure to install laravel on www folder and on xampp obviously the htdocs step 1 open htdocs folder on xampp hold shift key and right click on the folder and choose open command window here alternatively you can open command window and change directory to xampp htdocs step 2 enter the following command composer create project laravel laravel my_laravel_site prefer dist here my_laravel_site is the folder name where laravel files will be installed change this to your liking step 3 now it s time to be patient as laravel installation is going to take some time step 4 once installed change directory to my_laravel_site cd my_laravel_site on the command prompt and enter the below command php artisan serve step 5 this will show a message something like laravel development server started along with an url step 6 copy and paste the url on the browser if things go right you d see the laravel welcome screen step 7 done you have successfully installed laravel on windows machine and ready to go with setting application key laravel requires little configuration after installation it requires you to set the application key this is a random string of 32 characters long used for encrypting session and other sensitive data usually this will be set automatically when you install laravel via composer or laravel installer in case it s not set you have to do it manually first make sure to rename the env example file to env on your application root then open command prompt and change to the laravel project folder now run the below command to generate the key php artisan key generate copy this generated key to the app_key variable on env file save and you are done installing specific laravel version the above given method will make composer to download and install the latest version of laravel if you want to install earlier versions of laravel on your machine make sure to include the respective version number on create project command composer create project laravel laravel 5 4 your project name prefer dist read also how to secure passwords in php and store in database how to change apache and mysql port number in xampp likewise you can easily install laravel using composer on windows i hope you find this tutorial useful please share it on your social circle if you like it how to create and download csv file in php posted by valli on 6 08 2018 be the first to comment hi here we will see how to create a csv file and download it using php csv is one of the popular data storage methods used on the web being a modern language php has no problems handling various data formats including csv it offers native functions to read and write csv files with fputcsv method you can write data as a csv file and force it to download clicking on a file url link will just open it in the browser window without downloading the exe and zip formats are an exception here but in case you need to download it directly to client s hard disk then you have to make use of the readfile function let s see how to do it php create csv file the following snippet creates a csv file named myfile csv on your current working directory php data array user array 1 johnson johnson mydomain com miami filename filename myfile csv write to csv file fp fopen filename w fputcsv fp user fclose fp okay we have created the csv file next we ll move on to the download part download csv file as i said before you must use readfile along with the proper header to force download of the file here s the code to do it php download file header content type text csv header content disposition attachment filename filename readfile filename sending the header along with the download option will force open the save file dialog in the user s browser window we have used two header functions in the above script the first one sets the mime type of the content sent since it is text csv for csv data we need to set it as the content type the second line provides the filename to be used for storing and force the browser to display the save dialog read also how to write json data to file using php download remote file from url using php curl that explains how to create csv file and automatically download it in php i hope you find this post useful please share it on social media if you like it how to use php preg match function to validate form input posted by valli on 6 03 2018 3 comments so far in this post we ll see how to do some basic php validations of form input using preg_match function one of the vulnerable spot in a website which attracts malicious hackers are the user input forms like registration form contact form etc validating the user input before processing is the first and foremost step in securing the site the validation includes checking if the data we received is in the right format and length generally it s a practice among web developers to do validation check at the client side like java script still it s easy for someone to break thru it and harm your site so it s strictly advisable to do these validations on the server side like php generally we receive the form input as string and we can use preg_match with appropriate regular expression to check a required pattern in the input string preg match syntax before dwelling into the validation process here take a sneak peak at the syntax of preg match function 1 form input should contain only alphabets say we have a name field in which we want the user to enter only alphabets then we can do the checking by this php code php name _post name if preg_match a za z name die invalid name where in the regular expression matches the start of the string and matches the end of the string also a za z is used in the expression to include both upper and lower case alphabets the above code checks each character of the string against the regular expression and throws error incase if there is any other character other than alphabet present in the string 2 form input should contain only alphanumeric characters in case we want a field eg username to contain only alphanumeric characters then we can alter the above preg_match expression to include 0 9 numbers too php username _post username if preg_match a za z0 9 username die invalid username 3 first character should be alphabet we can also force a field s first character to be an alphabet let s take the same username example it can contain alphanumeric characters but we want the first character to be an alphabet the below code will check if the first character is an alphabet php username _post username if preg_match a za z username die username should start with an alphabet instead of using the expression a za z we can use a z i also here i represents case independent ie includes both uppercase and lowercase alphabets 4 form input should contain alphanumeric with special characters what if you want the input field to contain special characters also here is an expression that let the string to have alphanumeric characters along with hyphen and space php if preg_match a za z name die invalid name 5 check for valid email id the below code will check if the given email id is a valid one php emailid _post emailid if preg_match a za z0 9 _ a za z0 9 a za z 2 4 emailid die invalid email id we have discussed so far some of the common validations we should employ while validating a form though it will take a while to warm up with regular expressions they are quite powerful and using the right expression will do the trick hope you would have enjoyed this article if you find this one useful please share it in your circle how to secure passwords in php and store in database posted by valli on 6 01 2018 1 comment so far hi here let s see how to secure passwords in php developers have a huge responsibility when handling sensitive user data such as password they must take necessary precautions to store the password and other sensitive information in a secure manner old school methods use the md5 algorithm to hash passwords and store them in the database this really is not safe and vulnerable to attack but thanks to the community php 5 5 and higher comes with the password_hash function that generates one way hash that is extremely secure to store passwords in the database below we will see how to securely hash passwords store them in the database and verify them against the user given password in php php secure way to store passwords if you are a budding developer these are some things to keep in mind when handling the password never store passwords as plain text it s as good as not having a password at all never use md5 or sha1 for hashing they are extremely fast and vulnerable to brute force attack a powerful gpu could easily break the md5 hash never try to make your own password hashing someone could easily outrun your smartness putting the system vulnerable don t even associate password with encryption as there is this chance to decrypt which is a big no instead you must use salted one way hashing for the password so what to use to protect passwords use password_hash with php v5 5 you are lucky to have the built in password_hash function that uses bcrypt algorithm to hash the password the good thing about bcrypt is that it is very slow compared to md5 and sha1 this makes it computationally expensive to brute force plus you can also change the algorithmic cost factor to make it tougher to break how to hash password to hash the password pass the password string and the algorithm you want to use for the password_hash php email mysqli_real_escape_string _post email password mysqli_real_escape_string _post password hash password_hash password password_bcrypt sql insert into users email password_hash value...
|