Css for Adminpanel .php:
#container{ width:700px; margin:0 auto 0 auto;}
#main{ width:700px; height:500px;}
#main0{ width:200px; height:500px; float:left;}
#main1{ width:500px; float:left; height:500px; background:url(images/back.png);}
.pad{ padding-left:100px;}
.fnt{ font-size:25px; font-family: Tahoma, sans-serif; color:#3490b7;}
.lab{ float:left; width:30%; text-align:right; margin-right:15px;}
#frm{ padding-left:100px;}
.text{padding: 5px;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
padding-left: 5px;
width: 180px;
font-family: Helvetica, sans-serif;
font-size: 1.4em;
margin: 0px 0px 10px 0px;
border: 2px solid #CCC;}
.submit{-webkit-box-align: center;
text-align: center;
cursor: default;
color: buttontext;
padding: 2px 6px 3px;
border: 2px outset buttonface;
border-image: initial;
background-color: buttonface;
box-sizing: border-box;
padding: 5px;
width: 80px;
font-family: Helvetica, sans-serif;
font-size: 1.2em;
border: 2px solid #CCC;
}
.fontad{font-family: Helvetica, sans-serif;
font-size: 1.2em;}
.imgpad{ padding-left:150px;}
Admin-panel.php:
<div id="container">
<div id="main ">
<div id="main0"><img src="images/admin.png" /></div>
<div id="main1">
<div id="wel">
<p class="pad fnt">Welocome To Admin Panel !!!</p>
</div>
<div class="imgpad"><img src="images/admin123.png" /></div>
<div id="frm">
<form action="adminpanel.php" method="post">
<label class="lab fontad">Admin-Name</label>
<input type="text" name="admin" class="text" /><br /><br />
<label class="lab fontad">Password</label>
<input type="password" name="pass" class="text" /><br /><br />
<div style="padding-left:250px;"><input type="submit" name="submit1" class="submit" /></div>
</form>
</div>
</div>
</div>
</div>
in admin.php:
<form action="upload.php" method="post" enctype="multipart/form-data" >
<input type="hidden" name="upload" value="1" />
<input type="file" name="file" id="file" class="validate[required] text-input text" /><br /><br />
<div style="padding-left:250px;"><input type="submit" name="btnSubmit" value="Submit" class="button3 orange button_wid submit" /></div>
</form>
in upload.php:
<?php
if($_POST[upload]==1)
{
$to="upload/".$_FILES['file']['name'];
move_uploaded_file($_FILES['file']['tmp_name'],$to);
echo '<img src="'.$to.'">';
}
?>
#container{ width:700px; margin:0 auto 0 auto;}
#main{ width:700px; height:500px;}
#main0{ width:200px; height:500px; float:left;}
#main1{ width:500px; float:left; height:500px; background:url(images/back.png);}
.pad{ padding-left:100px;}
.fnt{ font-size:25px; font-family: Tahoma, sans-serif; color:#3490b7;}
.lab{ float:left; width:30%; text-align:right; margin-right:15px;}
#frm{ padding-left:100px;}
.text{padding: 5px;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 5px;
padding-left: 5px;
width: 180px;
font-family: Helvetica, sans-serif;
font-size: 1.4em;
margin: 0px 0px 10px 0px;
border: 2px solid #CCC;}
.submit{-webkit-box-align: center;
text-align: center;
cursor: default;
color: buttontext;
padding: 2px 6px 3px;
border: 2px outset buttonface;
border-image: initial;
background-color: buttonface;
box-sizing: border-box;
padding: 5px;
width: 80px;
font-family: Helvetica, sans-serif;
font-size: 1.2em;
border: 2px solid #CCC;
}
.fontad{font-family: Helvetica, sans-serif;
font-size: 1.2em;}
.imgpad{ padding-left:150px;}
Admin-panel.php:
<div id="container">
<div id="main ">
<div id="main0"><img src="images/admin.png" /></div>
<div id="main1">
<div id="wel">
<p class="pad fnt">Welocome To Admin Panel !!!</p>
</div>
<div class="imgpad"><img src="images/admin123.png" /></div>
<div id="frm">
<form action="adminpanel.php" method="post">
<label class="lab fontad">Admin-Name</label>
<input type="text" name="admin" class="text" /><br /><br />
<label class="lab fontad">Password</label>
<input type="password" name="pass" class="text" /><br /><br />
<div style="padding-left:250px;"><input type="submit" name="submit1" class="submit" /></div>
</form>
</div>
</div>
</div>
</div>
<?
if(isset($_POST['submit1']))
{
$a=$_POST['admin'];
$b=$_POST['pass'];
if($a=="admin" && $b=="admin")
{?>
<script> window.location="admin.php" </script>
<? }
else
{?>
<script> alert("please enter valid username & password")</script>
<? }
}
?>
in admin.php:
<form action="upload.php" method="post" enctype="multipart/form-data" >
<input type="hidden" name="upload" value="1" />
<input type="file" name="file" id="file" class="validate[required] text-input text" /><br /><br />
<div style="padding-left:250px;"><input type="submit" name="btnSubmit" value="Submit" class="button3 orange button_wid submit" /></div>
</form>
in upload.php:
<?php
if($_POST[upload]==1)
{
$to="upload/".$_FILES['file']['name'];
move_uploaded_file($_FILES['file']['tmp_name'],$to);
echo '<img src="'.$to.'">';
}
?>
No comments:
Post a Comment