Professional Documents
Culture Documents
UMRAKH
SUB: PHP MYSQL
JOURNAL
ADMIN SITE
LOGIN PAGE
<?php
session_start();
include "conn.php";
$m="";
if(isset($_REQUEST['btnsubmit']))
";
$res=mysql_query($q);
header("location:reg_disp.php");
$c=mysql_num_rows($res);
if($c>0)
$_SESSION['user']=$_REQUEST['txtuname'];
header("location:reg_disp.php");
else
?>
<html>
<body BGCOLOR="black">
<TABLE ALIGN="CENTER">
<TR>
<TD><font color="WHITE">:</TD>
</TR>
<TR>
<TH><font color="YELLOW">PASSWORD</TH>
<TD><font color="WHITE">:</TD>
</TR>
<TR>
</TR>
<TR>
</TR>
</TABLE>
</BODY>
</FORM>
</HTML>
LOGOUT
logout.php
<?php
session_start();
session_destroy();
header("location:login.php");
?>
CHANGE PASSWORD
chpass.php
<?php
//session_start();
include "scheck.php";
include "connect.php";
//$m="";
if(isset($_REQUEST['btnsubmit']))
$res=mysql_query($q);
$count=mysql_num_rows($res);
if($count>0)
if($_REQUEST['txtnpass']==$_REQUEST['txtcpass'])
login_possword='".$_REQUEST['txtnpass']."'
mysql_query($u);
//header("location:login.php");
else
else
?>
<html>
<body>
<form method="post">
<?php
if(isset($m))
echo $m;
?>
<tr>
<th>OLD PASSWORD</th>
<th>:</th>
</tr>
<tr>
<th>NEW PASSWORD</th>
<th>:</th>
</tr>
<tr>
<th>CONFIRM PASSWORD</th>
<th>:</th>
</tr>
</table>
<center>
<tr>
</center>
</tr>
</form>
</body>
<html>
CONTACT US
CONNECT.PHP
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
mysql_select_db("collage_project");
?>
INSERT
contacts_insert.php
<?php
INCLUDE "header.php";
include "connect1.php";
if(isset($_REQUEST['btnsubmit']))
first_name='".$_REQUEST['txtfname']."',
last_name='".$_REQUEST['txtlname']."',
email='".$_REQUEST['txtemail']."',
phone='".$_REQUEST['txtphone']."',
message='".$_REQUEST['txtmsg']."'";
mysql_query($q);
header("location:contacts_display.php");
?>
<HTML>
<BODY>
<FORM METHOD="POST">
<TR>
<TH>First Name</TH>
</TR>
<TR>
<TH>Last Name</TH>
</TR>
<TR>
<TH>E Mail</TH>
</TR>
<TR>
<TH>Phone</TH>
</TR>
<TR>
<TH>Message</TH>
</TR>
<TR>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
DISPLAY
contacts_delete.php
<?php
include "connect1php";
con_id=".$_GET['id'];
mysql_query($q);
header("location:contacts_display.php");
?>
contacts_display.php
<?php
include "scheck.php";
include "header.php";
include "connect1.php";
if(isset($_REQUEST['btnsearch']))
$res=mysql_query($q);
$count=mysql_num_rows($res);
?>
<HTML>
<BODY>
<FORM METHOD="POST">
<tr>
</tr>
<TH colspan="6">Search
</tr>
<tr align="right">
</tr>
<TR>
<TH>ID</TH>
<TH>First Name</TH>
<TH>Last Name</TH>
<TH>E Mail</TH>
<TH>Phone</TH>
<TH>Message</TH>
<TH colspan="2">Action</TH>
</TR
<?php
if($count>0)
while($row=mysql_fetch_object($res))
{ ?>
<tr>
<?php } ?>
</tr>
<?php
?>
</TABLE>
</FORM>
</BODY>
</HTML>
EDIT
contacts_edit.php
<?php
INCLUDE "header.php";
include "connect1.php";
con_id=".$_REQUEST['id'];
$res=mysql_query($s);
$row=mysql_fetch_object($res);
if(isset($_REQUEST['btnsubmit']))
first_name='".$_REQUEST['txtfname']."',
last_name='".$_REQUEST['txtlname']."',
email='".$_REQUEST['txtemail']."',
phone='".$_REQUEST['txtphone']."',
message='".$_REQUEST['txtmsg']."'
where con_id=".$_REQUEST['id'];
mysql_query($q);
header("location:contacts_display.php");
?>
<HTML>
<BODY>
<FORM METHOD="POST">
<TR>
<TH>First Name</TH>
</TR>
<TR>
<TH>Last Name</TH>
</TR>
<TR>
<TH>E Mail</TH>
</TR>
<TR>
<TH>Phone</TH>
</TR>
<TR>
<TH>Message</TH>
</TR>
<TR>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
REGISTERATION
INSERT
reg_ins.php
<?php
include "connect.php";
include "header.php";
//include "scheck.php";
if(isset ($_REQUEST['btnsubmit']))
reg_mail='".$_REQUEST['txtemail']."',
reg_fname='".$_REQUEST['txtfname']."',
reg_lname='".$_REQUEST['txtlname']."',
reg_uname='".$_REQUEST['txtuname']."',
reg_password='".$_REQUEST['txtpass']."',
reg_img='".$_FILES['imgsfile']['name']."'
";
mysql_query($q);
MOVE_UPLOADED_FILE($_FILES['imgsfile']['tmp_name'],"images/".$_FILES['imgsfile']['name'
]);
header("location:reg_disp.php");
?>
<html>
<body>
welcome.. UDIT
<tr>
</tr>
<tr>
<td>Email</td>
</tr>
<tr>
<td>First Name</td>
</tr>
<tr>
<td>Last Name</td>
</tr>
<tr>
<td>User Name</td>
</tr>
<tr>
<td>Password</td>
</tr>
<tr>
<td>Image</td>
</tr>
<tr>
<input type="reset">
</tr>
</table>
</form>
</body>
</html>
DISPLAY
reg_del.php
<?php
include("connect.php");
reg_id=".$_REQUEST['id'];
mysql_query($q);
header("location:reg_disp.php");
?>
reg_disp.php
<?php
//session_start();
include "scheck.php";
include "header.php";
include "connect.php";
if(isset($_REQUEST['btnsearch']))
";
$res=mysql_query($q);
$count=mysql_num_rows($res);
?>
<html>
<body>
<form method="post">
<tr>
</tr>
<tr>
</td>
</tr>
<tr align="right">
</tr>
<?php if($count>0)
?>
<tr>
<th>Email</th>
<th>First Name</th>
<th>Last Name</th>
<th>User Name</th>
<th>Password</th>
<th>Image</th>
<th colspan="2">Action</th>
</tr>
<?php
while($row=mysql_fetch_object($res))
{ ?>
<tr>
</tr>
<?php
} else
?>
</table>
</form>
</body>
</html>
EDIT
reg_edit.php
<?php
include "header.php";
include "connect.php";
include "scheck.php";
reg_id=".$_GET['sid'];
$res=mysql_query($s);
$row=mysql_fetch_object($res);
if(isset ($_REQUEST['btnsubmit']))
if($_FILES['imgsfile']['name']=="")
reg_mail='".$_REQUEST['txtemail']."',
reg_fname='".$_REQUEST['txtfname']."',
reg_lname='".$_REQUEST['txtlname']."',
reg_uname='".$_REQUEST['txtuname']."',
reg_password='".$_REQUEST['txtpass']."'
where reg_id=".$_get['sid'];
else
reg_mail='".$_REQUEST['txtemail']."',
reg_fname='".$_REQUEST['txtfname']."',
reg_lname='".$_REQUEST['txtlname']."',
reg_uname='".$_REQUEST['txtuname']."',
reg_password='".$_REQUEST['txtpass']."',
reg_img='".$_FILES['imgsfile']['name']."'
where reg_id=".$_get['sid'];
mysql_query($q);
MOVE_UPLOADED_FILE($_FILES['imgsfile']['tmp_name'],"images/".$_FILES['imgsfile']['name'
]);
header("location:reg_disp.php");
?>
<html>
<body>
<tr>
</tr>
<tr>
<td>Email</td>
</tr>
<tr>
<td>First Name</td>
</tr>
<tr>
<td>Last Name</td>
</tr>
<tr>
<td>User Name</td>
</tr>
<tr>
<td>Password</td>
</tr>
<tr>
<td>Image</td>
</tr>
<tr>
<input type="reset">
</tr>
</table>
</form>
</body>
</html>
WEB DEVELOPMENT
INSERT
web_ins.php
<?php
include "connect.php";
include "header.php";
//include "scheck.php";
if(isset ($_REQUEST['btnsubmit']))
web_seo='".$_REQUEST['txtemail']."',
web_onlinestore='".$_REQUEST['txtfname']."',
web_blog='".$_REQUEST['txtlname']."',
web_mobilefriendly='".$_REQUEST['txtuname']."',
web_coustomer='".$_REQUEST['txtpass']."',
web_img='".$_FILES['imgsfile']['name']."'
";
mysql_query($q);
MOVE_UPLOADED_FILE($_FILES['imgsfile']['tmp_name'],"images/".$_FILES['imgsfile']['name'
]);
header("location:web_disp.php");
?>
<html>
<body>
<tr>
</tr>
<tr>
<td>WEB SEO</td>
</tr>
<tr>
<td>ONLINE STORE</td>
</tr>
<tr>
<td>BLOG</td>
</tr>
<tr>
</tr>
<tr>
<td>COUSTOMER NAME</td>
</tr>
<tr>
<td>Image</td>
</tr>
<tr>
<input type="reset">
</tr>
</table>
</form>
</body>
</html>
DISPLAY
web_del.php
<?php
include("connect.php");
web_id=".$_REQUEST['id'];
mysql_query($q);
header("location:web_disp.php");
?>
web_disp.php
<?php
//session_start();
include "scheck.php";
include "connect.php";
INCLUDE "header.php";
if(isset($_REQUEST['btnsearch']))
";
$res=mysql_query($q);
$count=mysql_num_rows($res);
?>
<html>
<body>
<form method="post">
<tr>
</tr>
<tr>
</td>
</tr>
<tr align="right">
</tr>
<?php if($count>0)
?>
<tr>
<th>WEB SEO</th>
<th>ONLINE STORE</th>
<th>BLOG</th>
<th>MOBILE FRIENDLY</th>
<th>COUSTOMER NAME</th>
<th>Image</th>
<th colspan="2">Action</th>
</tr>
<?php
while($row=mysql_fetch_object($res))
{ ?>
<tr>
</tr>
<?php
} else
?>
</table>
</form>
</body>
</html>
EDIT
web_edit.php
<?php
include "header.php";
include "connect.php";
//include "scheck.php";
web_id=".$_GET['sid'];
$res=mysql_query($s);
$row=mysql_fetch_object($res);
if(isset ($_REQUEST['btnsubmit']))
if($_FILES['imgsfile']['name']=="")
web_seo='".$_REQUEST['txtemail']."',
web_onlinestore='".$_REQUEST['txtfname']."',
web_blog='".$_REQUEST['txtlname']."',
web_mobilefriendly='".$_REQUEST['txtuname']."',
web_coustomer='".$_REQUEST['txtpass']."'
where web_id=".$_get['sid'];
else
web_seo='".$_REQUEST['txtemail']."',
web_onlinestore='".$_REQUEST['txtfname']."',
web_blog='".$_REQUEST['txtlname']."',
web_mobilefriendly='".$_REQUEST['txtuname']."',
web_coustomer='".$_REQUEST['txtpass']."',
web_img='".$_FILES['imgsfile']['name']."'
where web_id=".$_get['sid'];
mysql_query($q);
MOVE_UPLOADED_FILE($_FILES['imgsfile']['tmp_name'],"images/".$_FILES['imgsfile'
]['name']);
header("location:web_disp.php");
?>
<html>
<body>
<tr>
</tr>
<tr>
<td>WEB SEO</td>
</tr>
<tr>
<td>ONLINE STORE</td>
</tr>
<tr>
<td>BLOG</td>
</tr>
<tr>
</tr>
<tr>
<td>COUSTOMER NAME</td>
</tr>
<tr>
<td>Image</td>
</tr>
<tr>
<input type="reset">
</tr>
</table>
</form>
</body>
</html>