<?php
$srver = $_GET['S'];
$fnum = $_GET['F'];
if ($srver == '')($connect = odbc_connect('van' ,'user' , 'password'));
if ($srver == '') {$other_srvr = 'T' ; $other = 'Toronto';}
if ($srver == 'V') ($connect = odbc_connect('van' ,'user' , 'password'));
if ($srver == 'V') {$other_srvr = 'T' ; $other = 'Toronto';}
if ($srver == 'T') ($connect = odbc_connect("tor" ,"user" , "password"));
if ($srver == 'T') {$other_srvr = 'V' ; $other = 'Vancouver';}
if ($fnum == '') {$Fnumber = '&F=' ;}
echo "<form method='post' action=$PHP_SELF> ";
echo "<a href='mypage.php?S=$other_srvr$Fnumber'>Change Server to $other</a>" ;
echo "<br>";
echo "<strong> Filter Number : </strong><input name='F' type='text' size='20'>";
echo" <input type='submit' name='submit' value='Search' />"; # Create submit button
echo "</form>";
$sum = array();
if (isset($_POST['submit']))
{
$r = "1" ;
}
else
{
$query = Select abc from table;
}
odbc_close($connect);
?>
所以这是我的代码。问题是我如何让页面提交它只是刷新。有人可以解释一下吗?其次,我正在检查带有 if 语句的服务器,有没有办法在单行中做到这一点。我似乎无法找到它的工作。
谢谢