File: //www/备份的/www.giornb.tw/et/add.php
<div style="height:1000px;width:100%"></div>
<?php
header("Content-Type:text/html;charset=utf-8");
session_start();
//首先判断Cookie是否有记住用户信息
if(isset($_COOKIE['username']))
{
$_SESSION['username']=$_COOKIE['username'];
$_SESSION['islogin']=1;
}
if(isset($_SESSION['islogin']))
{
//已经登录
echo $_SESSION['username'].":你好,欢迎进入个人中心!<br/>";
echo "<a href='logout.php'>注销</a>";
}
else
{ //为登录
echo '
<script LANGUAGE="JavaScript">
window.location="ht.html";
</script>
';
}
?>
<?php
if($_POST[submit]){
$addtime = time();//提交时间
//图片上传库开始
$filefile=$_POST["file"];
$file = $_FILES['file'];//得到传输的数据
//得到文件名称
$tuname = $file['name'];
$type = strtolower(substr($tuname,strrpos($tuname,'.')+1)); //得到文件类型,并且都转化成小写
$allow_type = array('jpg','jpeg','gif','png'); //定义允许上传的类型
//判断文件类型是否被允许上传
// if(!in_array($type, $allow_type)){
// //如果不被允许,则直接停止程序运行
// return ;
// }
//判断是否是通过HTTP POST上传的
// if(!is_uploaded_file($file['tmp_name'])){
// //如果不是通过HTTP POST上传的
// return ;
// }
if($tuname!=""){
$upload_path = "uploads/"; //上传文件的存放路径
}
//开始移动文件到相应的文件夹
if(move_uploaded_file($file['tmp_name'],$upload_path.$addtime.$file['name'])){
// echo "Successfully!";
}else{
// echo "Failed!";
}
//图片上传库结束
if($tuname==""){
$face="空值";
}
else{
$face = $addtime.$tuname;
}
$title = $_POST["title"];
if($title==""){
$title="空值";
}
$name = $_POST["name"];
if($name==""){
$name="空值";
}
$weixinhao = $_POST["weixinhao"];
if($weixinhao==""){
$weixinhao="空值";
}
$shouji = $_POST["shouji"];
if($shouji==""){
$shouji="空值";
}
$insert = "{$title}%%{$name}%%{$face}%%{$weixinhao}%%{$shouji}%%{$addtime}@@@";
$content = file_get_contents("info.txt");
file_put_contents("info.txt",$content.$insert);
// echo "<script language=javascript>alert('留言成功!');history.go(-1);</script>";
echo "<script language=javascript>alert('添加line成功!');window.location='ht.php';</script>";
}
?>
<?php
if($_POST[submit6]){
$addtime = time();//提交时间
//图片上传库开始
$filefile=$_POST["file"];
$file = $_FILES['file'];//得到传输的数据
//得到文件名称
$tuname = $file['name'];
$type = strtolower(substr($tuname,strrpos($tuname,'.')+1)); //得到文件类型,并且都转化成小写
$allow_type = array('jpg','jpeg','gif','png'); //定义允许上传的类型
//判断文件类型是否被允许上传
// if(!in_array($type, $allow_type)){
// //如果不被允许,则直接停止程序运行
// return ;
// }
//判断是否是通过HTTP POST上传的
// if(!is_uploaded_file($file['tmp_name'])){
// //如果不是通过HTTP POST上传的
// return ;
// }
if($tuname!=""){
$upload_path = "uploads/"; //上传文件的存放路径
}
//开始移动文件到相应的文件夹
if(move_uploaded_file($file['tmp_name'],$upload_path.$addtime.$file['name'])){
// echo "Successfully!";
}else{
// echo "Failed!";
}
//图片上传库结束
if($tuname==""){
$face="空值";
}
else{
$face = $addtime.$tuname;
}
$title = $_POST["title"];
if($title==""){
$title="空值";
}
$name = $_POST["name"];
if($name==""){
$name="空值";
}
$ws = $_POST["ws"];
if($ws==""){
$ws="空值";
}
// echo($ws);
$ws1 = $_POST["ws1"];
if($ws1==""){
$ws1="空值";
}
$insert1 = "{$title}%%{$name}%%{$face}%%{$ws}%%{$ws1}%%{$addtime}@@@";
$content1 = file_get_contents("whatsApp.txt");
file_put_contents("whatsApp.txt",$content1.$insert1);
// echo "<script language=javascript>alert('留言成功!');history.go(-1);</script>";
echo "<script language=javascript>alert('添加whatsApp成功!');window.location='ht.php';</script>";
}