PHP信息发布

release.php

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet">
<title>易查供求信息网</title>
<style type="text/css">
<!--
body {
    background-image: url(Images/bg.gif);
}
-->
</style></head>
<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td colspan="2"><?php include("top.php");?></td>
  </tr>
  <tr>
    <td width="217" valign="top" background="Images/line2.gif"><?php include("left.php");?></td>
    <td width="586" valign="top" bgcolor="#FEFEF6"><?php include("release_content.php");?></td>
  </tr>
  <tr>
    <td colspan="2"><?php include("bottom.php");?></td>
  </tr>
</table>
</body>
</html>

release_content.php

<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
<link href="css/style.css" rel="stylesheet">
<script language="javascript">
function checkform(form){
    for(i=0;i<form.length;i++){
        if(form.elements[i].value===""){
            alert("请将发布信息填写完整!");
            form.elements[i].focus();
                        //end the submittion
            return false;
        }
    }
}
</script>
<table width="563" height="407" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="563" height="407" valign="top" bgcolor="#FFFFFF">
      <form name="form1" method="post" action="release_ok.php" >
        <table width="563" border="0" cellspacing="0" cellpadding="0">
          <tr background="Images/mianfei.gif">
            <td height="27" colspan="2">&nbsp;</td>
          </tr>
          <tr>
            <td height="24" colspan="2">&nbsp;</td>
          </tr>
          <tr>
            <td width="130" height="30" align="right">信息类别:</td>
            <td width="433" height="30"><select name="type">
              <option value="招聘信息">-招聘信息-</option>
              <option value="求职信息" selected>-求职信息-</option>
              <option value="培训信息">-培训信息-</option>
              <option value="家教信息">-家教信息-</option>
              <option value="房屋信息">-房屋信息-</option>
              <option value="车辆信息">-车辆信息-</option>
              <option value="求购信息">-求购信息-</option>
              <option value="出售信息">-出售信息-</option>
              <option value="招商引资">-招商引资-</option>
              <option value="公寓信息">-公寓信息-</option>
              <option value="寻人/物启示">-寻人/物启示-</option>
            </select>
&nbsp;<span class="style1">*&nbsp;请正确选择您要发布的信息类别</span></td>
          </tr>
          <tr>
            <td height="30" align="right">信息标题:</td>
            <td height="30"><input name="title" type="text" id="title" size="50"></td>
          </tr>
          <tr>
            <td height="30" align="right">信息内容:</td>
            <td height="30">
              <textarea name="content" cols="50" rows="8" id="content"></textarea>
            </td>
          </tr>
          <tr>
            <td height="30" align="right">联&nbsp;系&nbsp;人:</td>
            <td height="30"><input name="linkman" type="text" id="linkman"></td>
          </tr>
          <tr>
            <td height="30" align="right">联系电话:</td>
            <td height="30"><input name="tel" type="text" id="tel"></td>
          </tr>
          <tr align="center">
            <td height="80" colspan="2">
              <input name="imageField" type="image" class="input1" src="Images/fa.jpg" width="145" height="46" border="0" onClick="return checkform(form);">
            </td>
          </tr>
        </table>
      </form>
   </td>
  </tr>
</table>
release_ok.php

<?php
header ( "Content-type: text/html; charset=gb2312" ); //设置文件编码格式
include("conn/conn.php");
$type=$_POST[type];
$title=$_POST[title];
$content=$_POST[content];
$linkman=$_POST[linkman];
$tel=$_POST[tel];
//$edate=date("Y-m-d h:i:s");
$edate=date("Y-m-d H:i:s");
$sql=mysqli_query($conn,"insert into tb_info(type,title,content,linkman,tel,checkstate,edate) values('$type','$title','$content','$linkman','$tel',0,'$edate')");
if($sql){
    echo "<script>alert('1');window.location.href='release.php';</script>";
}else{
    echo "<script>alert('0');history.back();</script>";
}
?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值