This document provides code snippets and instructions for building a Gmail clone tutorial. It includes CSS for styling pages, PHP files for connecting to a database and managing user sessions, and scripts for user registration, login, viewing emails, composing emails, and more. The document is split into multiple pages that each focus on a different aspect of the tutorial, such as styling specific pages, database structure, or functionality for certain actions. Overall, the document aims to teach how to develop a basic email application by providing the necessary code components.
Responsive web design allows you to create websites that provide an optimal user experience across devices. In this session, attendees learned why the process for designing a (good) responsive website can be very different than the traditional web design process—and how to change their workflow to create a great responsive site.
Presented in 2015 at McFullStack (McGill University, Montreal). Presented in 2014 at HOW Interactive Design Conference in Washington, DC & HOW Interactive Design Conference in Chicago, IL.
Although responsive web design has only been around for a few years, it's grown up a lot since first we started talking about fluid grids and media queries. Now, we look to responsive design with the goal of providing a good experience for every user on every device. From the DC Web Women Code(Her) Conference, 9/13/14.
Modifying your themes design - Learning CSS - Atlanta WordPress users groupEvan Mullins
The presentation overviews the internet, teaches us how to spell HTML and other web programming "languages" that come together to form a WordPress website, like HTML, CSS & PHP. We even discussed web development tools like FTP clients and which text editors to use. We went over what makes up a wordpress theme and then the concept of child themes. Discussed the process of creating your own child theme with just a couple files and that you can create a child theme for any theme out there. We demoed how to view source and dissect any website, but more importantly, how to inspect elements on your site and live-edit the css for any element. Then to write these CSS rules to our theme to lock in the edits in your child theme.
Responsive web design allows you to create websites that provide an optimal user experience across devices. In this session, attendees learned why the process for designing a (good) responsive website can be very different than the traditional web design process—and how to change their workflow to create a great responsive site.
Presented in 2015 at McFullStack (McGill University, Montreal). Presented in 2014 at HOW Interactive Design Conference in Washington, DC & HOW Interactive Design Conference in Chicago, IL.
Although responsive web design has only been around for a few years, it's grown up a lot since first we started talking about fluid grids and media queries. Now, we look to responsive design with the goal of providing a good experience for every user on every device. From the DC Web Women Code(Her) Conference, 9/13/14.
Modifying your themes design - Learning CSS - Atlanta WordPress users groupEvan Mullins
The presentation overviews the internet, teaches us how to spell HTML and other web programming "languages" that come together to form a WordPress website, like HTML, CSS & PHP. We even discussed web development tools like FTP clients and which text editors to use. We went over what makes up a wordpress theme and then the concept of child themes. Discussed the process of creating your own child theme with just a couple files and that you can create a child theme for any theme out there. We demoed how to view source and dissect any website, but more importantly, how to inspect elements on your site and live-edit the css for any element. Then to write these CSS rules to our theme to lock in the edits in your child theme.
MOBILE SEO - O CZYM MUSISZ PAMIĘTAĆ, Łukasz ŻeleznyMiritec
- Answerboxes czym są i jak o nie dbać
- Mobilny layout - za i przeciw
- Snapshot keywords - opis metody przy wyszukiwaniu słów kluczowych
- uStyle - czym jest i jak go stosować
Buffer is known to be the better way to share in social media. It shares your content at the best possible times throughout the day so that your followers and fans see your updates more often. The goal is to get the most out of each post. You can use Buffer to post to all of your social networks, posting the same message to all accounts or add context by customizing each one.
You can also create your own content with the perfect size and format for Twitter, Facebook, Instagram, and even Pinterest.
Getdrip Part 2 - How to Connect Getdrip to Your Hosted WordpressMaridel Reyes
Getdrip is lightweight email marketing automation that doesn't suck. It has the ability to trigger an email, campaign or tag based on any action a user takes, be it expressing interest in a topic, downloading a sample chapter of your book, starting a trial of your software, or viewing your upgrade page.
Want to experience marketing automation that doesn't suck? Try using Getdrip.
Slideshare is the perfect place to share what you know and love through presentations, infographics, documents and more. Check out this presentation to find out tips on How to Maximise the Use of Slideshare.
Get yourself a domain name and a web host provider so you can start setting up your hosted Wordpress website. Here is a step by step tutorial on How to Start a Hosted Wordpress Site.
This is Part 1 of 2 of my Wordpress tutorial.
Learn how to use Pocket (Read it Later), an app for saving interesting articles, videos and more from the web for later enjoyment. Once saved to Pocket, the list of content is visible on any device — phone, tablet or computer. The contents are visible even if you are offline.
It is available for major devices and platforms including iPad, iPhone, Android, Mac, Google Chrome, Windows,etc.
Wordpress is the easiest way to create a website. Use Wordpress to promote your business and personal brand.
Welcome to Part 2/2 of my Wordpress tutorial.
Getdrip is lightweight email marketing automation that doesn't suck. It has the ability to trigger an email, campaign or tag based on any action a user takes, be it expressing interest in a topic, downloading a sample chapter of your book, starting a trial of your software, or viewing your upgrade page.
Want to experience marketing automation that doesn't suck? Try using Getdrip.
MOBILE SEO - O CZYM MUSISZ PAMIĘTAĆ, Łukasz ŻeleznyMiritec
- Answerboxes czym są i jak o nie dbać
- Mobilny layout - za i przeciw
- Snapshot keywords - opis metody przy wyszukiwaniu słów kluczowych
- uStyle - czym jest i jak go stosować
Buffer is known to be the better way to share in social media. It shares your content at the best possible times throughout the day so that your followers and fans see your updates more often. The goal is to get the most out of each post. You can use Buffer to post to all of your social networks, posting the same message to all accounts or add context by customizing each one.
You can also create your own content with the perfect size and format for Twitter, Facebook, Instagram, and even Pinterest.
Getdrip Part 2 - How to Connect Getdrip to Your Hosted WordpressMaridel Reyes
Getdrip is lightweight email marketing automation that doesn't suck. It has the ability to trigger an email, campaign or tag based on any action a user takes, be it expressing interest in a topic, downloading a sample chapter of your book, starting a trial of your software, or viewing your upgrade page.
Want to experience marketing automation that doesn't suck? Try using Getdrip.
Slideshare is the perfect place to share what you know and love through presentations, infographics, documents and more. Check out this presentation to find out tips on How to Maximise the Use of Slideshare.
Get yourself a domain name and a web host provider so you can start setting up your hosted Wordpress website. Here is a step by step tutorial on How to Start a Hosted Wordpress Site.
This is Part 1 of 2 of my Wordpress tutorial.
Learn how to use Pocket (Read it Later), an app for saving interesting articles, videos and more from the web for later enjoyment. Once saved to Pocket, the list of content is visible on any device — phone, tablet or computer. The contents are visible even if you are offline.
It is available for major devices and platforms including iPad, iPhone, Android, Mac, Google Chrome, Windows,etc.
Wordpress is the easiest way to create a website. Use Wordpress to promote your business and personal brand.
Welcome to Part 2/2 of my Wordpress tutorial.
Getdrip is lightweight email marketing automation that doesn't suck. It has the ability to trigger an email, campaign or tag based on any action a user takes, be it expressing interest in a topic, downloading a sample chapter of your book, starting a trial of your software, or viewing your upgrade page.
Want to experience marketing automation that doesn't suck? Try using Getdrip.
Instituto Nacional de Psiquiatría (México)
XXIV Reunión Anual de Investigación
6 de octubre del 2009
Demencias: Avances moleculares y psicosociales
Presentan: Dr. Oscar Ugalde, Dra. Clorinda Arias, Dra. Gloria Benítez, Dra. Carmen Lara.
Caracteristias e electro normal:
Onda P: producida por los potenciales que se generan al despolarizarse las aurículas
Complejo QRS: potenciales que se generan cuando se despolarizan las aurículas
Onda T: esta producida cuando los ventrículos se recuperan al estado de despolarización
RELACION DE LA CONTRACCION AURICULAR Y VENTRICULAR CON LAS ONDAS DEL ELECTROCARDIOGRAMA
Las aurículas se repolarizan aprox. 0.15s a 0.2 después de la finalización de la onda P coincide con el complejo QRS (raras veces se observa la onda T auricular en el elec.) la despolarización del complejo QRS
0.2s y el proceso de repolarizacion tarda hasta 0.35s (por eso la onda T es muy prolongada)
CALIBRACION DEL VOLTAJE Y EL TIEMPO DEL ELECTROCARDIOGRAMA.
LINEAS HORIZONTALES: están dispuestas de modo que 10 de las divisiones de las líneas pequeñas hacia arriba o hacia abajo repres 1mV. Con la positividad hacia arriba y la neg. Hacia abajo.
LINEAS VERTICALES: son las líneas de calibración del tiempo
Un electrocardiograma típico se realiza a una velocidad de papel de 25 mm.s =1s y cada segmento de 5mm representa 0.2s
VOLTAJES NORMALES EN EL ELECTROCARDIOGRAMA
Depende de la manera en la que se aplican los electrodos a la superficie del cuerpo y la proximidad de los electrodos del corazón.
DETERMINACION DE LA FRECUENCIA DEL LATIDO CARDIACO A PARTIR DEL ELECTROCARDIOGRAMA.
La frecuencia cardiaca: es el reciproco del intervalo del tiempo entre dos latidos cardiacos sucesivos.
1s = 60 latidos x min.
El intervalo normal en una persona adulta es de aprox. 0,83 veces por minuto o 72 latidos.
To understand the market for Cadbury, Hershey’s and Ferrero Rocher, to analyze the preference of the people, to understand the buyer behaviour regarding this particular brand & to analyze the reason for liking or disliking any of these particular brand.
Não é nenhum segredo que o mundo está cada vez mais móvel. As vendas de PCs caíram em 20% desde 2008, e em 2015 é esperado que o acesso à Internet por dispositivos portáteis supere o acesso por desktops. A Web pode ser acessada de qualquer lugar, a qualquer hora. Mas com tantos modelos de dispositivos—tablets, notebooks, netbooks e smartphones—como fazer com que seu produto funcione em todos?
O Responsive Web Design—um conjunto de técnicas e ideologias—promete solucionar este problema, oferecendo o mesmo conteúdo em todas as plataformas, da melhor maneira. Nesta palestra, serão ensinadas técnicas de design, front e back-end para que seu site seja usável e acessível por todos, sem limitar-se a modelos, tamanhos de tela ou versões específicas.
A hands-on workshop for DC Web Women on August 14, 2012.
Read more about the workshop and a summary of what we talked about on my blog: http://www.clarissapeterson.com/2012/08/responsive-web-design/
Learn to love CSS3 | Joomla! Day DeutschlandThemePartner
Curious to know what this CSS3 hype is all about? Visit this presentation to learn that it isn't just a hype. CSS3 adds awesome new capabilities to a front-end developer's palette of tools to create a beautiful (and functional) website.
Learn more about several of the best new options that CSS3 is giving us, the current level of browser support for CSS3, and lots of useful resources to keep yourself up-to-date and learn more.
If you want to learn how to style your website using CSS3, then this is a presentation you don't want to miss!
Video of JandBeyond 2012:
http://www.youtube.com/watch?feature=player_embedded&v=EAKxs2ixsBY
An overview of the CSS preprocessor LESS.
Including code samples for creating mixins, variables, math, colors, patterns, guards, scope, and namespaces.
Curious to know what this CSS3 hype is all about? Visit this presentation to learn that it isn't just a hype. CSS3 adds awesome new capabilities to a front-end developer's palette of tools to create a beautiful (and functional) website.
Learn more about several of the best new options that CSS3 is giving us, the current level of browser support for CSS3, and lots of useful resources to keep yourself up-to-date and learn more.
If you want to learn how to style your website using CSS3, then this is a presentation you don't want to miss!
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBrad Spiegel Macon GA
Brad Spiegel Macon GA’s journey exemplifies the profound impact that one individual can have on their community. Through his unwavering dedication to digital inclusion, he’s not only bridging the gap in Macon but also setting an example for others to follow.
1.Wireless Communication System_Wireless communication is a broad term that i...JeyaPerumal1
Wireless communication involves the transmission of information over a distance without the help of wires, cables or any other forms of electrical conductors.
Wireless communication is a broad term that incorporates all procedures and forms of connecting and communicating between two or more devices using a wireless signal through wireless communication technologies and devices.
Features of Wireless Communication
The evolution of wireless technology has brought many advancements with its effective features.
The transmitted distance can be anywhere between a few meters (for example, a television's remote control) and thousands of kilometers (for example, radio communication).
Wireless communication can be used for cellular telephony, wireless access to the internet, wireless home networking, and so on.
This 7-second Brain Wave Ritual Attracts Money To You.!nirahealhty
Discover the power of a simple 7-second brain wave ritual that can attract wealth and abundance into your life. By tapping into specific brain frequencies, this technique helps you manifest financial success effortlessly. Ready to transform your financial future? Try this powerful ritual and start attracting money today!
Italy Agriculture Equipment Market Outlook to 2027harveenkaur52
Agriculture and Animal Care
Ken Research has an expertise in Agriculture and Animal Care sector and offer vast collection of information related to all major aspects such as Agriculture equipment, Crop Protection, Seed, Agriculture Chemical, Fertilizers, Protected Cultivators, Palm Oil, Hybrid Seed, Animal Feed additives and many more.
Our continuous study and findings in agriculture sector provide better insights to companies dealing with related product and services, government and agriculture associations, researchers and students to well understand the present and expected scenario.
Our Animal care category provides solutions on Animal Healthcare and related products and services, including, animal feed additives, vaccination
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC
Ellisha Heppner, Grant Management Lead, presented an update on APNIC Foundation to the PNG DNS Forum held from 6 to 10 May, 2024 in Port Moresby, Papua New Guinea.
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfFlorence Consulting
Quattordicesimo Meetup di Milano, tenutosi a Milano il 23 Maggio 2024 dalle ore 17:00 alle ore 18:30 in presenza e da remoto.
Abbiamo parlato di come Axpo Italia S.p.A. ha ridotto il technical debt migrando le proprie APIs da Mule 3.9 a Mule 4.4 passando anche da on-premises a CloudHub 1.0.
2. Follow more tutorials at www.23tutorials.com Page 2
Thanks for downloading this video sharing tutorial
eBook.
You are free to distribute this eBook with your
friends and colleagues. We have many tutorials like;
how to create a social network tutorial like Facebook
in php and JavaScript,
Ho to create twitter tutorial in php and JavaScript,
Ho to create Gmail tutorial in php and JavaScript,
Ho to create twitter web plug-in like who is online.
Visit our website to follow and download all this
tutorials for free at www.23tutorials.com
3. Follow more tutorials at www.23tutorials.com Page 3
Gmail tutorial
Index.css………………………………………………………..4
Home.css......................................................................................8
Connection.php………………………………………………...25
Function.php……………………………………………………26
Registration script………………………………………………27
Login script……………………………………………...36
Show user profile name / photo script…………………41
How to search emails script…………………………….44
How to compose email script……………………………48
How to view inbox email script…………………………53
How to view full email script…………………………….57
How to reply email script………………………………..67
How to download email file script……………………….70
How to delete email script ………………………………77
How to draft email script………………………………...82
How to view draft email script…………………………..87
How to view outbox email script…………………………91
4. Follow more tutorials at www.23tutorials.com Page 4
How edit account script…………………………………..95
Index.css
This css is for styling the index.php page.
body{
margin-left:-0%;
margin-top:0%;
margin-right:-0%;
background-color:#dddddd;
}
#index_page_header{
position:fixed;
background-color:blue;
width:1280px;
height:80px;
top:-21px;
left:0px;
z-index: 2;
}
#registration_div{
background-color:;
width:304px;
height:420px;
position:absolute;
25. Follow more tutorials at www.23tutorials.com Page 25
connection.php
This php file connectsthis tutorial to the database.
<?php
$mysql_hostname= "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "learn"; //database name, you can change to yours
$prefix = "";
$bd = mysql_connect($mysql_hostname, $mysql_user,
$mysql_password) or die("Could not connect database");
mysql_select_db($mysql_database, $bd) or die("Could not select
database");
?>
26. Follow more tutorials at www.23tutorials.com Page 26
function.php
This php file stores the login user session.
<?php
include("connection.php");
if(isset($_SESSION["SESS_MEMBER_ID" ] ) ) {
$result = mysql_query("SELECT member_id FROM `member`
WHERE
`member_id`='".$_SESSION["SESS_MEMBER_ID"]." ' LIMIT
1");
if(mysql_num_rows($result)) {
$row = mysql_fetch_array($result);
$_SESSION["logged"] = $row["member_id"];
}
}
?>
27. Follow more tutorials at www.23tutorials.com Page 27
Registration script
This is the registration form where user can sign up to have an email
account.
Below is the database where all the user information will be kept.
CREATE TABLE IF NOT EXISTS `member` (
`member_id`int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(30) NOT NULL,
`secondname` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`sex` varchar(100) NOT NULL,
`password` varchar(30) NOT NULL,
`profile_picture` varchar(30) NOT NULL,
`day` varchar(100) NOT NULL,
`month` varchar(30) NOT NULL,
`year` varchar(100) NOT NULL,
PRIMARY KEY (`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
Next create a page called index.php which will contain the registration
page.
28. Follow more tutorials at www.23tutorials.com Page 28
Below is the index.php
<!DOCTYPE >
<HTML >
<head>
<!-- Below is the external css for styling the index page-->
<link rel="stylesheet" type="text/css" href="css/index.css"/>
<!-- Below is the external jquery file. please you can use yours if you have it or you can
download it from the email framework in the home page. -->
<script type="text/javascript" src="script/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
//private message search engine modal box
$(function(){
$('#input_text').keyup(function(){
var a = $('#input_text').val();
//the check.php file is below after the index.php file.
$.post('check.php', {"email": a },
function(data){
$('#preview').html(data);
});
});
});
</script>
</head>
30. Follow more tutorials at www.23tutorials.com Page 30
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option
<option>December</option>
</select>
Year<select name="year" >
<option>1924</option>
<option>1923</option>
<option>1922</option>
</select><br/><br>
<br>
<input type="hidden" name="profile_picture" value="p.jpg">
<td><input name="submit" type="submit" value="Submit" id="submit_bitton"/></td>
</form>
</div>
<div id="preview" style="width:340px; font-size:14px; border:0px solid black;
position:absolute; top:230px; left:321px;">
</div>
</body>
</html>
Next is the php file call "check.php" php file used to live search if email
exists already? The Jquery script for the email live search is above is above.
<?php
include('connection.php');
$var= $_POST['email'];
31. Follow more tutorials at www.23tutorials.com Page 31
$email = '@gmail.com';
$femail = "$var@23mail.com";
$smail= "$femail";
if(strpos($var, '@'))
{
echo"<p style='color:;'> Please don't add <span style='color:green;'> @</span> in your
email. It is not accepted.<br>
Input only the names which will be used for your email.</p>";
}else
{
echo"<p style='color:;'> Your prospect email is <span
style='color:green;'>$smail</span></p>";
$query = mysql_query("SELECT * FROM member WHERE email='$femail'");
if(mysql_num_rows($query) > 0)
{
echo"<p style='color:red;'> This <span style='color:green;'>$smail</span> email already
exist. </p>";
}else
{
echo"<p style='color:red;'> This <span style='color:green;'>$smail</span> email has not
be taken.</p>";
}
}
?>
32. Follow more tutorials at www.23tutorials.com Page 32
Next is the php file call "exec.php" which insert the registered user
information into the database.
<?php
//below variables are being assign to names of input fields in the registration form.
session_start();
include('connection.php');
$firstname=$_POST['firstname'];
$secondname=$_POST['secondname'];
$email=$_POST['email'];
$sex=$_POST['sex'];
$password=$_POST['password'];
$photo=$_POST['profile_picture'];
$day=$_POST['day'];
$month=$_POST['month'];
$year=$_POST['year'];
$fmail = "$email@23mail.com";
$smail= "$fmail";
if(strpos($email, '@'))
{
//if the user email contains @ it will rejects the email. The user should enter only
usernames which will be converted into an email
echo"<p style='color:;'> Please don't add <span style='color:green;'> @</span> in your
email. It is not accepted.<br>
Input only the names which will be used for your email.</p>";
33. Follow more tutorials at www.23tutorials.com Page 33
}else
{
echo"<p style='color:;'> Your prospect email is <span
style='color:green;'>$email@23mail.com</span></p>";
$query = mysql_query("SELECT * FROM member WHERE email='$smail'");
if(mysql_num_rows($query) > 0)
{
echo"<p style='color:red;'> This <span style='color:green;'>$email@23mail.com</span>
email already exist. </p>";
}else
{
//Below insert the registered user information into the database when it has passed the
above validation.
mysql_query("INSERT INTO member(firstname, secondname, email, sex, password,
profile_picture, day, month, year)
VALUES( '$firstname', '$secondname', '$smail', '$sex', '$password', '$photo', '$day',
'$month', '$year')");
header("location:home.php");
mysql_close($con);
//Create query
$qry="SELECT * FROM member WHERE email='$smail' AND password='$password'";
$result=mysql_query($qry);
//Check whether the query was successful or not.
if($result)
{
if(mysql_num_rows($result) > 0)
34. Follow more tutorials at www.23tutorials.com Page 34
{
//register Successful
session_regenerate_id();
$member = mysql_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID'] = $member['member_id'];
$_SESSION['SESS_FIRST_NAME'] = $member['email'];
$_SESSION['SESS_LAST_NAME'] = $member['password'];
session_write_close();
exit();
}
}
}
}
?>
Next is the home.php page where when the user has sign up or login,
it will take him into the home.php page where he can send and receive
emails, search for emails and edit account. please take note that the
home.php page will be used throughout the upcoming steps in this
tutorial.
//Below is the home page that the newly register user will be taken after registration is
complete. // include the below php script at the top of the <!DOCTYPE> in the home.php
page
35. Follow more tutorials at www.23tutorials.com Page 35
<?php
session_start();
include("connection.php"); //connect to the database
include("function.php"); //This is the include file above indicated above
?>
<!DOCTYPE >
<HTML >
<head >
</head >
<body >
welcome to 23tutorials.com social network learning script for newbie programmers.
Hopes you enjoyed this tutorial.
Follow all the above email tutorials and you will benefit and learn new trick to create your
own social network. Thanks
</body >
</html >
36. Follow more tutorials at www.23tutorials.com Page 36
Login script
This is the login form where user can login. Below is the database where
all the user information is kept which will be used for the login process.
Below is the database for the login process.
CREATE TABLE IF NOT EXISTS `member` (
`member_id`int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(30) NOT NULL,
`secondname` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`sex` varchar(100) NOT NULL,
`password` varchar(30) NOT NULL,
`profile_picture` varchar(30) NOT NULL,
`day` varchar(100) NOT NULL,
`month` varchar(30) NOT NULL,
`year` varchar(100) NOT NULL,
PRIMARY KEY (`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
Next create a page called index.php which will contain the login
form in the page.
Below is the index.php having the login form
<?php //Start session
session_start();
//Unset the variables stored in session
unset($_SESSION['SESS_MEMBER_ID']);
unset($_SESSION['SESS_FIRST_NAME']);
unset($_SESSION['SESS_LAST_NAME']);
?>
37. Follow more tutorials at www.23tutorials.com Page 37
<!DOCTYPE >
<HTML >
<head>
<!-- Below is the external css for styling the index page-->
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<html>
<nav id="index_page_header">
<div id="login_div">
<form name="loginform" action= "loginscript.php" method="post">
<input type="text" name= "login_email" placeholder="email" id="login_email"> <br>
<input type="text" name="login_password" placeholder="password" id="login_password">
<input type="submit" name="login_button" value="login" id="login_button">
<?php
if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) &&
count($_SESSION['ERRMSG_ARR']) >0 ) {
echo'<ul class="err">';
foreach ($_SESSION['ERRMSG_ARR'] as $msg) {
echo'<li>',$msg,'</li>';
}
echo'</ul>';
unset($_SESSION['ERRMSG_ARR']);
}
38. Follow more tutorials at www.23tutorials.com Page 38
?>
</form>
</div>
</nav>
</body>
</html>
Next is the php file call "loginscript.php" which will login the registered
user into the database which he will be taken to the home.php page.
<?php
//Start session
session_start();
//Include database connection details
require_once('connection.php');
//Array to store validation errors
$errmsg_arr = array();
//Validation error flag
$errflag = false;
//Function to sanitize values received from the form. Prevents SQL injection
function clean($str) {
$str = @trim($str);
if (get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
//Sanitize the POST values
$email = clean($_POST['login_email']);
$password = clean($_POST['login_password']);
//Input Validations
if ($email == '') {
$errmsg_arr[] = 'email missing';
$errflag = true;
} if ($password == '') {
$errmsg_arr[]= 'Password missing';
$errflag = true;
}
39. Follow more tutorials at www.23tutorials.com Page 39
//If there are input validations, redirect back to the login form
if ($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
header("location: index.php");
exit();
}
//Create query
$qry="SELECT * FROM member WHERE email='$email' AND password='$password' ";
$result=mysql_query($qry);
//Check whether the query was successful or not
if ($result) {
if (mysql_num_rows($result) > 0) {
//Login Successful
session_regenerate_id();
$member = mysql_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID'] = $member['member_id'];
$_SESSION['SESS_FIRST_NAME'] = $member['email'];
$_SESSION['SESS_LAST_NAME'] = $member['password'];
session_write_close();
header("location: home.php");
exit();
} else {
//Login failed
$errmsg_arr[] = 'email and password not found';
$errflag = true;
if ($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
header("location: index.php");
exit();
}
}
} else {
die("Query failed");
}
?>
Next is the home.php page where when the user has sign up or login, it
will take him into the home.php page where he can send and receive
emails, search for emails and edit account. plesae take note that the
home.php page will be used throughout the upcoming steps in this
tutorial.
40. Follow more tutorials at www.23tutorials.com Page 40
//Below is the home page that the login user will be taken after login is
completed. // include the below php script at the top of the
<!DOCTYPE> in the home.php page
<?php
session_start();
include("connection.php");//connect to the database
include("function.php");//This is the include file above indicated above
?>
<!DOCTYPE >
<HTML >
<head >
</head >
<body >
welcome to 23tutorials.com social network learnig script for newbies programmers.
Hopes you enjoyed this tutorial.
Follow all the above video social network tutorials and you will benefit and learn new trick
to create your own social network. Thanks
</body >
</html >
41. Follow more tutorials at www.23tutorials.com Page 41
Show user profile name / photo script
This is the view profile names and photo script where the login user can
view his profile names and photo.
Below is the database for the storing the uploaded profile names and
photo.
CREATE TABLE IF NOT EXISTS `member` (
`member_id`int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(30) NOT NULL,
`secondname` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`sex` varchar(100) NOT NULL,
`password` varchar(30) NOT NULL,
`profile_picture` varchar(30) NOT NULL,
`day` varchar(100) NOT NULL,
`month` varchar(30) NOT NULL,
`year` varchar(100) NOT NULL,
PRIMARY KEY (`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
Next create a page called home.php that shows the profile names and
picture.
42. Follow more tutorials at www.23tutorials.com Page 42
<?php
session_start();
include ("connection.php"); // connect to the database
include("function.php"); //connect the login user session
?>
<!DOCTYPE >
<HTML >
<head>
<!-- Below is the external css for styling the index page-->
<link rel="stylesheet" type="text/css" href="css/home.css"/>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
<link href="css/font-awesome.css" rel="stylesheet">
<script type="text/javascript" src="script/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="script/jquery.form.js"></script>
</head>
<body>
<html>
<nav id="index_page_header">
</nav>
<div class="profile-photo">
<?php
/* select the names of the login from the database */
$member_id = $_SESSION["logged"];
$result = mysql_query("SELECT * FROM `member` WHERE `member_id`='$member_id'
LIMIT 1");
echo "<table border='0px' id='profile_name'> ";
44. Follow more tutorials at www.23tutorials.com Page 44
How to search emails script
This is the search emails script where the login user can search for emails he wan t to mails to.
Below is the database for the storing the uploaded profile names and photo.
CREATE TABLE IF NOT EXISTS `member` (
`member_id`int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(30) NOT NULL,
`secondname` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`sex` varchar(100) NOT NULL,
`password` varchar(30) NOT NULL,
`profile_picture` varchar(30) NOT NULL,
`day` varchar(100) NOT NULL,
`month` varchar(30) NOT NULL,
`year` varchar(100) NOT NULL,
PRIMARY KEY (`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
Next create a page called home.php that contains the search form that
will show the result of the search emails.
45. Follow more tutorials at www.23tutorials.com Page 45
<?php
session_start();
include ("connection.php"); // connect to the database
include("function.php");
?>
<!DOCTYPE >
<HTML >
<head>
<!-- Below is the external css for styling the index page-->
<link rel="stylesheet" type="text/css" href="css/home.css"/>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
<link href="css/font-awesome.css" rel="stylesheet">
<!-- Below is the external jquery file. please you can use yours if you have it. -->
<script type="text/javascript" src="script/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="script/jquery.form.js"></script>
<script type="text/javascript">
$(function(){
$(".search").keyup(function()
{ var searchid = $(this).val();
var dataString = 'search='+ searchid;
if(searchid!='')
{
type: "POST",
url:"search.php",
data: dataString,
cache: false,
success: function(html)
{
$("#result").html(html).show();
}
});
}return false;
});
jQuery("#result").live("click",function(e){
var $clicked = $(e.target);
var $name = $clicked.find('.name').html();
46. Follow more tutorials at www.23tutorials.com Page 46
var decoded = $("<div/>").html($name).text();
$('#searchid').val(decoded);
});
jQuery(document).live("click", function(e){
var $clicked = $(e.target);
if (! $clicked.hasClass("search")){
jQuery("#result").fadeOut();
}
});
$('#searchid').click(function(){
jQuery("#result").fadeIn();
});
});
</script>
</head>
<body>
<html>
<nav id="index_page_header">
<!-- Below is the search engine form. -->
<div id="noticeboard">
<div class="content">
<input type="text" class="search" id="searchid" placeholder="Search for people you may know
their email." />
<div id="result">
</div>
</div>
</div>
</nav>
</body>
</html>
47. Follow more tutorials at www.23tutorials.com Page 47
Create a file called search.php which will search the emails from the
database.
<?php
include('connection.php');
if($_POST)
{
$query = mysql_real_escape_string($_POST['search']);
$sql = mysql_query("SELECT * FROM `member` WHERE `email` LIKE '%$query%' LIMIT 0,
5 ") or die (mysql_error());
$num_of_row = mysql_num_rows($sql);
if ($num_of_row > 0 ) {
while($row = mysql_fetch_array($sql))
{
$id = $row['member_id'];
echo "<p style='color:blue; text-decoration:none;'> ". $row['email']."</p>";
echo "<hr width='600px' style='color:white;'>";
}
}
else
{
echo "<font color='red' size='4' >No email found!</font>";
}
}
?>
48. Follow more tutorials at www.23tutorials.com Page 48
How to compose email script
This is the form for sending emails. The form can send files alongside the
email.
Below is the database that stores the emails.
CREATE TABLE IF NOT EXISTS `emails` (
`email_id` int(11) NOT NULL AUTO_INCREMENT,
`sender_id` int(11) NOT NULL,
`receiver_id` int(11) NOT NULL,
`sender_email` varchar(5000) NOT NULL,
`receiver_email` varchar(5000) NOT NULL,
`subject` varchar(5000) NOT NULL,
`file_name` varchar(5000) NOT NULL,
`email_body` varchar(5000) NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`email_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9;
Next create a page called home.php that contains form for sending
emails.
49. Follow more tutorials at www.23tutorials.com Page 49
<?php
session_start();
include ("connection.php"); // connect to the database
include("function.php");
?>
<!DOCTYPE >
<HTML >
<head>
<!-- Below is the external css for styling the index page-->
<link rel="stylesheet" type="text/css" href="css/home.css"/>
<link href="css/font-awesome.css" rel="stylesheet">
</head>
<body>
<nav id="index_page_header">
</nav>
<!-- Below is the form for sending email and attatch file. -->
<form action="send-mail.php" enctype="multipart/form-data" method="POST"
name="message_form" onsubmit="return(validate());">
<input name="MAX_FILE_SIZE" type="hidden" value="1000000">
<input type="text" name="receiver_email" placeholder="Send message to"
class="receiver_email_form">
<input type="text" name="topic" placeholder="Subject" class="message_subject">
<div class="message-div">
<textarea class="message-body-container" name="email_body" placeholder="Type your
50. Follow more tutorials at www.23tutorials.com Page 50
message body here" > </textarea>
</div>
<input class="upload_file" name="file" type="file" title="attatch a file to your message">
<input type="submit" name="send_message" value="Submit" class="submit-button">
</form>
</body>
</html>
Create a file called send-mail.php which will insert the email the login
user sends into the database.
<?php
session_start();
include("connection.php");
include("function.php");
$mail = $_POST["email_body"];
$receiver = $_POST['receiver_email'];
$subject = $_POST["topic"];
$member_id = $_SESSION["logged"];
$sender_email = $_email["logged"];
$send_file = $_FILES['file']['name'];
if( $send_file == "" )
{
$query = mysql_query("INSERT INTO
emails(sender_id,date,sender_email,receiver_email,subject,file_name,email_body)
VALUES('$member_id',NOW(),'$sender_email','$receiver','$subject','$send_file','$mail') ");
echo "<script type="text/javascript">
alert("You sent this message");
window.location='home.php';
51. Follow more tutorials at www.23tutorials.com Page 51
</script>";
}else{
$path = "files/"; //the files is the name of the folder to store the file attach or send to an email.
$valid_formats = array("docx", "pdf", "gif", "bmp" , "JPG" , "PNG" , "GIF","jpg", "png","sql");
$send_file = $_FILES['file']['name'];
list($txt, $ext) = explode(".", $send_file);
if(in_array($ext,$valid_formats))
{
$tmp = $_FILES['file']['tmp_name'];
if(move_uploaded_file($tmp, $path.$send_file))
{
$query=mysql_query("INSERT INTO
emails(sender_id,date,sender_email,receiver_email,subject,file_name,email_body)
VALUES('$member_id',NOW(),'$sender_email','$receiver','$subject','$send_file','$mail') ") or
die(mysql_error());
} else
{
echo "<script type="text/javascript">
alert("photo uploaded failed");
window.location='home.php';
</script>";
}
{
echo "<script type="text/javascript">
alert("You sent this message");
window.location='home.php';
</script>";
}
} else{
echo "<script type="text/javascript">
52. Follow more tutorials at www.23tutorials.com Page 52
alert("This $send_file file is invalid");
window.location='home.php';
</script>";
}
}
?>
53. Follow more tutorials at www.23tutorials.com Page 53
How to view inbox email script
This is the view profile names and photo script where the login
user can view his profile names and photo.
Below is the database for the storing the inbox emails
(messages).
CREATE TABLE IF NOT EXISTS `emails` (
`email_id` int(11) NOT NULL AUTO_INCREMENT,
`sender_id` int(11) NOT NULL,
`receiver_id` int(11) NOT NULL,
`sender_email` varchar(5000) NOT NULL,
`receiver_email` varchar(5000) NOT NULL,
`subject` varchar(5000) NOT NULL,
`file_name` varchar(5000) NOT NULL,
`email_body` varchar(5000) NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`email_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9;
Next create a page called home.php that shows the inbox message (emails received by the login
users).
54. Follow more tutorials at www.23tutorials.com Page 54
<?php
session_start();
include ("connection.php"); // connect to the database
include("function.php");
?>
<!DOCTYPE >
<HTML >
<head>
<!-- Below is the external css for styling the index page-->
<link rel="stylesheet" type="text/css" href="css/home.css"/>
<link href="css/font-awesome.css" rel="stylesheet">
</head>
<body>
<nav id="index_page_header">
</nav>
<!-- Below is the php script which selects the login user inbox emails (The user can see all the
messages it receives). These inbox emails are not completed the user has to clicked the email to
view the full emails.-->
<?php
$user_email = $_email["logged"];
$email = mysql_query("SELECT * FROM `emails` WHERE `receiver_email`='$user_email'
ORDER BY date DESC");
$num_rows =mysql_numrows($email);
if ($num_rows != 0 ) {
while($row = mysql_fetch_array($email))
{
$email_file = $row["file_name"];
56. Follow more tutorials at www.23tutorials.com Page 56
$mail......</p></a>";
echo'<p class="delete_email" ><a href="delete-mail.php?email_id='.$row["email_id"].'"><i
class="icon icon-remove"></i> Delete</a></p>';
echo"</div>";
}
}
} else {
echo"<div class='inbox-message-div'>";
echo"<p class='sender-email'> No message received yet.</p>";
echo"</div>";
}
?>
</body>
</html>
57. Follow more tutorials at www.23tutorials.com Page 57
How to view full email script
This is the view full email script where the login user can view the
complete email content when he clicks any email on the inbox.
Below is the database for the storing the inbox emails (messages).
CREATE TABLE IF NOT EXISTS `emails` (
`email_id` int(11) NOT NULL AUTO_INCREMENT,
`sender_id` int(11) NOT NULL,
`receiver_id` int(11) NOT NULL,
`sender_email` varchar(5000) NOT NULL,
`receiver_email` varchar(5000) NOT NULL,
`subject` varchar(5000) NOT NULL,
`file_name` varchar(5000) NOT NULL,
`email_body` varchar(5000) NOT NULL,
`date` date NOT NULL,
PRIMARY KEY (`email_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9;
Next create a page called home.php that shows the inbox message
(emails received by the login users).
58. Follow more tutorials at www.23tutorials.com Page 58
<?php
session_start();
include ("connection.php"); // connect to the database
include("function.php");
?>
<!DOCTYPE >
<HTML >
<head>
<!-- Below is the external css for styling the index page-->
<link rel="stylesheet" type="text/css" href="css/home.css"/>
<link href="css/font-awesome.css" rel="stylesheet">
</head>
<body>
<nav id="index_page_header">
</nav>
<!-- Below is the php script which selects the login user inbox emails (The user can see all the
messages it receives). -->
<?php
$user_email = $_email["logged"];
$email = mysql_query("SELECT * FROM `emails` WHERE `receiver_email`='$user_email'
ORDER BY date DESC");
$num_rows =mysql_numrows($email);
if ($num_rows != 0 ) {
while($row = mysql_fetch_array($email))
{
59. Follow more tutorials at www.23tutorials.com Page 59
$email_file = $row["file_name"];
$email_text = $row["email_body"];
$mail = substr($email_text , 0, 15);
if($email_file)
{
echo"<div class='inbox-message-div'>";
<!-- Below is the link that contains incomplete emails that end with … when click it will take the
user to the view_email.php page where he wil see the full email.-->
echo"<p class='email_text'> <a href='view_email.php?email_id=".$row['email_id']."'>
$mail......</p></a>";
echo"</div>";
} else
{
echo"<div class='inbox-message-div'>";
<!-- Below is the link that contains incomplete emails when click it will take the user to the
view_email.php page where he will see the full email.-->
echo"<p class='email_text'> <a href='view_email.php?email_id=".$row['email_id']."'>
$mail......</p></a>";
echo"</div>";
}
}
} else {
echo"<div class='inbox-message-div'>";
echo"<p class='sender-email'> No message received yet.</p>";
echo"</div>";
}
?>
</body>
</html>
60. Follow more tutorials at www.23tutorials.com Page 60
Below is the view_email.php page as indicated above which shows
the complete email message that was clicked from the inbox page
without having the ….. Sign at the end of the email.
<?php
session_start();
include ("connection.php"); // connect to the database
include("function.php");
//Below is the id (number) of the email that was clicked from the inbox page.
$email_id = $_GET["email_id"];
?>
<!DOCTYPE >
<HTML >
<head>
<link rel="stylesheet" type="text/css" href="css/home.css"/>
<link href="css/font-awesome.css" rel="stylesheet">
</head>
<body>
<nav id="index_page_header">
</nav>
61. Follow more tutorials at www.23tutorials.com Page 61
<!-- Below is the php script which selects the completed email messages that was clicked from
the inbox.(The user can see all the messages it receives). -->
<?php
$email = mysql_query("SELECT * FROM `emails` WHERE `email_id`='$email_id' ");
while($row = mysql_fetch_array($email))
{
$email_file = $row["file_name"];
if($email_file)
{
echo"<div class='inbox-message-div'>";
echo'<p class="sender-email"><span style="color:red;"> From:</span>
'.$row["sender_email"].'</p>';
echo'<p class="email-subject"><span style="color:green;"> Subject:</span>
'.$row["subject"].'</p> ';
echo'<p class="email_date"> '.$row["date"].'</p> ';
echo'<p class="email_text" ><a href="view_email.php?email_id='.$row["email_id"].'">
'.$row["email_body"].'
</p></a>';
echo"</div>";
} else
{
echo"<div class='inbox-message-div'>";
echo'<p class="sender-email"><span style="color:red;"> From:</span>
'.$row["sender_email"].'</p>';
62. Follow more tutorials at www.23tutorials.com Page 62
echo'<p class="email-subject"><span style="color:green;"> Subject:</span>
'.$row["subject"].'</p> ';
echo'<p class="email_date"> '.$row["date"].'</p> ';
echo'<p class="email_text" ><a href="view_email.php?email_id='.$row["email_id"].'">
'.$row["email_body"].'
</p></a>';
echo"</div>";
}
}
?>
</body>
</html>
Please follow the remaining chapters of
this tutorial at www.23tutorials.com for free
and many more tutorials like how to create
YouTube, Facebook, twitter and many more.
63. Follow more tutorials at www.23tutorials.com Page 63
Thanks for following this video sharing social
network tutorial ebook.
You are allowed to share this ebook with your
friends or colleagues. We have many tutorials
like;
How to create Facebook in php and JavaScript,
How to create twitter in php and JavaScript,
How to create Gmail in php and JavaScript
And many more free tutorials all for free.
We also have plug-in like who is online
(showing online users),
Facebook search engine tutorials and many
more for free.
Visit our website www.23tutorials.com and get
all the tutorials that you want, you can even
request a tutorial and will help you.