Advertisement
Guest User

Untitled

a guest
Dec 5th, 2012
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.38 KB | None | 0 0
  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
  2. <?php
  3. include 'Check.php';
  4. $gamePass=mysql_fetch_array(mysql_query("SELECT * FROM games WHERE id='".$_REQUEST["id"]."'"));
  5. $Host = $gamePass["username"];
  6. if(isset($_POST["Bio"])){
  7.     $_SESSION["Bio"] = $_POST["Bio"];
  8. }
  9. echo $_SESSION["Bio"];
  10. if ($myusername == $Host){ //check if in monsters.xml, if it is place it into the "active.txt"...use active.txt to carry values around, if not continue onto making it so they can spawn the entity and when they hit save instruct them to load the entity.
  11.     if(file_exists("upload/users/".$Host."/monsters/".$_REQUEST["Mon"].".xml")){
  12.         $_SESSION['ActiveEntity'] = $_REQUEST["Mon"];
  13.         echo "Entity: " . $_REQUEST["Mon"] . " has been loaded, you may close this window!";
  14.     }
  15.     else{
  16. ?>
  17. <center>
  18. <form action="" name="forment" method="post">
  19. Create new Entity(player/npc): <?php echo $_REQUEST["Mon"]; ?>
  20. <table>
  21. <tr><td>Bio:</td><td><textarea cols="40" rows="5" name="Bio">
  22. Bob was an average salary man until he discovered one piece.
  23. </textarea></td></tr>
  24. <tr><td>Level:</td><td><input name="Lvl" type="text" id="Lvl" size="63" /></td></tr>
  25. <tr><td>Inventory:</td><td><input name="Inv" type="text" id="Inv" size="63" /></td></tr>
  26. <tr><td>Class:</td><td><input name="Class" type="text" id="Class" size="63" /></td></tr>
  27. <tr><td>Race:</td><td><input name="Race" type="text" id="Race" size="63" /></td></tr>
  28. <tr><td>Subclass:</td><td><input name="SClass" type="text" id="SClass" size="63" /></td></tr>
  29. <tr><td>Armor Slot:</td><td><input name="ArmS" type="text" id="ArmS" size="63" /></td></tr>
  30. <tr><td><input name="save" type="submit"  id="save" value="Save" /></td></tr>
  31. </table>
  32. </form>
  33. </center>
  34. <script type="text/javascript">
  35. $(document).ready(function(){
  36.     $("#save").click(function(){   
  37.         alert("Passed!");
  38.         var Bioval = $("#Bio").val();
  39.         var Invval = $("#Inv").val();
  40.         var Classval = $("#Class").val();
  41.         var Raceval = $("#Race").val();
  42.         var SClassval = $("#SClass").val();
  43.         var ArmSval = $("#ArmS").val(); //PHP_SELF is empty and the post isn't even sending
  44.         $.post("<?php echo $PHP_SELF; ?>", { Bio: Bioval, Inv: Inval, Class: Classval, Race: Raceval, SClass: SClassval, ArmS: ArmSval});    //This isn't being posted for some reason
  45.         return false;
  46.     });
  47. });
  48. </script>
  49. <?php
  50.     }
  51. }
  52. else{
  53.     echo "You are not host of this game!";
  54. }
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement