Exemplo n.º 1
0
<html>
<head>
</head>
<body>
<?php 
include 'db.php';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = $_POST['fname'];
    // Open DB connection
    $conn = openDbConnection();
    insertIntoDb($conn, "test", "name", $name);
    $result = selectDataFromDb($conn, "test");
    while ($row = $result->fetch_assoc()) {
        echo "ID: " . $row["id"] . " - Name: " . $row["name"] . "<br>";
        echo "--------------------------------<br>";
    }
    // Close DB connection
    $conn->close();
}
?>

<a href="index.php">Back</a>
</body>
</html>
Exemplo n.º 2
0
three paragraphs appear in all copies of this software.


IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,

INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 

USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE

BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT

LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A

PARTICULAR PURPOSE, AND NON-INFRINGEMENT.


THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO

OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR

MODIFICATIONS.*/
error_reporting(0);
try {
    openDbConnection();
} catch (Exception $e) {
    echo 'Safe error message\\n';
}
Exemplo n.º 3
0
<?php

set_include_path("..");
require("offensive/assets/header.inc");
// Include, and check we've got a connection to the database.
require_once('admin/mysqlConnectionInfo.inc');
if(!isset($link) || !$link) $link = openDbConnection();
require_once('offensive/assets/functions.inc');
mustLogIn();

require_once("offensive/assets/classes.inc");

$p = array_key_exists("p", $_REQUEST) ? $_REQUEST['p'] : 0 ;

function poast($comment, $image, $upload) {
	$comment = new Comment($comment['commentid']);
	if(!me()->squelched($comment->commenter()->id())) {
		$com = $comment->HTMLcomment();
		$com = explode("\n", $com);
		if(count($com) <= 10) { 
			$com = implode("<br />", $com);
			echo $com;
		} else {
			for($i = 0; $i < 10; $i++) {
				echo $com[$i] . "<br />";
			}?>
				<blockquote>
					<span class="abbr">Comment too long. Click <a href="<?= Link::comment($comment) ?>">here</a> to view the full text.</span>
				</blockquote>
			<?
		}
Exemplo n.º 4
0
	$string = mysql_error();
	if(strlen($string) > 0) {
		echo $string."\n";
	}
}

if(isset($_SERVER['REMOTE_ADDR'])) die("this upgrade should only be run from the command-line\n");

error_reporting(E_ALL);
set_time_limit(0);
ini_set("memory_limit", "512M");

set_include_path("../web");
require_once("admin/mysqlConnectionInfo.inc");
if(!isset($link) || !$link) {
	$link = openDbConnection();
}

echo "subscriptions: ".array_pop(mysql_fetch_array(mysql_query(
	"SELECT COUNT(*) FROM offensive_subscriptions")))."\n";
$result = mysql_query("SELECT COUNT(*) FROM offensive_bookmarks") or die("no no don't do it");;
echo "bookmarks: ".array_pop(mysql_fetch_array($result))."\n";

// first, clean up the subscriptions table:
$result = mysql_query("SELECT * FROM offensive_subscriptions");
report();
$hits = array();
while(false !== list($id, $userid, $fileid) = mysql_fetch_array($result)) {
	if(array_key_exists("$userid,$fileid", $hits)) {
		mysql_query("DELETE FROM offensive_subscriptions WHERE id = $id");
		report();