Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ("database.php");
- include ("cookieusername.php");
- ?>
- <title>
- MySite - Profile - <?php echo $username ?>
- </title>
- <style type="text/css">
- <!--
- A:link { COLOR: black; TEXT-DECORATION: none; font-weight: normal }
- A:visited { COLOR: black; TEXT-DECORATION: none; font-weight: normal }
- A:active { COLOR: green; TEXT-DECORATION: none }
- A:hover { COLOR: blue; TEXT-DECORATION: none; font-weight: none }
- -->
- </style>
- <?php
- include ("database.php");
- // include ("echousername.php");
- include ("background.php");
- // include ("cookieusername.php");
- // if ($_COOKIE['ID_my_site'])
- ?>
- <br><p>
- <div id="mydiv">
- <style type="text/css">
- DIV { display: none; }
- </style>
- <Center><b>Additional Details</b>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
- <table border="0"><center>
- <Br><p><center><b>Bithrdate
- Day:<name="day" />
- <select>
- <?php
- for($iii = 1; $iii <= 31; $iii++)
- {
- echo "<option>$iii</option>";
- }
- ?>
- </select>
- Month:<name="month" />
- <select>
- <option>January</option>
- <option>Febuary</option
- ><option>March</option
- ><option>April</option
- ><option>May</option
- ><option>June</option
- ><option>July</option
- ><option>August</option
- ><option>September</option
- ><option>October</option
- ><option>November</option
- ><option>December</option
- ></select>
- Year:<name="year" />
- <select>
- <?php
- for($iii = 1900; $iii <= 2010; $iii++)
- {
- echo "<option>$iii</option>";
- }
- ?>
- </select><br />
- Username: <input type="text" name="username" /><br />
- First name: <input type="text" name="firstname" /><br />
- Last name: <input type="text" name="lastname" /><br />
- <b>Location</b><br />
- Location: (eg, country, state, city)<input type="text" name="location" /><br />
- <b>Gender</b><br />
- <input type="radio" name="gender" value="male" />Male<br />
- <input type="radio" name="gender" value="female" />Female<br />
- <input type="submit" name="submit" value="submit" />
- </form></table>
- </div>
- <?php
- //Checks if there is a login cookie
- if(isset($_COOKIE['ID_my_site']))
- {
- $username = mysql_real_escape_string( $_COOKIE['ID_my_site'] );
- $pass = mysql_real_escape_string( $_COOKIE['Key_my_site'] );
- $check = mysql_query("SELECT * FROM users WHERE username = '$username' AND password = '$pass'")or die(mysql_error());
- while($info = mysql_fetch_array( $check ))
- {
- if ($username == $info['username'])
- echo "$username";
- }
- }
- if (isset($_POST['submit'])) {
- $firstname = ($_POST['firstname']);
- $lastname = ($_POST['lastname']);
- $day = ($_POST['day']);
- $month = ($_POST['month']);
- $year = ($_POST['year']);
- $location = ($_POST['location']);
- include ("cookieusername.php");
- $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
- while($info = mysql_fetch_array( $check ))
- $filename = "/home/giacjrdi/public_html/mysite/profiles/profileinfo/$username.info.php" or exit("Unable to open file!");
- $handle = fopen($filename, 'w')or die;
- $content = "<b>Firstname: </b>$firstname <br> <b> Lastname: </b> $lastname <p> <b> Birthday: </b>$day $month $year <br> <b> Location: </b> $location";
- fwrite($handle, $content)or die;
- fclose($handle);
- }
- $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
- while($info = mysql_fetch_array( $check ))
- include ("$username.info.php")or die;
- ?>
- <br>
- <center>
- <a href="javascript:;" onmousedown="if(document.getElementById('mydiv').style.display == 'none')
- { document.getElementById('mydiv').style.display = 'block'; }
- else{ document.getElementById('mydiv').style.display = 'none'; }">Edit Information.</a>
- </center>
- <br>
- <br>
- <br>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement