Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. //echo md5("75QUE9-NTX4RB-YSC8V0-F2ZWIH-LJ63GA-MOPDK1")."<br>";
  5. //echo md5("353229020012520");
  6. require("rb.php");
  7.  
  8. $user = "root";
  9. $pass = "1234";
  10.  
  11. R::setup("mysql:host=localhost;dbname=testes",$user,$pass);
  12.  
  13. if(isset($_POST['submit'])){
  14. $estado = R::dispense("tb_estados");
  15. $estado->import($_POST,"nome");
  16. R::store($estado);
  17. }
  18.  
  19. $estados = R::find("tb_estados");
  20. //echo "<pre>";
  21. //print_r($cidades);
  22. foreach ($estados as $e){
  23. echo $e->nome."<br>";
  24. }
  25. ?>
  26.  
  27. <h1>Add Estado</h1>
  28. <form method="post" action="">
  29. <label>Estado</label>
  30. <input type="text" name="nome" />
  31. <input type="submit" name="submit" value="add" />
  32. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement