コード例 #1
0
ファイル: csdl.php プロジェクト: agathatruong/PHP45
/**
 * Ham lay du lieu 
 * output : so
 */
function select_count($sql)
{
    // mo ket noi
    $link = connect_server();
    $obj = mysqli_query($link, $sql);
    $data = $obj->fetch_array();
    // dong ket noi
    close_server($link);
    return $data[0]['count'];
}
コード例 #2
0
ファイル: view.php プロジェクト: sahildua2305/resume-host
<?php

ob_start();
require 'inc/functions.php';
if (!isset($_GET['username'])) {
    header('Location: index.php');
}
$username = strip_tags($_GET['username']);
$name = "";
$connection = connect_server();
$results = mysqli_query($connection, "SELECT firstname, lastname FROM user_details WHERE username = '******'");
while ($row = mysqli_fetch_array($results)) {
    $name = $row['firstname'] . " " . $row['lastname'];
}
?>

<!DOCTYPE html>
<html>
	<head>

		<title><?php 
echo $name;
?>
 - Resume</title>
		<style>
			body {
				margin: 0;
			}
			iframe {
				display: block;
				background: #000;
コード例 #3
0
ファイル: submit.php プロジェクト: nschlia/libdvdetect
    libxml_use_internal_errors(true);
    $xml = simplexml_load_string($xmlstr);
    if (!$xml) {
        $ResponseText = "XML Error: " . get_xml_error($xmlstr);
        throw new Exception($ResponseText, XMLRESULT_XML_ERROR);
    }
    $attributes = $xml->attributes();
    $XmlMode = $attributes["XmlMode"];
    $ProtocolVersion = $attributes["ProtocolVersion"];
    $LibraryVersion = $attributes["LibraryVersion"];
    $LibraryName = $attributes["LibraryName"];
    $ClientName = $attributes["ClientName"];
    // Use requested version
    $xmlRoot->setAttribute("ProtocolVersion", $ProtocolVersion);
    checkVersion($ProtocolVersion, LIBDVDETECT_PROTOCOL_VERSION);
    $mysqli = connect_server();
    // Check connection
    if (!$mysqli) {
        $ResponseText = "Cannot connect to database.\nSQL Error: " . mysqli_connect_error();
        throw new Exception($ResponseText, XMLRESULT_SQL_ERROR);
    }
    submit($mysqli, $xml, $ProtocolVersion);
} catch (Exception $e) {
    $Result = $e->getCode();
    $ResponseText = $e->getMessage();
}
disconnect_server($mysqli);
$mysqli = null;
// Create response
$responseTag = $domtree->createElement("response");
$responseTag->setAttribute("Result", $Result);