今天下午试着把用PHP编写的经济学院新版网站上传到中南民族大学的服务器上,本来以为一切就OK了,没想到运行时遇到一大堆的错误提示。
  例如:
  Notice: Undefined index: delete in /home/economics/public_html/new/admin/news.php on line 22
  Notice: Undefined variable: pagehome in /home/economics/public_html/new/admin/news.php on line 548

  找到错误提示对应的代码行,$sort=$HTTP_GET_VARS["delete"];,代码书写没错,只不过取得的变量值是空值,因为我将许多功能集成在一个PHP文件中,在实现其它功能时才从表单给它赋值。
  思考了一下原因,我是在Windows+Apache2.0.52 (WINNT)+PHP5.0.0和Windows+IIS6.0+PHP5.0.0环境下编写、调试网站PHP程序的,而学校的服务器是Fedora Core(Linux)+Apache/2.0.52 (Fedora)+PHP4.3.9,不同版本不同运行环境下的PHP兼容性不好。试着在Fedora Core的前身Red Hat Linux 9的环境下运行经济学院网站的PHP程序,也没问题。看来就是学校服务器上的那个该死的Fedora Core惹的祸了。
  在网上寻找对策,一个解决方案是:“由于变量未定义引起的,打开php.ini,将;error_reporting = E_ALL & ~E_NOTICE前的分号去掉;如果你想关闭任何错误提示,打开php.ini,找到display_errors,设置为display_errors = Off,以后任何错误都不会提示。”但是我不可能去改学校服务器的php.ini配置吧,这个方案被我否定了。
  看来我只好从我的程序本身下手了,把类似$sort=$HTTP_GET_VARS["delete"];的换成if(isset($HTTP_GET_VARS["delete"])){$sort=$HTTP_GET_VARS["delete"];},作个判断,如果delete传递过来的表单值不为空,才执行后面获取表单值的语句。但在修改过程中发现,这种方法太麻烦,效果也不是很理想。突然,在PHP手册中搜索到函数error_reporting(0);官方解释是Turn off all error reporting,于是把error_reporting(0);加到PHP程序的首行,运行后果然没出现任何错误提示,终于解决了这个难题。

Tags:



电脑杂谈 | 评论(29) | 引用(0) | 阅读(38398)
小子 Email
2011-5-4 11:42
你好,现在争论一个问题,我朋友说你的这个方法存在着安全的问题,我想问一下??
louis vuitton uk Email Homepage
2011-11-22 17:21
This louis vuitton uk for sale belongs to the sounding just what are termed as Louis Vuitton vintage best sellers, many other products and services for the reason that range appearing companies.You will easily notice the unfold zippers of this coach outlet store online. That is the decoration. There are some inside pockets for you as well. They are easy to match your clothes and to carry.Let us inspire your inner beauty with fine christian louboutin sale. Purse the elegance in bridal wedding. Enjoy the fashion.
armani watches Email Homepage
2011-11-23 10:21
If you are looking for armani Bags, our armani watches Handbags Canada outlet store is your first choice. We promise Original Packing and Best Discount,3-5 Workdays To Your Door!If you buy bags and purses of the latest new designs from the louis vuitton outlet now, you can enjoy special discounts. What else are you waiting for?After you choose the right kind of plants and the size pot for the plant.
QQ个性 Homepage
2012-6-11 09:47
Bottega Veneta Clutch Email Homepage
2012-7-11 11:53
Low cost yves saint laurent is favorite all over the globe from famous people to housewife Cheap Coach Handbags
Louis Vuitton Handbags Email Homepage
2012-8-9 18:06
******
The Cubs may want to suspend him not having buy the rest in the period if that is definitely a possibility Jimmy Choo Handbags
Louis Vuitton Handbags On Sale Email Homepage
2012-8-29 13:32
******David Mizrahi and Guy Morrison done surveys about the South American coast off Suriname Coach Outlet
Louis Vuitton Purses For Sale Email Homepage
2012-9-3 15:38
Marcus has become the worlds very best photographers and while his residence and studio have been spared Coach Outlet
baozang
2012-9-22 11:56
Lamo - Like Sebago, Louis Vuitton Canada  there are only about 40 styles of Lamo Footwear.  Most of their footwear uses a suede leather traditional in True Religion Jeans  moccasins, though only about 1/3 of the footwear collection is a traditional moccasin look. True Religion Brand Jeans The rest of the collection is slippers and UGG styled boots.Louis Vuitton Artsy The traditional moccasins do have a soft rubber sole making them great deck True Religion Sale shoes as well, however. Expect to pay between $50 and $60 for Lamo moccasins.
seooj Email Homepage
2020-3-9 15:26
minuman penyegar seperti https://tokoobatkuatbekasi.com/bentrap-original-cod-di-tambun-utara sekarang ini banyak digemari oleh pria untuk memelihara stamina agar tetap perkasa saat berhubungan badan. https://kantinartikel.com/2019/09/20/manfaat-viagra-asli-untuk-pria-dewasa .  produk https://jualobatkuatkarawang.com/bentrap-asli-cod-karawang ini banyak diminati karena sudah memiliki sertifikat halal yang keabsahan bisa anda yakini 100% dapat memberi manfaat bagi pria yang ingin mendapatkan klimaks saat berhubungan badan. https://seoaris.weebly.com/blog/dimana-mendapatkan-viagra-asli-usa . kekuatan https://tokoobatkuatsemarang.net/bentrap-cod-di-tugu-semarang dalam memberikan stamina pria sudah teruji kliniks mampu memberikan kelebihan yang ganda saat dirajang, oleh karena itu nama https://tokoobatkuatbandung.com/bentrap-asli-cod-bandung lebih cepat melambung ditelinga masyarakat meskipun produk baru yang beredar dimasyarakat. obat kuat dalam kemasan terbaru seperti https://obatkuatasliherbal.com/obat-kuat-permen/permen-soloco-obat-kuat-chocolate sangat cocok bisa menambah suasana romantis yang mendalam untuk mencapai kepuasan saat bercinta bersama pasangan. https://seoaris.wordpress.com/2019/09/21/viagra-asli-rajanya-obat-perkasa . wanita membutuhkan durasi yang lama saat berhubungan badan, obat luar seperti https://tokoobatkuatpria.com/hajar-jahanam-cair-obat-kuat-original bisa mencegah terjadinya ejakulasi dini yang terlalu cepat jadi bisa menambah kepuasan dalam bercinta bersama pasangan. https://duniaglamor.wordpress.com/2019/09/21/viagra-asli-dapat-meningkatkan-libido . satu lagi obat luar jenis cream yang sekarang ini banyak diburu seperti https://tokoobatkuatasli.com/obat-kuat-oles/cream-stud-007-obat-kuat-aman yang sekaligus dapat digunakan sebagai gel pelicin sebelum berhubungan intim agar mempermudah masuknya saat penetrasi. https://seoaris.blogspot.com/2019/09/viagra-asli-bikin-pria-tampil-perkasa.html . besar dan panjangnya ukuran alat kelamin pria bisa menambah kepuasan wanita secara maksimal dengan cara menggunakan terapi https://www.vimaxaslicentre.com/vimax-pro-extender-alat-pembesar-penis secara rutin akan mendapatkan hasil yang maksimal.
Williams Email Homepage
2022-2-3 03:32
We are dealing online and will like to support you if you need some content related information, please go through my network and share your reviews about learninghappenshere.com that is unique, today, artificial intelligence has become the best thing online, you need to just go through it for free.
lindalee Email
2022-4-21 09:55
I adore your websites way of raising the awareness on your readers  drift boss fnf 2
Apartment Painting Services Email Homepage
2022-5-5 15:45
The great thing about this post is quality information. I always like to read amazingly useful and quality content.Your article is amazing, thank you for sharing this article.
Home Painting in Qatar Email Homepage
2022-5-5 16:08
Thanks for sharing this with so much of detailed information, its much more to learn from your article. Keep sharing such good stuff.
sunnyoh123
2022-5-16 11:02
This is an excellent article. This website has a lot of important information. The two games I'll show you today, gartic phone and ovo game, are among the most popular nowadays. Let's play and have fun.
shzz Email
2022-7-16 17:29
This was among the best posts and episode from your team it let me learn many new things.  online scams
shz Email
2022-7-16 17:53
The material and aggregation is excellent and telltale as comfortably.   online scams
shz Email
2022-7-16 17:57
Thank you for helping people get the information they need. Great stuff as usual. Keep up the great work!!!  online scams
分页: 1/2 第一页 1 2 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]