Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Gratis Svordomar</title>
- </head>
- <body bgcolor="#a6a6cA">
- <?php
- header('Content-Type: text/html; charset=utf-8');
- ?>
- <?php
- $servername = "don't even try";
- $username = "notthisuser";
- $password = "notthispassword";
- $dbname = "idontevenknow";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn -> connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- mysqli_set_charset ($conn , "utf8" );
- $sql = "SELECT * FROM curses order by RAND() limit 1";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- // $formatted = utf8_encode($row["curse"]);
- $visit = "INSERT INTO visitors (visit_at, curse_id, curse, ip)"$
- " values (NOW(), " . $row["id"] . ", \"" . $row["curse"$
- "\"" . $_SERVER['REMOTE_ADDR'] . "\");";
- if ($conn->query($visit) === TRUE) {
- } else {
- echo "php failure";
- }
- for ($i = 0; $i < 15; $i++) {
- echo "<br>";
- }
- echo "<div align=\"center\">";
- echo "<font size=\"4\">";
- echo "Svordom nummer " . ($row["id"]+1) . "<br>";
- echo "</font>";
- echo "<font size=\"8\">";
- echo $row["curse"];
- echo "</font>";
- echo "</div>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement