|
查看: 1120|回复: 9
|
php4可运行, 但在php5不可运行, 帮帮忙 PLEASeeeeee
[复制链接]
|
|
|
<form name="search" method="get" action="search_status.php">
Search for Application Status
<Select NAME="field" style="width:470px">
<Option VALUE="Peringkat Awal">Peringkat Awal</option>
<Option VALUE="Lengkap Siap">Lengkap Siap</option>
<Option VALUE="Tunggu">Tunggu</option>
<Option VALUE="Kaji Siasat">Kaji Siasat</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input name="Display" value="Personal" type="hidden" />
<input type="submit" name="search" value="Go" />
</form>
<form name="search" method="get" action="search_application.php">
Seach for: <input type="text" name="find" style="width:270px"/> in
<Select NAME="field" style="width:170px">
<Option VALUE="name">Applicant Name</option>
<Option VALUE="phone">Streamyx No.</option>
<Option VALUE="caseid">Streamyx Package</option>
<Option VALUE="nric">IC Number</option>
<Option VALUE="date">Date of Submission</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input name="Display" value="Personal" type="hidden" />
<input type="submit" name="search" value="Go" />
</form>
<br>
<?php
session_start();
include 'checkSession.php';
// $Search_SQL = "";
if ($_GET["Display"] == "Personal"){
$Search_SQL = "SELECT * FROM personalstatus WHERE " .$_GET["field"]. " like '%" .$_GET["find"]. "%' Order By " .$_GET["field"];
}
elseif ($_GET["Display"] == "Biz"){
$Search_SQL = "SELECT * FROM companystatus WHERE " .$_GET["field"]. " like '%" .$_GET["find"]. "%' AND agentid = '" .$_SESSION['agentID']. "' Order By " .$_GET["field"];
}
//This is only displayed if they have submitted the form
if ($searching =="yes")
{
//If they did not enter a search term we give them an error
if ($find == "")
{
echo "<p>You forgot to enter a search term";
exit;
}
// Otherwise we connect to our Database
mysql_connect("localhost", "xxxxxx", "xxxxxx") or die(mysql_error());
mysql_select_db("xxxxxx") or die(mysql_error());
// We preform a bit of filtering
$find = strtoupper($find);
$find = strip_tags($find);
$find = trim ($find);
$Limit = 10; //Number of results per page
//Now we search for our search term, in the field the user specified
$data = mysql_query("$Search_SQL");
$rows = mysql_fetch_array($data);
//$myrow = mysql_fetch_array($data);
//$numrows=$myrow[0];
//$myrows=ceil($rows/$page);
$myrows=$rows[0];
$page=$_GET["page"]; //Get the page number to show
If($page == "") $page=1; //If no page number is set, the default page is 1
//Get the number of results
$SearchResult=mysql_query("$Search_SQL");
$NumberOfResults=mysql_num_rows($SearchResult);
//Get the number of pages
$NumberOfPages=ceil($NumberOfResults/$Limit);
$SearchResult=mysql_query("$Search_SQL LIMIT " . ($page-1)*$Limit . ",$Limit");
include 'p1.php';
While($row = mysql_fetch_array($SearchResult)) {
include 'p2.php';
}
$Nav="";
echo "Total Records: ".$NumberOfResults." entries <br>" ;
echo "Total Page: ".$NumberOfPages." page (".$page."/".$NumberOfPages.")";
If($page > 1) {
$Nav .= " <A HREF=\"search_application.php?page=" . ($page-1) . "&find=$find&field=$field&searching=yes&Display=Personal&search=Search\"><< Prev</A> ";
}
For($i = 1 ; $i <= $NumberOfPages ; $i++) {
If($i == $page) {
$Nav .= "<B>[$i]</B>";
}Else{
$Nav .= " <A HREF=\"search_application.php?page=" . $i . "&find=$find&field=$field&searching=yes&Display=Personal&search=Search\">$i</A> ";
}
}
If($page < $NumberOfPages) {
$Nav .= "<A HREF=\"search_application.php?page=" . ($page+1) . "&find=$find&field=$field&searching=yes&Display=Personal&search=Search\">Next >></A> ";
}
Echo "<BR><BR>" . $Nav;
//This counts the number or results - and if there wasn't any it gives them a little message explaining that
$anymatches=mysql_num_rows($data);
if ($anymatches == 0)
{
echo "Sorry, but we can not find an entry to match your query<br><br>";
}
//And we remind them what they searched for
echo "<b>Searched For:</b> " .$find;
}
?> |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 20-8-2007 03:42 PM
|
显示全部楼层
不好意识,将整个code搬上来因为找了很久还是不能settle.
之前是用php4, 过后 renew hosting & domain,他们用php5。 一些可走一些不可。
有办法解结吗 帮帮忙
谢谢 |
|
|
|
|
|
|
|
|
|
|
发表于 20-8-2007 07:59 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 20-8-2007 08:39 PM
|
显示全部楼层
谢谢你的回复。它Langsung不 work. kosong 什莫都没出来。只是出现这个而已。database没出来。
<form name="search" method="get" action="search_status.php">
Search for Application Status
<Select NAME="field" style="width:470px">
<Option VALUE="Peringkat Awal">Peringkat Awal</option>
<Option VALUE="Lengkap Siap">Lengkap Siap</option>
<Option VALUE="Tunggu">Tunggu</option>
<Option VALUE="Kaji Siasat">Kaji Siasat</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input name="Display" value="Personal" type="hidden" />
<input type="submit" name="search" value="Go" />
</form>
<form name="search" method="get" action="search_application.php">
Seach for: <input type="text" name="find" style="width:270px"/> in
<Select NAME="field" style="width:170px">
<Option VALUE="name">Applicant Name</option>
<Option VALUE="phone">Streamyx No.</option>
<Option VALUE="caseid">Streamyx Package</option>
<Option VALUE="nric">IC Number</option>
<Option VALUE="date">Date of Submission</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input name="Display" value="Personal" type="hidden" />
<input type="submit" name="search" value="Go" />
</form> |
|
|
|
|
|
|
|
|
|
|
发表于 20-8-2007 11:47 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 21-8-2007 09:57 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 21-8-2007 09:59 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 21-8-2007 11:16 AM
|
显示全部楼层
|
我找到的的原因不是PHP5 不SUPPORT 而是 SERVER ADMIN 那些人没有开_GET 的SETTING |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 21-8-2007 03:26 PM
|
显示全部楼层
原帖由 vampcheah 于 21-8-2007 11:16 AM 发表 
我找到的的原因不是PHP5 不SUPPORT 而是 SERVER ADMIN 那些人没有开_GET 的SETTING
那么怎么样开 _GET 的SETTING 呢? |
|
|
|
|
|
|
|
|
|
|
发表于 27-8-2007 12:48 PM
|
显示全部楼层
原帖由 ipaxnet 于 21-8-2007 09:59 AM 发表 
在问一问.Session要怎样改呢有谁知道
谢谢
session 改什么?
_GET 的SETTING 是SERVER SIDE 的改动.因为我用LOCALHOST 所以才自己调整.(其实也是朋友教我的啦) |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|