Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. index.php
  2.  
  3. <?php
  4. session_start();
  5. if(isset($_SESSION['myusername'])){
  6.     header("location:main.php");
  7. }
  8. ?>
  9.  
  10.  
  11. main.php
  12.  
  13. <?php
  14. session_start();
  15. if(!isset($_SESSION['myusername'])){
  16.     header("location:index.php");
  17. }
  18. print_r($_SESSION); die();
  19.  
  20. //dane do tego nizej
  21.  
  22. mysql_connect("$host","$username","$password")or die("cannot connect");
  23. mysql_select_db("$db_name")or die("cannot select DB");
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement