Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Profile</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- </head>
- <body>
- <div class="profileForm">
- <form method="GET">
- <span>Search user:</span>
- <input type="text" name="user" />
- <input type="submit" value="Search" />
- <?php
- $string = file_get_contents('data.txt');
- $string = explode("\n", $string);
- $user = trim($_GET['user']);
- $error = true;
- if ($_GET) {
- foreach ($string as $key => $value) {
- $value = explode("!", $value);
- if(empty($user)) {
- echo "<p>Enter username to search.</p>";
- $error = false;
- break;
- }
- if ($user === $value[0]) {
- echo '<pre>'."User Name: " . print_r($value[0], true) . '</pre>';
- echo '<pre>'."Email: " . print_r($value[4], true) . '</pre>';
- echo '<pre>'."First Name: " . print_r($value[5], true) . '</pre>';
- echo '<pre>'."Last Name: " . print_r($value[6], true) . '</pre>';
- echo '<pre>'."Sex: " . print_r($value[7], true) . '</pre>';
- echo '<pre>'."Birth: " . print_r($value[8], true) . "/" . print_r($value[9], true) ."/". print_r($value[10], true) . '</pre>';
- $error = false;
- }
- }
- if($error) {
- echo "<p>User <strong>$user</strong> was not found.</p>";
- }
- }
- if(file_exists('data.txt')){
- $result = file('data.txt');
- }
- foreach ($result as $value) {
- $columns = explode('!', $value);
- }
- $dir = "upload/";
- chdir($dir);
- array_multisort(array_map('filemtime', ($files = glob("*.*"))), SORT_DESC, $files);
- foreach($files as $filename) {
- echo "<br>";
- break;
- }
- $images = $filename;
- ?>
- </form>
- <hr>
- <form method="POST" action="ChangeProfile.php">
- <span class="left">Profile picture:</span>
- <img src="upload/<?php echo $images;?>" width="80px" height="80px">
- <br>
- <label class="left" for="regName">User Name:</label>
- <span><?php echo $columns[0]; ?></span>
- <br>
- <label class="left" for="question">Secret Queston:</label>
- <span><?php echo $columns[2]; ?></span>
- <br>
- <label class="left" for="answer">Secret Answer:</label>
- <span><?php echo $columns[3]; ?></span>
- <br>
- <label class="left" for="email">Email:</label>
- <span><?php echo $columns[4]; ?></span>
- <br>
- <label class="left" for="fName">First Name:</label>
- <span><?php echo $columns[5]; ?></span>
- <br>
- <label class="left" for="lName">Last Name:</label>
- <span><?php echo $columns[6]; ?></span>
- <br>
- <label class="left">Sex:</label>
- <span><?php echo $columns[7]; ?></span>
- <br>
- <label class="left" for="birth">Birthday:</label>
- <span><?php echo $columns[8]; ?></span>
- <span><?php echo $columns[9]; ?></span>
- <span><?php echo $columns[10]; ?></span>
- <hr>
- <input type="submit" value="Change Profile" />
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment