PHP簡易照会画面
4926 ワード
<html>
<style type='text/css'>
table {border-collapse:collapse;}
td {border:solid 1px #ddd;}
style>
<body>
php
$link=mysql_connect("IP","User","Pwd");
if(!$link) echo " !";
else echo " !";
?>
<form action="" method="post">
<label for="A"> label>
<input type="text" id="A" name="cust" />
<br />
<label for="B"> label>
<input type="text" id="B" name="cust_id" />
<input type="submit" name="submit" value=" " />
form>
php
if (isset($_POST['submit'])) {
$cust = $_POST['cust'];
$cust_id = $_POST['cust_id'];
mysql_select_db("myoabird", $link); //
$q = "SELECT a,b,a FROM c where a='$cust' or b='$cust_id'"; //SQL
mysql_query("SET NAMES GB2312");
$rs = mysql_query($q, $link); //
if(!$rs){die(" !");}
echo "";
echo "";
while($row = mysql_fetch_row($rs)) echo ""; //
echo " $row[0] $row[1] $row[2]
";
mysql_free_result($rs); //
}
?>
body>
html>
転載先:https://www.cnblogs.com/z5337/p/4459333.html