Format:
Recent snippets matching tags of php
function twitter_twitrpix_page($query) {
if (user_type() == 'oauth') {
//TwitrPix API version 2.01 allows for OAuth
//http://twitrpix.com/api/2
//Has the user submitted an image and message?
if ($_POST['message']) {
$twitrpixURL = 'http://api.twitrpix.com/2/upload.json';
//Set the initial headers
17 Views
no comments
//add function in twitter.php
function ratelimit(){
$request = API_URL."account/rate_limit_status.json";
return twitter_process($request);
}
//thema.php
function theme_limit() {
$limit = ratelimit();
12 Views
no comments
<?php
function Pinyin($_String, $_Code='UTF8') { //GBK页面可改为gb2312,其他随意填写为UTF8
$_DataKey = "a|ai|an|ang|ao|ba|bai|ban|bang|bao|bei|ben|beng|bi|bian|biao|bie|bin|bing|bo|bu|ca|cai|can|cang|cao|ce|ceng|cha".
"|chai|chan|chang|chao|che|chen|cheng|chi|chong|chou|chu|chuai|chuan|chuang|chui|chun|chuo|ci|cong|cou|cu|".
"cuan|cui|cun|cuo|da|dai|dan|dang|dao|de|deng|di|dian|diao|die|ding|diu|dong|dou|du|duan|dui|dun|duo|e|en|er".
"|fa|fan|fang|fei|fen|feng|fo|fou|fu|ga|gai|gan|gang|gao|ge|gei|gen|geng|gong|gou|gu|gua|guai|guan|guang|gui".
"|gun|guo|ha|hai|han|hang|hao|he|hei|hen|heng|hong|hou|hu|hua|huai|huan|huang|hui|hun|huo|ji|jia|jian|jiang".
"|jiao|jie|jin|jing|jiong|jiu|ju|juan|jue|jun|ka|kai|kan|kang|kao|ke|ken|keng|kong|kou|ku|kua|kuai|kuan|kuang".
"|kui|kun|kuo|la|lai|lan|lang|lao|le|lei|leng|li|lia|lian|liang|liao|lie|lin|ling|liu|long|lou|lu|lv|luan|lue".
71 Views
no comments
<?php /*php提供的URL编码函数是基于字节的,对由ie的javascript函数escape编码的数据就无能为力了。*/ function escape($str) { preg_match_all("/[\x80-\xff].|[\x01-\x7f]+/", $str, $r); $ar = $r[0]; foreach($ar as $k=>$v) { if(ord($v[0]) < 128) $ar[$k] = rawurlencode($v);
107 Views
no comments
<?php
class class_mysql{
//Инициализируем переменные
private $mysql_host = "localhost";
private $mysql_login = "qwerty";
private $mysql_passwd = "123456";
private $mysql_database;
private $mysql_connect;
private $sql_error;
83 Views
no comments
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <script type="text/javascript" src="scripts/scripts.js"></script> <br /> <b>Notice</b>: Undefined index: action in <b>/home/s3221686/public_html/3tfs/register.php</b> on line <b>7</b><br /> <div id="signup"> <form action="" method="POST" name="signupform" id="signup"> <fieldset>
91 Views
no comments
<?php //Configuration $cache_time = 60*3; //second $cache_file = "cache/".md5($_SERVER['REQUEST_URI']); if(file_exists($cache_file)) { if((time()-filemtime($cache_file)) < $cache_time) { $cache_data = file_get_contents($cache_file); if (!(strlen($cache_data) < 18 || strcmp(substr($cache_data,0,2),"\x1f\x8b"))) header( 'Content-Encoding: gzip' ); echo $cache_data;
112 Views
no comments
Genel kullandığım db fonksiyonları $table sadece table adı olabildiği gibi genelde eğer $where false verilirse sorgu değişkeni olarak da kullanılabilir. dbDelete fonksiyonu kesinlikle $where bekler. Bilirsiniz SQL en çok update ve delete'de where kullanılmadan oluşan hatalara açık olduğundan eleştirilir. Program tarafında kendimi güvene almak istedim (bu yanlış silme ve güncellemeyi 2 kez yaşadım, korkusu yeter :) ). Fonksiyonlarıma genelde dönüş değerlerine göre isim veririm. Mesela dbResult tek sonuç döner,
174 Views
no comments
<form action="procesar.php" method="get"> Primer valor: <input type="text" name="valor1" /> Segundo valor: <input type="text" name="valor2" /><br /> <input type="radio" name="radio" value="sumar" />Sumar<br /> <input type="radio" name="radio" value="restar" />Restar<br /> <input type="radio" name="radio" value="dividir" />Dividir<br /> <input type="submit" name="enviar" value="Enviar"> </form>
111 Views
no comments
<?php
if ($_REQUEST['radio'] == "sumar"){
$suma = $_REQUEST['valor1'] + $_REQUEST['valor2'];
echo $suma;
} elseif ($_REQUEST['radio'] == "restar"){
$resta = $_REQUEST['valor1'] - $_REQUEST['valor2'];
echo $resta;
} elseif ($_REQUEST['radio'] == "dividir"){
$dividir = $_REQUEST['valor1'] / $_REQUEST['valor2'];
echo $dividir; }
109 Views
no comments
[PHP] ;;;;;;;;;;;;;;;;;;; ; About php.ini ; ;;;;;;;;;;;;;;;;;;; ; This file controls many aspects of PHP's behavior. In order for PHP to ; read it, it must be named 'php.ini'. PHP looks for it in the current ; working directory, in the path designated by the environment variable ; PHPRC, and in the path that was defined in compile time (in that order). ; Under Windows, the compile-time path is the Windows directory. The
535 Views
no comments
/* Usage string test1 = StripTags("<p>George</p><b>W</b><i>Bush</i>", new string[]{"i","b"}); string test2 = StripTags("<p>George <img src='someimage.png' onmouseover='someFunction()'>W <i>Bush</i></p>", new string[]{"p"}); string test3 = StripTags("<a href='http://www.dijksterhuis.org'>Martijn <b>Dijksterhuis</b></a>", new string[]{"a"}); */
219 Views
no comments
/*database name here*/ $database = ''; /*host name for MySQL*/ $hostname = 'localhost'; /*user name for MySQL*/ $username = ''; /*password for MySQL*/ $password = ''; //Get the h3fileid
214 Views
no comments
<?php
class Ragnarok
{
var $db;
var $error;
function add_userid($userid, $user_pass, $sex, $email) {
global $mysql;
554 Views
2 comments
<?php function search_string($start , $end , $from, $number=1){ if($number<1){ $number=1; } $from = trim(str_replace("\r\n","",$from)); $i = 0; $ans = $from; if(!stristr($ans , $start)){ return false;
499 Views
no comments
abstract class FsNode { public $path; public function __construct($path) { $this->path = $path; } public function rename($newname) { rename($this->path, $newname); $this->path = $newname;
218 Views
no comments
<?php // An example callback function function my_callback_function() { echo 'hello world!'; } // An example callback method class MyClass { function myCallbackMethod() { echo 'Hello World!';
209 Views
no comments
define("MAX", 134); for ($i = 0; $i < MAX; $i ++) { system("wget 'http://webqq.qq.com/images/Face2/{$i}.gif'"); }
379 Views
no comments
//Pagina
<?php
$turno = new Turno();
echo "Turnos para la fecha ".date("Y-m-d")."</br>";
echo "<br/>";
$arrayTurnos = $turno->Buscar(date("Y-m-d"));
if($arrayTurnos){
foreach($arrayTurnos as $value){
echo $value."<br>";
}
250 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
