<link href="php.png" rel="icon">
<link href="php.png" rel="apple-touch-icon">


<?php
$target_dir = "extraimages/";
$target_file = $target_dir . basename($_FILES["filename"]["name"]);
if (move_uploaded_file($_FILES["filename"]["tmp_name"], $target_file)) 
{
echo "<center><span style='color:red; font-family:arial; line-height:33px;'><b> $target_file </b></span> and ";
header('refresh:30; URL= phpfile_fullview.php');
} 
else
{
echo "<center><h2 style='color:#000066; font-family:arial;'><b></b></h2></center>";
}

if (isset ($_POST['save']))
{
$txtname = $_POST['lname'];  
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$comment = $_POST['comment'];

$gender = $_POST['gender'];
$course = $_POST['course'];



$velaa = $_POST['samay'];
$ip = $_POST['ip'];

$file = fopen("phpfiles/$txtname.php","w+") or die("file not open"); 
$s = "<meta name='viewport' content='width=device-width, initial-scale=1'><base href='/db71/all/loginsystem1/postsbyusers/aaa/postfiles/'> 
<style> body {font-family:arial; max-width:600px; margin:5px auto; padding:10px;} </style> <center> 
<span style='font-size:20px; text-decoration: none;'>   Contact Info <a href='phpfile_singleview.php?dara=phpfiles/$txtname.php'><b>$txtname</a></b> </span>  
</center>
<a href='$target_file'> <img src='$target_file' title='$target_file' width='100' height='100' align='left' valign='top' hspace='8px'></a>"
."Name:- $fname <br>"."Surname:- $lname <br>"
." Mobile no:- $mobile <br>"."Email ID:- $email <br>"
." Gender:- $gender <br>"."Course Name:- $course <br>"

."Message:- $comment <br>"."<span  style='float:left; color:red; font-size:85%;'>Time:- $velaa IP:- $ip </span>

<a href='phpfile_delete.php?dara=phpfiles/$txtname.php&dara2=$target_file' style='float:right;'> <b>Delete</b></a>";

fputs ($file, $s) or die("Data not write");
fclose ($file); 
}
date_default_timezone_set('Asia/Kolkata');

?>




<!DOCTYPE html>
<html lang="en">
<head>
<title>PHP FILE CREATE</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="/db71/gradientbg.css">

<link href="php.png" rel="icon">
<link href="php.png" rel="apple-touch-icon">


<style>
body {font-family:arial;font-size:18px;
    background: linear-gradient(to top left, #ccffff 11%, #ffccff 100%);
    background-repeat: no-repeat; background-attachment: fixed;
}


a:visited, a:link {color: blue;}
a:hover, a:active {color: red;}

input:focus::-webkit-input-placeholder { color:transparent;}
textarea:focus::-webkit-input-placeholder { color:transparent;}

.sdhover{opacity:0.4;} .sdhover:hover{opacity:1.0;}

@media only screen and (max-width: 600px) {
body {font-size:18px;}
}

</style>

</head>

<body>
<a href="phpfile_fullview.php" title="HOME PAGE"> <img src="php.png" class="sdhover" style="position:fixed; top:3px;left:3px; width:30px;"> </a>



<?php
if ($txtname) {echo "<span style='color:#009933;'><b> $txtname </b></span>  is Submitted Successfully </center><br>
<meta http-equiv = 'refresh' content = '5; url = phpfile_fullview.php'>";}
else {echo "<center><span style='color:red;'> $txtname </span>  <h4> <b>Cantact Us</b> </h4> </center>";}
?>


<div class="col-md-4 container" style="margin:5px auto; width:350px;">
<form action="" method ="post"  enctype="multipart/form-data">
    
<div class="form-group">
<input type="hidden" class="form-control mt-1" name="txtname" required >
<input type='text' class="form-control mt-1"  name='fname' placeholder="Type Your Name..."  required >
<input type='text' name='lname' class="form-control mt-1" placeholder="Type Your Surname..."  required >
<input type='text' name='mobile' class="form-control mt-1" placeholder="Type Your Mobile nomber..."  required >
<input type='text' name='email' class="form-control mt-1" placeholder="Type Your Emaill id..."  required >


<input type="radio" name="gender" value="female"> Female
<input type="radio" name="gender" value="Male"> Male
<input type="radio" name="gender" value="Other"> Other

<select id="course" class="form-control mt-1" name="course">
<option value="Courses"> Courses </option>
<option value="Javascript">Javascript</option>
<option value="python">Python</option>
<option value="cprograming">C and C++ Programming</option>
</select>

<textarea class="form-control mt-1" rows="5"  placeholder="Type Your Message..." name="comment" required ></textarea>
Attached image size upto 2mb
</div>

<input type="hidden" name="samay" value="<?php echo date("d-M-Y h:i a") . "<br>";?>" required >
<input type="hidden" name="ip" value="<?php echo $_SERVER['REMOTE_ADDR'];?>">
<input type="file" name="filename" id="filename" style='background:#ffff66; margin:-15px 0 8px; width:320px; border:1px solid #999;'><br>
<center><button type="submit" name="save" class="btn btn-primary"> <strong> SUBMIT </strong></button></center>
</form>
</div>

<center><h4 style="background-image: linear-gradient(to right, #ffffcc, #ffffff, #ffffcc); 
border:1px solid black; border-radius:9px; padding:6px; width:250px; margin:1px;">
    <b><a href='phpfile_fullview.php'>View Submitted</a></b></h4></center>

<br>
<center>
<p>
Note:- The Data Saved in Webfolder
</p>
</center>




</body>
</html>  