Advertisement
Cinska_polivka

Untitled

Aug 29th, 2011
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. <?
  2.  session_start();
  3.  if(!session_is_registered(myusername)){
  4.  header("location:main_login.php");
  5.  }
  6.  ?>
  7. <?
  8. echo "<BR>Account: ".$_SESSION["user"];
  9. //acc name
  10. include "config.php";
  11. mysql_connect(SQL_HOST, SQL_USERNAME, SQL_PASSWORD);
  12. mysql_select_db(SQL_DBNAME);
  13.  
  14.  
  15. $result = mysql_query("SELECT * from characters WHERE account_name='".$_SESSION["user"]."'")
  16. or die(mysql_error());  
  17.  
  18.  
  19.  
  20. echo '<form method="POST" action="view_project.php">';
  21. echo   '<input type="hidden" name="sector" value="sector_list">';
  22. echo  '<select name="sector_list" class="inputstandard">';
  23. // keeps getting the next row until there are no more to get
  24. while($row = mysql_fetch_array( $result )) {
  25.         // Print out the contents of each row into a table
  26.  echo '<option value="'.$row['char_name'].'">'.$row['char_name'].'</option>';
  27. }
  28. echo '</select>';
  29. echo  '<input type="submit" value="Go!"> ';
  30. echo  '</form>';
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement