Advertisement
Guest User

Untitled

a guest
May 16th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <pre><?php
  2. $mysql_host = 'mysql.cba.pl';
  3. $port = '3306';
  4. $username = 'fejsu';
  5. $password = '123qweasd';
  6. $database = 'fejsu_cba_pl';
  7. try{
  8. $pdo = new PDO('mysql:host='.$mysql_host.';dbname='.$database.';port='.$port, $username, $password );
  9. }catch(PDOException $e){
  10. echo 'Połączenie nie mogło zostać utworzone.<br />';
  11. }
  12. $a = $pdo->query('SELECT * FROM podstrony');
  13. foreach($a as $x){
  14. echo '<a href="'.$x['url'] .'">'.$x['url'].'</a><br>';
  15. }
  16.  
  17. if($strona = $pdo->query( 'select* from podstrony where url="'.$_SERVER['REQUEST_URI'].'"limit1'))echo '<hr>'.$strona['tresc'];
  18.  
  19. else echo 'brak strony';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement