JS 和PHP 数据库操作在一个页面
<?
require ("config.php3");
?>
<?
if($submit)
{
//echo $action;
//if($action=='update')
if($id)
{
$query="update banner_place set adv_plc='$adv_plc',size='$size',description='$description' where id=$id";
$message="update banner place ";
}
else
{
$query="insert into banner_place (adv_plc,size,description) values ('$adv_plc','$size','$description')";
$message="added banner place " ;
}
$my_res = mysql_db_query($phpAds_db, $query) or mysql_die();
// Header("Location: banner.php3?pageid=$pageid&message=".urlencode($message));
// Header("Location: banner.php3");
echo "<script>window.location.href ='admin.php3?pageid=$pageid&message=$message'</script>";
exit();
}
?>
<?
相关文档:
<?php
// An array of allowed users and their passwords
$users = array(
'harryf' => 'secret',
'tom' => 'mypwd'
);
// If there's no Authentication header, exit
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic real ......
魔术引用发生作用是在传递$_GET,$_POST,$_COOKIE时
1.
条件: magic_quotes_gpc=off
写入数据库的字符串未经过任何过滤处理。从数据库读出的字符串也未作任何处理。
数据: $data=”snow”’’sun” ; (snow和sun之间是四个连续的单引号).
操作: 将字符串:”snow”’& ......
这些天想作一个在网站中实现插件的功能,谷歌了一下,发现一篇文章感觉对我帮助很大,帖出来和大家分享,废话不多说,直接帖出代码供大家分析:
首先是插件的管理类的实现:
<?
/**
* STBLOG PluginManager Class
*
* 插件机制的实现核心类
*
* @package STBLOG
* @subpackage Libraries
* @ ......
PHP中居然没有读取BMP格式图片的函数,还好高人已经写好一个,我没看代码,反正能正常使用.
imagecreatefrombmp -- 从 BMP 文件或 URL 新建一图像
function imagecreatefrombmp($file)
{
global $CurrentBit, $echoMode;
$f=fopen($file,"r");
$Header=fread($f,2);
if($Header=="BM" ......