Você está na página 1de 22

Social Network Using PHP/MYSQL

Group Members :1. Durgesh Kumar Singh . College:- Institute of Technology And Marine Engineering. Registration no:-13614. 2. Abdul Qadir . College:- Institute of Technology And Marine Engineering. Registration no:-17101. 3. Kumar Shivam. College:- Institute of Technology And Marine Engineering. Registration no:-13566. 4. Vikash Kumar. College:- Institute of Technology And Marine Engineering. Registration no:-13566.

(i)

Document sign date :Aug 1, 2013

Index Page
Item:Acknowledgement Requirement Specification Database Design Page Flow Diagram Screen Shots Future Scope of Improvements Code Page No:(iii) (iv) (v) (vii) (viii) (ix) (x)

(ii)

Document sign date :Aug 1, 2013

ACKNOWLEDGEMENT
I deem it a pleasure to express my deep sense of gratitude to Mr. Abhishek Kundu who directed and gratitude me with her timely advice which eased the task of completing this project. Finally, I must say that no height is ever achieved without some sacrifices made at some end it is here. I owe my special debt to my parents for showing their generous love thought the entire period of time.

(iii)
Document sign date :Aug 1, 2013

Requirement Specification
Domain Description Social Networking:
Social networking is the groupin of individuals into specific groups, like small rural communities or a neighborhood subdivision, if you will. Although social networking is possible in person, especially in the workplace, universities, and high schools, it is most popular online System. geekSnetwork is a place to be in touch with your loved ones. This is a small network where people can express themselves, give their opinion on different posts. geekSnetwork is basically designed for any particular organization or college where all the people in the organization or all the students in the college can communicate with each other. So to get started register here.

(iv)

Document sign date :Aug 1, 2013

Database Design
ER Diagram:-

(v)

Document sign date :Aug 1, 2013

Table Description:-

(vi)

Document sign date :Aug 1, 2013

Page Flow diagrams

(vii)

Document sign date :Aug 1, 2013

Screen Shots:

(viii)

Document sign date :Aug 1, 2013

Future Scope of Improvements:


geekSnetwork still have many features to be added in future such as friend request, private chat etc. Notification feature also need some changes where user will be notified about the like of their post. Wall post will have some more features that is when user updates his profile a wall post will be posted to his friends.

(ix)

Document sign date :Aug 1, 2013

Code
1. index.php <?php require 'dbconnection.php'; if(isset($_COOKIE['email']) && isset($_COOKIE['pass'])) header('Location:login.php?auto=1'); if(isset($_SESSION['user_id'])) header('Location:home.php'); ?> <!DOCTYPE HTML> <html> <head> <link rel='stylesheet' type='text/css' href='css/style.css'/> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/indexscript.js"></script> <script type="text/javascript" src="js/image.js"></script> <script type="text/javascript" src="js/abc.js"></script> <link rel="stylesheet" type="text/css" href="1-simple-calendar/tcal.css" /> <script type="text/javascript" src="1-simple-calendar/tcal.js"></script> <title>TRANING SOCIAL</title> </head> <body> <div class='wrapper'> <div class='header'> <div id="logo" style='margin-left:30px;'> <a style='font-size:50px' href='index.php'>geek<b style='font-size:70px;'>S</b>network</a> </div> <div id='l'> <form class="loginform" action="login.php" method='POST'> <table cellspacing="0"> <tbody> (x)

Document sign date :Aug 1, 2013

<tr> <td><label for="email">Email</label></td> <td><label for="pass">Password</label></td> </tr> <tr> <td><input class="logininput" type="email" name="email" title="PLACE YOUR EMAIL-ID" required></td> <td><input class="logininput" type="password" name="pwd" title="PLACE YOUR PASSWORD" required></td> <td><input type="submit" id="buttonl" name="login" value="Log In"></input></td> </tr> <tr> <td> <div> <input type="checkbox" name="loginchk" value="1"> <label id="sp">Save Password</label> </div> <div> <input type="hidden" name="forget" > </div> </td> <td> <a id="sp" href="resetpass.php">Forgot password?</a> </td> </tr> </tbody> </table> </form> </div> </div><!--end header-->

Document sign date :Aug 1, 2013

