code
stringlengths
1
2.01M
language
stringclasses
1 value
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /** * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /** * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
PHP
<?php /** * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
PHP
<?php /* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2008 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distrib...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright (c) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
PHP
<?php /** * Model for storing OAuth credentials used for API requests and interaction * with the OAuth authorization server. * * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a ...
PHP
<?php /** * Handler for API requests from DrEdit PHP frontend. These requests * retrieve, save or create files in Google Drive using pre-established * authorization information stored in the session. * * @author Ryan Boyd <rboyd@google.com> * * Copyright 2012 Google Inc. * * Licensed under the Apache Licens...
PHP
<?php /** * Handler for API requests from DrEdit PHP frontend. These requests * retrieve, save or create files in Google Drive using pre-established * authorization information stored in the session. * * @author Ryan Boyd <rboyd@google.com> * * Copyright 2012 Google Inc. * * Licensed under the Apache Licens...
PHP
<?php /** * Include to output configuration errors. * * @author Ryan Boyd <rboyd@google.com> * * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * ...
PHP
<?php /** * Include for web requests which ensures that all required configuration * for DrEdit PHP is complete, including the database and OAuth config. * * @author Ryan Boyd <rboyd@google.com> * * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not us...
PHP
<?php /** * Configuration for DrEdit PHP. Developers need to define the OAuth * and databse configuration in constants. * * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy o...
PHP
<?php /** * Handler for API requests from DrEdit PHP frontend. These requests * retrieve, save or create files in Google Drive using pre-established * authorization information stored in the session. * * @author Ryan Boyd <rboyd@google.com> * * Copyright 2012 Google Inc. * * Licensed under the Apache Licens...
PHP
<?php /** * Main entry point for web requests to the DrEdit PHP application. Checks * authentication and authorization using auth_handler.php, checks configuration * using check_config.php, and then spawns the output_editor.php to load the web * interface. * * @author Ryan Boyd <rboyd@google.com> * * Copyright...
PHP
<?php $SECRET = "whatevercodeyouwantittobe"; $PW = "yourgmailsmtppassword"; ?>
PHP
<?php function mylog($msg) { $fmt = "[%s] [%s] %s\n"; $ip = $_SERVER['REMOTE_ADDR']; $time = date('d.m.Y h:i:s'); $line = sprintf($fmt, $time, $ip, $msg); error_log($line, 3, "/home/kalugny/logs/user/emailbyweb.log"); } function exce...
PHP
<?php //Indexed array $indarr = array("I","Me","Myself"); echo $indarr[0]." ".$indarr[1]. " " .$indarr[2]; print_r($indarr[0]." ".$indarr[1]. " " .$indarr[2]); $cnt = count($indarr); for($x=0;$x<$cnt;$x++) { echo "<br/>Hai=>".$indarr[$x]; } //associative array $assarr = array("I"=>"1", "Me"=>"2", "Myself...
PHP
<?php $favcolor="red"; switch ($favcolor) { case "red": echo "Your favorite color is red!"; break; case "blue": echo "Your favorite color is blue!"; break; case "green": echo "Your favorite color is green!"; break; default: echo "Your favorite color is neither red, blue, or green!"; } ?>
PHP
<?php $i=1; while($i<=5) { echo "The number is " . $i . "<br>"; $i++; } echo "<br/>"; $j=1; do { $j++; echo "The number is " . $j . "<br>"; } while ($j<=5); ?>
PHP
<?php include 'include1.php'; echo "1. Basic include<br>"; echo "A $color $fruit<br> "; // A echo "A $color $fruit"; // A green apple echo "<br>"; echo "2. Including within functions<br>"; function foo() { global $color; include 'include1.php'; echo "A $color $fruit"; } foo(); ...
PHP
<?php echo 'Object oriented style<br/>'; $date = new DateTime('2013-03-11'); echo 'YYYY-MM-DD HH-II-SS - >'. $date->format('Y-m-d H:i:s'); echo '<br/>'; echo 'YYYY-MM-DD - >'. $date->format('Y-m-d'); echo '<br><br> Procedural style<br>'; $date = date_create('2013-03-11'); echo date_format($date, 'Y-m-d H:i:...
PHP
<?php try { $con = mysql_connect('localhost', 'root', ''); if(!$con) { throw new Exception('Error In Connection!'); } $db = mysql_select_db('training', $con); if(!$db) { throw new Exception('Error In db!'); } } catch(Exception $e) { echo $e->getMessage(); exit; } ?>
PHP
<?php include 'db.php'; if(isset($_POST['register'])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $uname = $_POST['uname']; $email = $_POST['email']; $pass = $_POST['pass']; $country = $_POST['country']; if(! empty($_POST['color']) && is_array($_POST["color"])){ $color = implode(',', $_POST...
PHP
<?php include 'db.php'; $id = $_REQUEST['userid']; $countries = array("India", "Others"); if(isset($id)) { $result = "select * from users where id = $id"; $set = mysql_query($result); while($data = mysql_fetch_array($set)) { $firstname = $data['firstname']; $lastname = $data['lastname']; $username...
PHP
<?php include 'db.php'; $id = $_REQUEST['userid']; $q = "DELETE FROM users WHERE id = $id"; $query = mysql_query($q); if(!$query) { echo 'error in query'; } else { header('Location: http://localhost/training/W3/myaddeditdel/index.php'); } ?>
PHP
<?php $color = 'green'; $fruit = 'apple'; ?>
PHP
<?php echo "PHP Stands for- Hypertext PreProcessor<br/>"; //php variables $x=5; $y=6; $z=$x+$y; echo $z; echo '<br/>'; $c=5; // global scope function myTest1() { global $c; echo $c; // local scope } myTest1(); echo '<br/>'; $x=5; // global scope $y=10; // global scope function myTest() { glob...
PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Welcome</title> </head> <body> Welcome <?php echo $_GET["fnam...
PHP
<?php require("db.php"); $id =$_REQUEST['BookID']; $result = mysql_query("SELECT * FROM users WHERE BookID = '$id'"); $test = mysql_fetch_array($result); if (!$result) { die("Error: Data not found.."); } $Title=$test['Title'] ; $Author= $test['Author'] ; $PublisherName=$test['Publi...
PHP
<?php $conn = mysql_connect('localhost', 'root', ''); if (!$conn) { die('Could not connect: ' . mysql_error()); } mysql_select_db("training", $conn); ?>
PHP
<?php include("db.php"); $id =$_REQUEST['BookID']; // sending query mysql_query("DELETE FROM books WHERE BookID = '$id'") or die(mysql_error()); header("Location: index.php"); ?>
PHP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Books</title> </head> <body> <form method="post"> <tabl...
PHP
<?php for ($i=1; $i<=5; $i++) { echo "The number is " . $i . "<br>"; } echo "<br/>"; $x=array("one","two","three"); foreach ($x as $value) { echo $value . "<br>"; } ?>
PHP
<?php require_once("konf.php"); if(isSet($_REQUEST["uue_tehniku_id"])){ $kask=$yhendus->prepare( "UPDATE parandused SET tehnik=(?) WHERE id=?"); $tehnikulisa="\n".$_REQUEST["uus_tehnik"]."\n"; $kask->bind_param("si", $tehnikulisa, $_REQUEST["uue_tehniku_id"]); $kask->execute(); } if(!empty($_REQUEST["kustuta_id"])){...
PHP
<?php require_once("konf.php"); if(!empty($_REQUEST["valmis_id"])){ $kask=$yhendus->prepare( "UPDATE parandused SET valmis=1 WHERE id=?"); $kask->bind_param("i", $_REQUEST["valmis_id"]); $kask->execute(); } $kask=$yhendus->prepare( "SELECT id, kirjeldus, kontakt, nimi, tehnik, valmis FROM parandu...
PHP
<?php require_once("konf.php"); if(isSet($_REQUEST["sisestusnupp"])){ $kask=$yhendus->prepare("INSERT INTO parandused(kontakt, nimi, kirjeldus) VALUES (?,?,?)"); echo $yhendus->error; $kask->bind_param("sss", $_REQUEST["kontakt"], $_REQUEST["nimi"], $_REQUEST["kirjeldus"]); $kask->execute(); $yhendus->close(); header...
PHP
<?php $yhendus=new mysqli("localhost", "if13", "ifikad", "if13_rongelst"); session_start(); if(isSet($_REQUEST["kasutajanimi"])){ $kask=$yhendus->prepare( "SELECT roll FROM kasutajad WHERE knimi=? AND paroolir2si=PASSWORD(?)"); $knimiparool=$_REQUEST["kasutajanimi"]."_".$_REQUEST["parool"]; $kask->bind_param("ss...
PHP
<?php $baasiaadress="localhost"; $baasikasutaja="if13"; $baasiparool="ifikad"; $baasinimi="if13_rongelst"; $yhendus=new mysqli($baasiaadress, $baasikasutaja, $baasiparool, $baasinimi);
PHP
<?php define('ENTRIES_PER_PAGE', 20); define('CATEGORY', 'cat:cs.*'); ?> <?php set_time_limit(0); include_once('libs/xmlparser.lib.php'); include_once('libs/mysql.lib.php'); include_once('libs/hints.php'); include_once('libs/insert_builder.php'); $dbconf = array ( 'host' => "localhost", 'port' => "...
PHP
<?php class insert_builder { /* * My private variable */ private $str_table = ''; private $arr_fields = array(); private $arr_values = array(); public function reset() { $this->str_table = ''; $this->arr_fields = array(); $this->arr_values = array();...
PHP
<?php /****************************************************************************** $Id: mysql.lib.php5,v 2.4.1-1 2006/10/19 00:43:54 trash Exp $ ******************************************************************************* PHP MySQL Simple Library ---------...
PHP
<?php class XMLParser { var $url; var $result; function __construct ($url = "") { $this->url = $url; $this->result = $this->xml2array($url); } private function xml2array ($url, $get_attributes = 1, $priority = 'tag') { $contents = ""; if (!function_exists('xml_parser_create')) ...
PHP
<?php function _log ($string) { echo "<pre>" . $string . "</pre>"; } function debug ($object) { $debug_string = ""; $debug_string = print_r($object, true); echo "<pre>" . $debug_string . "</pre>"; die(); } function make_seed () { list($usec, $sec) = explode(' ', microtime()); return (float) $sec ...
PHP
<?php /** * Include to output configuration errors. * * @author Ryan Boyd <rboyd@google.com> * * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * ...
PHP
<?php /** * Model for storing OAuth credentials used for API requests and interaction * with the OAuth authorization server. * * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a ...
PHP
<?php /** * Configuration for DrEdit PHP. Developers need to define the OAuth * and databse configuration in constants. * * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy o...
PHP
<?php /** * Handler for API requests from DrEdit PHP frontend. These requests * retrieve, save or create files in Google Drive using pre-established * authorization information stored in the session. * * @author Ryan Boyd <rboyd@google.com> * * Copyright 2012 Google Inc. * * Licensed under the Apache Licens...
PHP
<?php /** * Main entry point for web requests to the DrEdit PHP application. Checks * authentication and authorization using auth_handler.php, checks configuration * using check_config.php, and then spawns the output_editor.php to load the web * interface. * * @author Ryan Boyd <rboyd@google.com> * * Copyright...
PHP
<?php /** * Outputs DrEdit PHP user interface. Needs OAuth URLs and the values of * query params in order to setup the UI. These are set as javascript * vars based on PHP processing. * * @author Ryan Boyd <rboyd@google.com> * * If the user's picture is set, it is included in the interface to mitigate * potent...
PHP
<?php /** * Class for accessing the Google Drive API, including retrieving, * creating and updating files stored in Google Drive. * * Copyright 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtai...
PHP