Advertisement
Guest User

Untitled

a guest
May 12th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.69 KB | None | 0 0
  1. <html>
  2. <head>
  3.   <title>Hakuna's messagebox</title>
  4.   <META HTTP-EQUIV="REFRESH" CONTENT="60">
  5. </head>
  6. <body bgcolor=#000000 text=#AAAAAA>
  7. <center><h1>Welcome to my message page!</h1></center>
  8. <center><img src="hakuna.jpg">
  9. <br>
  10. <br>
  11. Hi, my name is Hakuna and I'm a 16 year old girl. I live in the netherlands and
  12. love to look out of the window and sit on the balcony with my nose in the wind.
  13. In the picture above you can see me when I was 7 years old. I was lying cosy
  14. on my bed against the central heating when my slave decided to annoy me with
  15. bright flashes.<br>
  16. <br>
  17. You can leave me a message by sending "hakuna" followed by your message to +31 657 93 23 52 . You message should appear in the list below within the minute :)
  18. <br><br><br>
  19. <?php
  20.  
  21.   $dbcon=pg_connect("host=localhost user=dbuser dbname=smsdb password=mypass");
  22.   if (!$dbcon) {
  23.     print "Connection to database failed: " . pg_last_error();
  24.     print "</body>\n</html>\n";
  25.     exit;
  26.   }
  27.   $sql="select smsdate,number,text from inbox where upper(text) like 'HAKUNA%' order by smsdate DESC";
  28.   $result = pg_query($dbcon, $sql);
  29.   $error = pg_last_error();
  30. ?>
  31. <center><table>
  32.   <TH width=40% align=left>Date/Time</TH>
  33.   <TH width=60% align=left>Message</TH>
  34. <!--  <TH width=20% align=left>Countrycode</TH> -->
  35. <?php
  36.   while(list($smsdate, $number, $text) = pg_fetch_row($result)) {
  37.     $number = substr(strip_tags($number), 0, 3);
  38.     $text   = substr(strip_tags($text), 7, strlen($text)-7);
  39.     print "  <TR>\n";
  40.     print "    <TD>$smsdate</TD>\n";
  41.     print "    <TD>$text</TD>\n";
  42.     #print "    <TD align=right>$number</TD>\n";
  43.    print "  </TR>\n";
  44.   }
  45.   pg_close($dbcon);
  46. ?>
  47. </table></center>
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement