Month: May 2014

How to add loading spinner image(page load images) in php using javascript

PHP Code:-

<html>
<head>

function preloader(){
document.getElementById(“loading”).style.display = “none”;
document.getElementById(“load_images”).style.display = “none”;
document.getElementById(“contents”).style.display = “block”;
}//preloader
window.onload = preloader;

<style>
#load_images{ background-color: #000000;
display: block;
height: 100%;
left: 0;
opacity: 0.6;
position: fixed;
top: 0;
width: 100%;
z-index: 9999;}
div#contents {
display: block;
}
#loading {
top: 50%;
left: 50%;
position: absolute;
cursor: wait;
}
</style>
</head>
<body>

<input type=”submit”>

Your Contain here……

</body>
</html>

Send email by using codeigniter library via localhost

public function sendemail(){
  $config = Array(
  ‘protocol’ => ‘smtp’,
  ‘smtp_host’ => ‘ssl://smtp.googlemail.com’,
  ‘smtp_port’ => 465,
  ‘smtp_user’ => ‘your email@gmail.com’,
  ‘smtp_pass’ => ‘your email password’,
);
  $this->load->library(’email’, $config);
  $this->email->set_newline(“\r\n”);
  $this->email->from(‘your email@gmail.com’, ‘your Name’);
  $this->email->to(’email@yahoo.com’);
  $this->email->subject(‘ Your Subject here.. ‘);
  $this->email->message(‘Your Message here..’);
  if (!$this->email->send()) {
    show_error($this->email->print_debugger()); }
  else {
    echo ‘Your e-mail has been sent!’;
  }
}