佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

搜索
查看: 1121|回复: 9

php4可运行, 但在php5不可运行, 帮帮忙 PLEASeeeeee

[复制链接]
发表于 20-8-2007 03:37 PM | 显示全部楼层 |阅读模式
<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;
}
?>
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 20-8-2007 03:42 PM | 显示全部楼层
不好意识,将整个code搬上来因为找了很久还是不能settle.

之前是用php4, 过后 renew hosting & domain,他们用php5。 一些可走一些不可。

有办法解结吗 帮帮忙

谢谢
回复

使用道具 举报

发表于 20-8-2007 07:59 PM | 显示全部楼层
什么ERROR ?
回复

使用道具 举报

 楼主| 发表于 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 | 显示全部楼层
原帖由 ipaxnet 于 20-8-2007 08:39 PM 发表
谢谢你的回复。它Langsung不 work. kosong 什莫都没出来。只是出现这个而已。database没出来。


Search for Application Status

Peringkat Awal
Lengkap Siap
Tunggu
Kaji Siasat








S ...

不明白你在讲什么
我看到的CODE 都应该是没什么大问题,而且PHP 5 SUPPORT 的比 PHP4 来得多,该不会突然不能跑吧。 曾经也试过差不多的情况出现过,原因是不能SUPPORT $_GET 和 $_POST, 换去 $HTTP_GET_VARS就好了
回复

使用道具 举报

 楼主| 发表于 21-8-2007 09:57 AM | 显示全部楼层
原帖由 vampcheah 于 20-8-2007 11:47 PM 发表

不明白你在讲什么
我看到的CODE 都应该是没什么大问题,而且PHP 5 SUPPORT 的比 PHP4 来得多,该不会突然不能跑吧。 曾经也试过差不多的情况出现过,原因是不能SUPPORT $_GET 和 $_POST, 换去 $HTTP_ ...


对,php5不能SUPPORT $_GET 和 $_POST。我找到方法了.用了整晚时间终于给我找到方法,也知道很多人有我这问题.在这分享给大家知.只要在开头反放这个就可走了.

extract($_GET);

谢谢
回复

使用道具 举报

Follow Us
 楼主| 发表于 21-8-2007 09:59 AM | 显示全部楼层
在问一问.Session要怎样改呢有谁知道

谢谢
回复

使用道具 举报

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

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 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 所以才自己调整.(其实也是朋友教我的啦)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2026 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 14-5-2026 02:26 AM , Processed in 0.088955 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表