Posts

Showing posts from September, 2018

File Upload Example

<?php if(isset($_POST['submitUpload'])){ if(isset($_FILES['fileInput'])){ $tmp=$_FILES['fileInput']; $fileName=$tmp['name']; $tmpPath=$tmp['tmp_name']; $fileSize=$tmp['size']; $arr=explode(".",$fileName); $ext=end($arr); $allowedExt=array("jpg","png","jpeg","bmp"); if(in_array($ext,$allowedExt)){ if($fileSize <= (1024*1024*2)){ move_uploaded_file($tmpPath,"uploaded_files/".$fileName); echo "file Uploaded Successfully"; } else{ echo "file must not be grater then 2MB"; } } else{ echo "File type '{$tmp['type']}' not allowed"; } } else{ echo "File is not uploaded"; } } ?> <html> <head><title>File Upload</title></head> <body> <form action="<?php echo $_SERVER['PHP_SELF'

Login Example with validation

you can use minimum validation shown validation is more then enough <?php $usernameError=""; $passwordError="";         $loginError=""; if(isset($_POST['login'])){ $username=$_POST['username']; $password=$_POST['password']; if(empty($username)){ $username="Username is required"; }else if(empty($password)){ $username="password is required"; } else{ $username=filter_input($username); $password=filter_input($password); $con=mysql_connect("localhost","root",""); if(!$con){ echo "Unable To connect Database. "; die(); } mysql_select_db("dbname"); $result=mysql_query("select * from users where username='{$username}'"); if(mysql_num_rows($result)==0){ $loginError="User do not exist."; }else{ $row=mysql_fetch_array($result); if($row['passw

free hosting

https://infinityfree.net/ Free SSL on all websites, Free Cloudflare CDN https://profreehost.com/ http://www.ultimatefreehost.in/ https://www.freehosting.io/ Unlimited SSD Storage / SSL https://googiehost.com/ 1GB SSD / Single Domain https://x10hosting.com/ 1-Click Software Installation for Extra work 110mb -  http://110mb.com Ripway -  http://ripway.com SuperFreeHost -  http://superfreehost.info Freehostia -  http://freehostia.com Freeweb7 -  http://freeweb7.com t35 -   http://t35.com Awardspace -  http://awardspace.com PHPNet -  http://phpnet.us Free Web Hosting Pro -  http://freewebhostingpro.com ProHosts -  http://prohosts.org FreeZoka -  http://www.freezoka.com/ 000webhost -  http://000webhost.com/ AtSpace -  http://atspace.com

My Git Repo

git clone https://hmdlohar@bitbucket.org/hmdlohar/files-special.git https://github.com/hmdlohar/old-dumps.git https://github.com/hmdlohar/firefox-old.git https://github.com/hmdlohar/test.git #git@gitlab.com:hmdlohar/cookieManager.git https://gitlab.com/hmdlohar/old-gc-addon.git https://gitlab.com/hmdlohar/php-sqls.git https://gitlab.com/hmdlohar/php-hmdmaster.git https://gitlab.com/hmdlohar/gc-hmdmaster.git https://gitlab.com/hmdlohar/php-fblohar2.git https://gitlab.com/hmdlohar/php-vnsgu.git https://gitlab.com/hmdlohar/php-tally.git https://gitlab.com/hmdlohar/android-ccbyhmd.git https://gitlab.com/hmdlohar/mbasic.git https://gitlab.com/hmdlohar/gc.git https://gitlab.com/hmdlohar/cookieManager.git https://gitlab.com/hmdlohar/hyperPrint.git git@gitlab.com:hmdlohar/cookieManager.git git@gitlab.com:hmdlohar/old-gc-addon.git git@gitlab.com:hmdlohar/php-sqls.git git@gitlab.com:hmdlohar/php-hmdmaster.git git@gitlab.com:hmdlohar/gc-hmdmaster.git git@gitlab.com

git basic info

Image
https://docs.google.com/presentation/d/1Zy_Djb-yvJXKQXabi0rfei1sm8JVLNCI7s0mxcMstvE/edit?usp=sharing