<div class='center'> <div class='left'><!--start left--> <div id="slideshowContainer"> <div class="slideshow"> <img src="images/im/image1.png" width="600" height="300" /> <img src="images/im/image2.png" width="600" height="300" /> <img src="images/im/image3.png" width="600" height="300" /> <img src="images/im/image4.png" width="600" height="300" /> <img src="images/im/image5.png" width="600" height="300" /> </div> <ul id="nav1"> <li id="prev"><a href="#">Previous</a></li> <li id="next"><a href="#">Next</a></li> </ul> </div> </div><!--end left--> <div class='div-register'> <h3 class='Newuser'><span>New User</span> <br/> </h3> <?php if(isset($_GET['remarks'])){ $remarks=$_GET['remarks']; if ($remarks=='unsuccess') { ?> <h1 id="mark"><?php echo 'Email Already Registered ';?></h1> <?php } if ($remarks=='success') { ?>

Document sign date :Aug 1, 2013

<h1 id="mark"><?php echo 'Registration Successful';?></h1> <?php } if ($remarks=='unsuccess1') { ?> <h5 id="mark"><?php echo 'Wrong Email or Password';?></h5> <?php } if($_GET['remarks']=='passchngd') { ?> <h5 id="mark"><?php echo 'Password changed successfully';?></h5> <?php } } ?> <form id='Registration_form' name="fform" action="question.php" onsubmit="return checkForm(fform)" method="POST"> <p> <input type='text' name='fname' placeholder='Firstname' title="PLACE YOUR FIRST NAME" id="firstName" required><br> <p> <input type='text' name='lname' placeholder='Lastname' title="PLACE YOUR LAST NAME" id="laststName" required><br> <p> <input type='password' name='pwd'placeholder='password' title="PLACE YOUR PASSWORD" id="password" maxlength="20" required><br> <p> <input type='password' name='repwd' placeholder='Re-password' title="PLACE YOUR RE-PASSWORD" id="repassword" maxlength="20" required><br>

Document sign date :Aug 1, 2013

<p> <input type='mobile' name='mo' placeholder='Mobile No' title="PLACE YOUR MOBILE NO"maxlength="14" id="mobile" required><br> <p> <input type='Email' name='email' placeholder='Email Id' title="PLACE YOUR EMAIL-ID" id="email" required> <div> <div id="dob" >Birthday</div> <div id="D0B"> <select class="DOB" name="day" title="SELECT DAY" id="day" > <option selected="0" value="0">Day</option> <?php for($i=1;$i<=31;$i++) { ?> <option><?php echo $i;? ></option> <?php } ?> </select> <select class="DOB" name="month" title="SELECT MONTH" id="month" > <option selected="0" value="0">Month</option> <?php $i=1; $month=array('JAN','FEB','MAR','A PR','MAY','JUNE','JULY','AUG','SEP','OCT','NOV','DEC'); foreach($month as $val) { ?> <option value='<?php echo $i;? >'><?php echo $val;?></option> <?php

Document sign date :Aug 1, 2013

$i++; } ?> </select> <select class="DOB" name="year" title="SELECT YEAR" id='year' required > <option selected="0" value="0">Year</option> <?php for($i=1900;$i<=2013;$i++) { ?> <option><?php echo $i;? ></option> <?php } ?> </select> </div> <div id="gender"> <table style='margin-top:16px;'> <tr > <td>Male</td><td><input required type="radio" name='gender' title="SELECT GENDER" value="Male" ></td> <td>Female</td><td><inpu t required type="radio" name='gender' title="SELECT GENDER" value="Female"></td> </tr> </table> </div> </div> <div> <input type="submit" name="submit" id="buttonr"value="Register"></input> </div> </form> </div><!--end right-signup-->

Document sign date :Aug 1, 2013

</div><!--end center--> <div id="foo" style='margin-left:50px'><!--footer--> <nav> <hr> <ul> <li><a href="index.php">Home</a></li> <li><a href="Aboutus.php">About</a></li> <li><a href="contactus.php">Contact Us</a></li> </ul> </nav> </div> </div><!--end wrapper--> </body> </html> 2.home.php <?php include_once("dbconnection.php"); if(!isset($_SESSION['user_id'])){ header('Location:index.php'); } ?> <html> <head> <title>Welcome</title> <link rel="stylesheet" type="text/css" href="css/home.css"> <script type="text/javascript" src="scripts/jquery.min.js"></script> <script type="text/javascript"

Document sign date :Aug 1, 2013

src="scripts/jquery.form.js"></script> <script type="text/javascript" >$ (document).ready(function(){$('#photoimg').live('change', function(){ $("#preview").html('');$("#preview").html('<img src="loader.gif" alt="Uploading...."/>'); $("#imageform").ajaxForm({target: '#preview'}).submit();});}); </script> </head> <body> <div id="wrapper"> <?php include ("include/header.php");?> <div id="maincontent"> <div id="left1"> </div> <div id="left2"> <div id="propic"> <div id="picdis"> <span style="margin-top:1%; "><?php include_once 'picsave.php';? ></span> </div> </div> <div id="information" style="margin-top:-10%;"> <h3 id="info">Information<a href='editusinfo.php? w=150'style='margin-left:25%;'>Edit</a></h3><?php require'showuserinfo.php';?> </div> </div> <div id="right2"> <div id='update'> <span id='updatestatus'>Update Status</span>

Document sign date :Aug 1, 2013

<form name="dispatches" action="postdispach.php" method="post"> <textarea rows="3" cols="20" placeholder="What's on your mind......"name="dispatch" required></textarea> <br></br><input id="postbtn" type="submit" value="Post"></input></form> <hr> </div> <div id="rest"> <? include 'postview.php'; ?> </div> </div> <div id="right1"> </div> </div><!--End main content--> </div><!--End wrapper--> </body> </html> <? if(isset($_GET['y'])) { if($_GET['y']==1) { echo "<script>alert('You have already liked this post..')</script>"; } if($_GET['y']==2) { echo "<script>alert('Only liked posts can be unliked..')</script>"; } } if(isset($_GET['cnd'])) {

Document sign date :Aug 1, 2013

if($_GET['cnd']==1) { echo "<script>alert('You can not delete this post..')</script>"; } if($_GET['cnd']==2) { echo "<script>alert('You can not delete this comment..')</script>"; } } ?> 3.dbconnection.php <?php session_start(); $serverName="localhost"; $dbUsername="root"; $dbPassword=""; $dbName="NETWORK"; mysql_connect($serverName,$dbUsername,$dbPassword) or die('database Connection Issue'); mysql_select_db($dbName); ?> <?php function generateHash($pass) { return md5($pass); } ?> 4. postview.php

Document sign date :Aug 1, 2013

<style> td { padding-top:.3em; padding-bottom:.3em; } </style> <?php include_once("dbconnection.php"); $sql=("SELECT * FROM messages order by id desc"); $result=mysql_query($sql); if(mysql_num_rows($result)>0) //start { while($fetch=mysql_fetch_array($result)) { $dt=$fetch['timestamp']; $fd = date('d-M-Y, h:i A', strtotime($dt)); //$nd=new DateTime($dt); //$fd=date_format($nd,'d-M-Y,H:i A'); echo "<div style='margin-right:5px;'><a href='otherprofile.php?m=". $fetch['User_Id']."'><img src='upload/".$fetch['Image']."' height='50' width='50'></a></div>"; echo "<div style='float:left; margin-left:55px;margin-top:-45px;'><a href='otherprofile.php?m=".$fetch['User_Id']."'><b>". $fetch['Name']." </b></a> <span style='color:black; font-size:11px;'>".$fd."</span> <a href='deletepost.php?d=". $fetch['id']." && uid=".$_SESSION['user_id']."'><img title='Delete' src='images/di.png' width=10 height=10></a>"; echo "<div style='margin-left:500px; margin-top:-20px;'><a href='vote.php?a=1 && b=".$fetch['id']."'><img src='images/buttonsfeat1.jpg' ></a>"; $sql6="Select * from votes where msgid='".$fetch['id']."'"; $res6=mysql_query($sql6) or die(mysql_error());

Document sign date :Aug 1, 2013

$numv=mysql_num_rows($res6); echo "<span style='background:black;'> ".$numv." </span>"; echo "<a href='vote.php?a=2 && b=".$fetch['id']."'><img src='images/buttonsfeat2.jpg' ></a></div>"; echo ""; echo nl2br($fetch['content'])."</div>"; echo "<div style='margin-left:55px;'><form action='commentin.php? n=".$fetch['id']." && m=".$fetch['User_Id']."' method='post'>"; echo "<textarea style='resize: none; width: 50%; height: 4%; border: 1px solid #8b9dc3;' name='cmnt' placeholder='Write a comment..' ></textarea><br/><input type='submit' style='cursor:pointer; font-weight:bold; margin-top:2px; border: 1px solid #426A57; background-color:#426A57; color:#FFFFFF;' name='cmntbtn' value='comment'></form></div>"; $sql1="SELECT * FROM comment order by c_id desc"; $result1=mysql_query($sql1) or die(mysql_error()); while($fetch1=mysql_fetch_array($result1)) { if($fetch['id']==$fetch1['msgid']) { $sql2="SELECT User_Id,Fname,Lname,Image from SOCIAL where User_Id='".$fetch1['userid']."'"; $result2=mysql_query($sql2) or die(mysql_error()); $fetch2=mysql_fetch_array($result2); echo "<div ><div style='margin-left:60px;'><a href='otherprofile.php?m=".$fetch2['User_Id']."'><img src='upload/".$fetch2['Image']."' width=30 height=30></div><div style='margin-left:94px; margin-top:-33px;'>".$fetch2['Fname']." ". $fetch2['Lname']."</a> <a href='cmntdelete.php?cid=". $fetch1['c_id']." && cmntr=".$fetch1['userid']." && msgr=". $fetch1['msgposterid']."'><img title='Delete' src='images/di.png' width=10 height=10></a><br/>". $fetch1['comment']."<hr></div></div>";

Document sign date :Aug 1, 2013

} else { echo ""; } }

} echo ""; } //end else { echo "No post"; } ?>

Document sign date :Aug 1, 2013

Você também pode gostar