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 ......
PHP作为一种服务器端的脚本语言,象编写简单,或者是复杂的动态网页这样的任务,它完全能够胜任。但事情不总是如此,有时为了实现某个功能,必须借助于操作系统的外部程序(或者称之为命令),这样可以做到事半功倍。
那么,是否可以在PHP脚本中调用外部命令呢?如果能,如何去做呢?有些什么方面的顾虑呢?相 ......
PHPChina【郑州】认证中心- -PHP全能班(2009年11月14日开课)
改变职业人生,成就新的事业,PHP--全球最热门网站开发技术!
国内排名前十名的网站中使用PHP的有8家:百度、腾讯网、新浪、搜狐、网易、淘宝、雅虎中国、Tom在线。国内近两年新推出的web2.0网站中,有80%使用 ......
PHP中居然没有读取BMP格式图片的函数,还好高人已经写好一个,我没看代码,反正能正常使用.
imagecreatefrombmp -- 从 BMP 文件或 URL 新建一图像
function imagecreatefrombmp($file)
{
global $CurrentBit, $echoMode;
$f=fopen($file,"r");
$Header=fread($f,2);
if($Header=="BM" ......
如果只是一个数据库的话,我们一般习惯这样写:mysql_select_db("guestbook");
mysql_query('select * from users');
但是如果是连接多个mysql,有可能出现同名的数据库,或者数据库中出现同名的表,所以就必须用完整的形式了,如下代码:
<?php
$link1 = mysql_connect('localhost1','root','root');
mysql ......