Saturday, 24 May 2014

USB drive don't show your files

Hi friendz, my pen drive was affected by virus, then i cleared the virus using anti virus program. After that my usb files do not show to me when i try to load. But which gives the properties and sizes of the files.

Then i googled and find out the followin solution,

open command prompt and type the following

attrib -s -h -r G:*.* /s /d

Above I used G drive as my pen drive location. Change according yours.

try the trick buddies...

Saturday, 17 May 2014

Linux Web Server - Putty Commands

Hi Friendz, As we all know max. php web applications are run on Linux based web servers online. Putty tool does important role on connecting the web and do things very quickly.

So, have a look at the following commands for instant doings through putty tool in windows..

MySQL restart

#service mysqld stop

#service mysqld start

#service mysqld restart

Apache restart

#service httpd stop

#service httpd start

#service httpd restart

Other Basic Commands

listing Folders....

use "ls" instead of "dir"

For Entering into Directory..

cd folder_name

deleting Directory

rm folder_name

Friday, 9 May 2014

How to send emails from localhost in Xampp / Wamp / Lamp (PHP)

Hi friendz,

PHP mail function is very important one in project development. When we go to use and test this mail(), it would be working great in web servers but in localhost we may face more problems, ok we will test, how to solve this,

here we go,

First in your appache installation folder, check your php folder and inside open php.ini file.

search for a word (sendmail_path) and then you can see like below line code,

;sendmail_path = "\"E:\xampp\sendmail\sendmail.exe\" -t"

make a uncomment that file like below

sendmail_path = "\"E:\xampp\sendmail\sendmail.exe\" -t"

and you can see one more file

;sendmail_path="E:\xampp\mailtodisk\mailtodisk.exe"

dont uncomment the above one, let it be same like this

and then go to sendmail folder in your xampp path and open that folder
inside open that sendmail.ini file

here we use Gmail email configuration for our setup.

in smtp_server set up make it like below

smtp_server=smtp.gmail.com

and smtp_port make it like below

smtp_port=587

and finally one more thing

auth_username=your gmail username
auth_password=your gmail password

that is it guys. restart your apache and mysql, then it will be working sweetly.

Hope you guys get it easily.

 

 

 

Thursday, 8 May 2014

rmdir (Remove directory) in php

rmdir (Remove directory) is a  function in php. which is very useful in projects. sometimes when we try to remove files from server and localhost somewhat issues will be occurred even though we pass correct values with right functions, This things major on making directories and deleting directories.

so use the following simple php script for remove directories.
<?php
function rrmdir($dir){if(is_dir($dir)){
$objects
= scandir($dir);foreach($objects as $object){if($object !="."&& $object !=".."){if(filetype($dir."/".$object)=="dir")
rrmdir
($dir."/".$object);else unlink ($dir."/".$object);}}
reset
($objects);
rmdir
($dir);}}
?>

Hope it will be helpful for you guys.

Tuesday, 6 May 2014

Redirect Methods

Redirecting is very important method in web programming. Yes, Now we gonna see how to use Jquery & PHP default redirect functions in development.

Method 1: Redirection using Javascript
For any reason if you want to implement Redirection in your web application using Javascript. Then use this method. Jquery is not necessary to implement this way.

// It work same as HTTP redirect
window.location.replace("http://webexpertlabs.com");

// work same as above as it works for every browser
window.location.href = "http://webexpertlabs.com";

// alternative way and sometimes not compatible to some browser
window.location = "http://webexpertlabs.com";

Method 2: Redirection using Jquery
If you want to redirect your webpage using Jquery then you can follow this way.
Jquery library is needed to implement this feature.

var url = "http://webexpertlabs.com";
$(location).attr('href',url);

Method 3: Redirection using PHP
If you need to implement server side redirection in your Web application then you can use this way. Jquery has nothing to do in this method to Redirect Webpage using PHP

<!--?php
header("location:http://webexpertlabs.com");
?>
Enjoy!!! Hopefully this simple script helped you with your web development.
Source : webexpertlabs