TechBeasts

TechBeasts - News and features about the internet and technology. Includes business solutions, science news, e-issues, entertainment and special reports.

  • Home
  • Tech
  • Apps and Software
  • Mobile
  • Privacy Policy
  • Disclaimer
  • DMCA
  • Download
Target:


How to send email from your local machine i.e. 127.0.0.1 known as localhost using PHP script?


How to Send Email From PHP Localhost Using WampServer Or XAMPP

Description of Task:

I'm feeling happy to share knowledge with you.
The following mentioned videos are to help you code in PHP script.


Videos about how can you search in Google and find appropriate code suitable to your idea...

This video is about to Send mail from localhost in PHP.

It's for all students and individuals who code...

Video describes that How to search on Google for a stuff and get help from various professional websites for programming like www.stackoverflow.com, etc.

Some useful guidance for beginners that how to search on Google or stackoverflow etc, and create your PHP script like an example shown in this video..

Target of Video is: Send mail from localhost in PHP.


Part 1:



Part 2:



Part 3:

Hello guys. Today I will explain how to create or export data from a database format in JavaScript Object Notation (JSON) using PHP MySQL.

JSON
JSON

JSON is a lightweight format for data exchange. It is easy for humans to read and write. It is easy for machines to parse and generate. It is lightweight, easy to read and easy to use for exchanging data across multiple platforms.

Today most APIs social networking applications like Facebook and Twitter using JSON data interchange format.

A JSON array begins with "[" and ends with "]". Among them, a series of values can reside. If more than one value below which are separated by "."

For instance:

  1. [  
  2.    {"id":"1","name":"Ehtesham","roll_no":"131","degree":"BSCS"},  
  3.    {"id":"2","name":"Raza","roll_no":"135","degree":"BSCS"}  
  4. ]  

JSON Object

An object begins with "{" dy ends with "}". Among them, a series of name / value pairs can reside chain. The name and value is separated by a ":" and if there is more than one name / value pairs then they are separated by ",".

For example:
{"id":"1","name":"Ehtesham","roll_no":"131","degree":"BSCS"}

PDO

The PHP Data Objects (PDO) defines a lightweight and consistent access to databases on the PHP interface. PDO provides access to data abstraction layer, which means that regardless of which database you are using, the same functions are used to query and retrieve data. Simply change the database drivers. Let's start with him. PHP reference.

Student table:

Student table

With SQL query 
  1. CREATE TABLE IF NOT EXISTS `student` (  
  2.   `id` int(10) NOT NULL AUTO_INCREMENT,  
  3.   `name` varchar(255) NOT NULL,  
  4.   `roll_no` varchar(255) NOT NULL,  
  5.   `degree` text NOT NULL,  
  6.   PRIMARY KEY (`id`)  
  7. )  
Records in MySQL
With Query:
  1. INSERT INTO `student` (`id`, `name`, `roll_no`, `degree`) VALUES  
  2. (1, 'Ehtesham', '131', 'BSCS'),  
  3. (2, 'Raza', '135', 'BSCS'),  
  4. (3, 'Zaryab', '117', 'BSCS'),  
  5. (4, 'Zaid', '112', 'BSCS'),  
  6. (5, 'Farrukh', '1244', 'BS Telecommunication'),  
  7. (6, 'Salman', '084', 'BSCS');  
index.php:
  1. <?php  
  2. //PDO is a extension which  defines a lightweight, consistent interface for accessing databases in PHP.  
  3. $db=new PDO('mysql:dbname=jason;host=localhost;','root','');  
  4. //here prepare the query for analyzing, prepared statements use less resources and thus run faster  
  5. $row=$db->prepare('select * from student');  
  6.   
  7. $row->execute();//execute the query  
  8. $json_data=array();//create the array  
  9. foreach($row as $rec)//foreach loop  
  10. {  
  11. $json_array['id']=$rec['id'];  
  12.     $json_array['name']=$rec['name'];  
  13.     $json_array['roll_no']=$rec['roll_no'];  
  14.     $json_array['degree']=$rec['degree'];  
  15. //here pushing the values in to an array  
  16.     array_push($json_data,$json_array);  
  17.   
  18. }  
  19.   
  20. //built in PHP function to encode the data in to JSON format  
  21. echo json_encode($json_data);  
  22.   
  23.   
  24. ?>  
Output in JSON format:
Output in JSON format



Progress Bar With Twitter Bootstrap in PHP

In this article I explain Progress Bars with Twitter Bootstrapping in PHP. A Progress Bar is a very simple. You can create them using the Twitter Bootstrap package and bootstrap2.0.3.css file. You can download the Twitter Bootstrapping file from the URL http://twitter.github.com/ otherwise you can download the full code of this article. After downloading this file you will put it in your PHP directory, then you will start the Progress Bar using this code. You can create a Progress Bar for loading and action status etcetera using the Twitter Bootstrap file.
 

Example

<html> 

  <head>  

    <title>Progress Bar</title> 

// this is you bootstrap2.0.3.css file 

    <link href="bootstrap.css" rel="stylesheet"> 

    <link href="twitter-bootstrap-v2/docs/assets/css/example-fixed-layout.css" rel="stylesheet"> 

    <link rel="shortcut icon" href="twitter-bootstrap-v2/docs/examples/images/favicon.ico"> 

    <link rel="apple-touch-icon" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon.png"> 

    <link rel="apple-touch-icon" sizes="72x72" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-72x72.png"> 

    <link rel="apple-touch-icon" sizes="114x114" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-114x114.png"> 

  </head> 

  <body> 

    <div class="container"> 

    <div class="row"> 

    <div class="span5"> 

    <h3>Basic Progress Bar</h3> 

    <div class="progress"> 

    <div class="bar" style="width: 70%;"></div> 

  </div> 

    <h3>Striped Progress Bar</h3> 

    <div class="progress progress-striped"> 

    <div class="bar" style="width: 50%;"></div> 

    </div> 

    <h3>Animated progress barr</h3> 

    <div class="progress progress-striped active"> 

  <div class="bar" style="width: 70%;"></div> 

</div> 

    </div> 

    </div> 

    <hr> 

</div>

</body> 

</html>

Output

progress.jpg
In the next example I show the use of a Progress Bar with additional color.

Example

<html> 

  <head> 

    <title>Progress Bar with Additional Color</title>

// this is you bootstrap2.0.3.css file        

    <link href="bootstrap.css" rel="stylesheet">  

    <link href="twitter-bootstrap-v2/docs/assets/css/example-fixed-layout.css" rel="stylesheet"> 

    <link rel="shortcut icon" href="twitter-bootstrap-v2/docs/examples/images/favicon.ico"> 

    <link rel="apple-touch-icon" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon.png"> 

    <link rel="apple-touch-icon" sizes="72x72" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-72x72.png"> 

    <link rel="apple-touch-icon" sizes="114x114" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-114x114.png"> 

  </head> 

  <body> 

  //start div container

    <div class="container">  

    <div class="row"> 

    <div class="span5"> 

    <h3>Progress Bars with additional colors</h3> 

    <div class="progress progress-info progress-striped" style="margin-bottom: 10px;"> 

    <div class="bar" style="width: 10%"></div> 

    </div> 

    <div class="progress progress-success progress-striped active" style="margin-bottom: 10px;"> 

    <div class="bar" style="width: 30%"></div> 

    </div> 

    <div class="progress progress-warning progress-striped" style="margin-bottom: 10px;"> 

    <div class="bar" style="width: 50%"></div> 

    </div> 

    <div class="progress progress-danger progress-striped active" style="margin-bottom: 10px;"> 

    <div class="bar" style="width: 70%"></div> 

    </div> 

    </div> 

    </div> 

    </div> 

   <hr> 

</div>

//end div container 

</body> 

</html> 

Output 

progress1.jpg
Older Posts Home

Popular Posts

  • Typo iPhone Keyboard Gets a Redesign, But BlackBerry Influence Remains
    Image: Typo 2 After a brush with litigation, iPhone case creator Typo has come back swinging with a new keyboard design that it cla...
  • The Best Websites to Learn Coding Online
    The Learn to Code movement, with the backing of the likes of Obama and Bill Gates , is picking up momentum worldwide and that is actuall...
  • The 10 Things You Should Include In Your Website
    Your website has a beautiful design with tons of useful content but there may sill be scope for improvement in other areas. For instance, do...
  • How to Work Offline in Google Chrome
    When you open any web page inside Google Chrome, it connects to the Internet, fetches the latest version of the page from the server and d...
  • This App Lets You Ask a Doctor Any Question in Real-Time via Smartphone
      Image: John Lamb, Photodisc Health apps and the wearable trackers that connect to them are giving us more data about our personal h...
  • How to Send Personalized Emails using Mail Merge in Gmail
    Mail Merge is a popular feature of Microsoft Outlook and Word but if you happen to live in the world of Gmail or Google Apps, no worries as ...
  • How To Create MS Word Document in PHP
    How To Create MS Word Document in PHP Introduction In this article I explain how to create a Word document file by PHP. A document file is c...
  • Chunk of Japanese boat thought to be tsunami shipwreck found in Oregon
    Chunk of Japanese boat thought to be tsunami shipwreck found in Oregon A 25-foot-long chunk of fiberglass that likely belonged to a Japanes...
  • Facebook to Shut Down Gifts Service, Again
      Image: Mashable Composite, Facebook, Getty Creative, mstay   Remember Facebook Gifts, the social network's service that let you b...
  • ANDROID AND THE EMERGING WORLD OF SMARTPHONES
    INTRODUCTION TO SMART PHONES: A smart phone is mobile phone with advance processing ability and connectivity than basic parent phones. Smart...

About

eXTReMe Tracker

MapUsers

Copyright © 2015 TechBeasts

Created By ThemeXpose