Search Google

Tuesday 3 March 2015

Best php project and code

Best php code

Attendance Management System

Php Projects for Students Free Download with Source Code

Project Name Technology Download
Mailing Server Html, css, javascript, php, mysql Download
Online Examination Html, css, javascript, php, mysql Download
Facebook Html, css, javascript, php, mysql Download
Hostel Management System Html, css, javascript, php, mysql Download
Mailing server Html, css, javascript,php(filesytem) Download


Download php Project Source Code

1. ICTDialer

ICTDialer is very promising open source voice broadcasting platform. ICTDialer is developed over Drupal and Freeswitch based powerful Plivo Communication Framework . It can be scaled to blast thousands of simultaneous calls using either VoIP, Foip or PSTN. ICTDialer capable to fit in many broadcasting and telemarketing scenarios. ICTDialer is developed and maintained by ICTInnovations.

2. Newfies Dialer

Newfies-Dialer is a voice broadcast application designed and built to automate the delivery of interactive phone calls to contacts, clients and the general public. A Newfies-Dialer Voice Broadcasting Platform is assembled entirely from free and open source components including FreeswitchDjango,  PlivoCelery and RabbitMQ. Newfies Dialer is developed and maintained by Star2Billing.

3. Vicidial php open source 


Create Beautiful Fullscreen Scrolling Websites using pagePiling.js

In today's web design and development world, continuous changes and improvements are being made to make the web experience better and better. In this process, the role of JavaScript and jQuery plugins is very important. In this tutorial we'll be learning one of the same jQuery plugin called "pagePiling.js" to create a scrolling pile of sections for your website.

Before jumping into the steps of creating a Fullscreen Scrolling webpage with pagePiling.js, why don’t we have a look at what pagePiling.js really is?

Created By : alvarotrigo

Demo | Download


How to Export MySQL Data into CSV or Excel Format

How to Export MySQL Data into CSV Format

Writing this post after so many days due to busy schedule.A most popular post on "How to Import CSV file Data into Mysql Using PHP" has already been written.

Now we'll learn totally opposite procedure of that tutorial.In this tutorial you will see how to export MySQL Data into CSV or Excel Format.Its just a single script and very easy to understand.
Logic of Script
-- Establish Connection
-- Select your Database
-- Fetching Data from the table
-- Get total no. of the fields using mysql_num_fields
-- Get the names of the fields through the loop using mysql_field_name
-- The header() function sends a raw HTTP header to a client.To know more about the options please refer below links

Script File index.php

//database connection details
$connect = mysql_connect('localhost','root','');
//your database name
//selecting records from the table
$query = "SELECT * FROM csvtbl limit 50";
$header = '';
$data ='';
$export = mysql_query ($query ) or die ( "Sql error : " . mysql_error( ) );
$fields = mysql_num_fields ( $export );
for ( $i = 0; $i < $fields; $i++ )
    $header .= mysql_field_name( $export , $i ) . "\t";
while( $row = mysql_fetch_row( $export ) )
    $line = '';
    foreach( $row as $value )
        if ( ( !isset( $value ) ) || ( $value == "" ) )
            $value = "\t";
            $value = str_replace( '"' , '""' , $value );
            $value = '"' . $value . '"' . "\t";
        $line .= $value;
    $data .= trim( $line ) . "\n";
$data = str_replace( "\r" , "" , $data );
if ( $data == "" )
    $data = "\nNo Record(s) Found!\n";                        
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=Export.xls");
header("Pragma: no-cache");
header("Expires: 0");
print "$header\n$data";
Thats it..!! and so simple tutorial ends here :)

The form will look like this:
php script to send mail with attachment
HTML form for Sending Email with File Attachment in PHP.
Please note that we have added:
while defining the <form> tag. This is to tell the browser that this form will be used to upload files. Then we have added the “name” and “email” fields to collect the user info. The third form field is the file upload box.
<input type=”file” name=”image”>
On hitting the “Submit” button, the form data along with the file data is posted to the script pointed to by the ‘action’ attribute of the form.
php script to send mail with attachment
Now we almost finished form designing part.
Now just follow php part coding. I am using php mail plugin to send an email with attachment.
Step 1:
Create mail.php file and add the following php file (class.phpmailer.php).
require 'class.phpmailer.php';
Step 2:
Now add to email ID.
$to = "Your email ID";
Step 3:
Now get from email id and name of the user.
$mail->From = $_POST['femail'];
$mail->FromName = $_POST['name'];
Step 4:
Now add subject of the mail.
$mail->Subject = "Test Email using PHP";
Step 5:
Now get message from the html form.
$body = “<table>
<th colspan=’2′>This Sample Mail</th>
<td>Name :</td>
<td>E-mail : </td>
<td>Phone : </td>
<tr> <td>Message : </td> <td>”.$_POST[‘message’].”</td> </tr> <table>”;
$body = preg_replace(‘/\\\\/’,”, $body); //Strip backslashes
Step 6:
Finally get the attachment and send it.

    $mail->IsHTML(true); // send as HTML

    echo 'Message has been sent.';
Here is the full php source code.
* Simple example script using PHPMailer with exceptions enabled
* @package phpmailer
* @version $Id$
require ‘class.phpmailer.php';
try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$to = $_POST[‘email’];
$mail->From = $_POST[‘femail’];
$mail->FromName = $_POST[‘name’];
$mail->Subject = “Test Email using PHP”;
$body = “<table>
<th colspan=’2′>This Sample Mail</th>
<td style=’font-weight:bold’>Name :</td>
<td style=’font-weight:bold’>E-mail : </td>
<td style=’font-weight:bold’>Phone : </td>
<td style=’font-weight:bold’>Message : </td>
$body = preg_replace(‘/\\\\/’,”, $body); //Strip backslashes
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
//$mail->Host = “”; // SMTP server
//$mail->Username = “”; // SMTP server username
//$mail->Password = “password”; // SMTP server password
$mail->IsSendmail(); // tell the class to use Sendmail
$mail->AltBody = “To view the message, please use an HTML compatible email viewer!”; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap
$mail->IsHTML(true); // send as HTML
echo ‘Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
Hope this code works well for all for sending all type of files (word files,PDF files and images etc………..)

php script to send mail with attachment
Example Php Email with File attachment and Images

No comments:

Post a Comment