Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start();
- include('credentials.php');
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="css.css"/>
- </head>
- <body>
- <div id="container">
- <div id="header">
- <p class="top"> <strong> Dark Side Buisness Controller </strong> </p>
- </div>
- <div id="menu">
- <ul>
- <li><a href="index.php"> Home Page </a></li>
- <li><a href="about.php"> About US </a></li>
- <li><a href="register.php"> Register </a></li>
- <li><a href="login.php"> Login </a><li>
- <?php if ( isset($_SESSION['name'])) { ?>
- <li><a href="control.php"> Control Panel</a><li>
- <li><a href="upload.php"> Upload </a><li>
- <li><a href="logout.php"> Logout</a><li>
- <?php
- }
- ?>
- </ul>
- </div>
- <div id="main">
- <?php
- $username=$_SESSION['name'];
- $link=@mysqli_connect("localhost",$dbuser,$dbpass,$dbname);
- if (mysqli_connect_errno()){
- echo "Error at DB connection";
- echo mysqli_connect_error();
- die(mysqli_error());
- }
- $query="SELECT afm from users where username='$username'";
- $result=mysqli_query($link,$query);
- $row=mysqli_fetch_assoc($result);
- if ($row["afm"] == NULL) {
- ?>
- <form method="POST" name="moreinfof" id="moreinfof" action="insertmore.php">
- <table width="100%" cellpadding="3" cellspacing="2">
- <p><strong> Insert Your Personal infos</strong></p>
- <tr>
- <td class="right"> <strong> AFM </strong> </td>
- <td>
- <input type="text" name="afm" id="afm"/>
- </td>
- </tr>
- <tr>
- <td class="right"> <strong> Year of Birth</strong> </td>
- <td>
- <select name="yearofb" id="yearofb">
- <option value=-1 style="color:red" selected="selected"> --Choose your Birthday Year--</option>
- <option value=1> 1993 </option>
- <option value=2> 1992 </option>
- <option value=3> 1991 </option>
- <option value=4> 1990 </option>
- <option value=5> 1989 </option>
- <option value=6> 1988 </option>
- <option value=7> 1987 </option>
- <option value=8> 1986 </option>
- <option value=9> 1985 </option>
- <option value=10> 1984 </option>
- <option value=11> 1983 </option>
- <option value=12> 1982 </option>
- <option value=13> 1981 </option>
- <option value=14> 1980 </option>
- <option value=15> 1979 </option>
- </select>
- </td>
- </tr>
- <tr>
- <td class="right"> <strong> Sex </strong> </td>
- <td>
- <input type="radio" id="male" name="male" value="1"/>
- <label for="male"> Male</label>
-
- <input type="radio" id="fmale" name="fmale" value="0"/>
- <label for="fmale"> Female</label>
- </td>
- </tr>
- <tr>
- <td class="right">
- <input name="reset" id="reset" type="reset" value="Reset"/>
- <input name="submit" id="submit" type="submit" value="Submit"/>
- </td>
- </tr>
- </table>
- </form>
- <?php
- }
- else {
- $afm=$row["afm"];
- $year=$row["year"];
- $gender=$row["gender"];
- ?>
- <form method="POST" name="moreinfof" id="moreinfof" action="insertmore.php">
- <table width="100%" cellpadding="3" cellspacing="2">
- <p><strong>Update your Infos</strong></p>
- <tr>
- <td class="right"> <strong> AFM </strong> </td>
- <td>
- <input type="text" name="afm" id="afm" value="<?php echo $afm?>/>
- </td>
- </tr>
- <tr>
- <td class="right"> <strong> YEAR </strong> </td>
- <td>
- <input type="text" name="year" id="year" value="<?php echo $year?> />
- </td>
- </tr>
- <tr>
- <td class="right"> <strong> Gender </strong> </td>
- <td>
- <input type="text" name="gender" id="gender" value="<?php echo $gender?> />
- </td>
- </tr>
- <tr>
- <td class="right">
- <input name="reset" id="reset" type="reset" value="Reset"/>
- <input name="submit" id="submit" type="submit" value="Submit"/>
- </td>
- </tr>
- </table>
- </form>
- <?php
- }
- ?>
- <?php
- mysqli_close($link);
- ?>
- </div>
- <div id="footer">
- <p>© 2012 - ΤΕΙ Λάρισας</p>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement