佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 5287|回复: 86

bug of require_once?

[复制链接]
发表于 13-2-2009 09:40 PM | 显示全部楼层

回复 30# asimo 的帖子

We are unable to log you in with the information you provided. Please check your username and password and try again

感觉上超简陋,而且尝试好几次都不行,不会是假的网站吧。
回复

使用道具 举报


ADVERTISEMENT

 楼主| 发表于 10-1-2009 08:37 PM | 显示全部楼层
请问 OReilly.Learning.Web.Design.3rd.Edition.Jun.2007 这本行吗?
回复

使用道具 举报

发表于 10-1-2009 08:54 PM | 显示全部楼层

回复 4# asimo 的帖子

e107什么来的?
下载很慢=.="
回复

使用道具 举报

 楼主| 发表于 9-1-2009 04:40 PM | 显示全部楼层 |阅读模式
本帖最后由 1max1 于 24-3-2010 05:17 PM 编辑



valid.php(A)
  1. <?php
  2. echo 'in valid.php'.'<br/>';
  3. require_once 'required/function/index.php';
  4. ?>
复制代码


test.php(B)
  1. <?php
  2. echo 'in test.php'.'<br/>';
  3. require_once 'required/function/index.php';
  4. ?>
复制代码


valid.php(C)
  1. <?php
  2. echo 'in required/function/valid.php'.'<br/>';
  3. ?>
复制代码


index.php(D)
  1. <?php
  2. echo 'in required/function/index.php'.'<br/>';
  3. require_once 'valid.php';
  4. ?>
复制代码



valid.php(A) output:
in valid.php
in required/function/index.php

test.php(B) output:
in test.php
in required/function/index.php
in valid.php

发现到valid.php(A) output 少了一行?
发现到test.php(B) output 第三行不一样?

Rename valid.php(A) to another_valid.php(A).

真真output因该是这样
another_valid.php(A) output:
in valid.php
in required/function/index.php
in required/function/valid.php


test.php(B) output:
in test.php
in required/function/index.php
in required/function/valid.php

From pedro dot evangelista at gmail dot com
Be careful when using symbolic links, because require will search the real path of the file and not the path relative to the symbolic link.

Imagine your script A.php resides on directory /a and you create a symbolic link for it on directory /b/c.
So for the code

echo realpath("../";
?>

you might expect the directory /b, but actually you get the root directory /.

If you need to include the file /b/B.php inside your A.php, you can't use the following

require "../B.php";
?>

because it will search the root directory, not the /b directory.

Regards.



这问题就那么差一点让我死无葬身之地!
各位多注意下~
回复

使用道具 举报

 楼主| 发表于 10-1-2009 12:21 PM | 显示全部楼层
没人知道吗?
回复

使用道具 举报

发表于 10-1-2009 12:37 PM | 显示全部楼层
如果你是初学者,想以书籍参考来设计如佳礼论坛的程序,
困难度太高。

我建议你找一位有实际经验的程序员当你的补习老师,
让他一边教你,一边告诉你参考什么资料
(因为要参考的资料很广,你只需要focus你有用到的)
这样对你的学习速度与达到目的的可能性都,事半功倍
回复

使用道具 举报

Follow Us
发表于 10-1-2009 06:02 PM | 显示全部楼层

回复 1# 1max1 的帖子

phpbb forum: http://www.phpbb.com/
discuz forum: www.discuz.net
不用浪费时间设计网页,你可以参考以下

还有这个更够力的
http://www.e107.org/news.php
回复

使用道具 举报

 楼主| 发表于 1-2-2009 10:29 PM | 显示全部楼层
Warning:  mail() [function.mail]:Failed to connect to mailserver at "localhost" port 25, verify your"SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\...\test.php on line 17

学习用网页寄电邮碰见个问题。
16 // send it
17 $mailSent = mail($to, $subject, $message);
18 }

Line 17 都没有问题。

请问是哪里弄不好?

[ 本帖最后由 1max1 于 2-2-2009 10:50 AM 编辑 ]
回复

使用道具 举报


ADVERTISEMENT

发表于 2-2-2009 12:26 PM | 显示全部楼层
原帖由 1max1 于 1-2-2009 10:29 PM 发表

学习用网页寄电邮碰见个问题。

Line 17 都没有问题。

请问是哪里弄不好?


如果有的选择,尝试用SMTP.
Mail的function不可使用,建议联络你的hosting provider 问什么回事? (他们可以在 php.ini 帮你调)
如果需要输入PORT的号码,那就查询你的hosting provider的 incoming 和outgoing 的port号码吧。

[ 本帖最后由 keroro小军曹 于 2-2-2009 12:27 PM 编辑 ]
回复

使用道具 举报

 楼主| 发表于 2-2-2009 12:37 PM | 显示全部楼层
原帖由 keroro小军曹 于 2-2-2009 12:26 PM 发表


如果有的选择,尝试用SMTP.
Mail的function不可使用,建议联络你的hosting provider 问什么回事? (他们可以在 php.ini 帮你调)
如果需要输入PORT的号码,那就查询你的hosting provider的 incoming 和outgoi ...

hosting provider嘛。。。不就是我自己吗?
我用local host的,没有用remote server。local host不能寄电邮吗?
回复

使用道具 举报

 楼主| 发表于 2-2-2009 05:37 PM | 显示全部楼层
谁知道 in_array() 与 array_key_exists() 有什么不一样?
回复

使用道具 举报

发表于 3-2-2009 11:47 AM | 显示全部楼层
原帖由 1max1 于 2-2-2009 12:37 PM 发表

hosting provider嘛。。。不就是我自己吗?
我用local host的,没有用remote server。local host不能寄电邮吗?


那你应该在你的apache的php.ini 里检查是否有将mail的function开动了。
回复

使用道具 举报

 楼主| 发表于 3-2-2009 10:14 PM | 显示全部楼层
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = theoneym@yahoo.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i".
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

请问有什么要修改?
回复

使用道具 举报

 楼主| 发表于 7-2-2009 06:37 PM | 显示全部楼层
有什么可支护php的Hosting Server介绍?最重要是免费的。
回复

使用道具 举报

发表于 7-2-2009 11:27 PM | 显示全部楼层
回复

使用道具 举报

 楼主| 发表于 8-2-2009 04:30 PM | 显示全部楼层
原帖由 $_$ 于 7-2-2009 11:27 PM 发表
http://www.000webhost.com/

当将要下载那个 ip_confirm.exe 时,antivirus 跳出来这样的东西:
File name:        http//goffhouseinn.com/ip_confirm.php
Malware name:    Win32:Trojan-gen{Other}
Malware type:    Virus/Wrom
VPS version:    090207-0,02/07,2009

请帮忙看下是有病毒还是防毒太强?
回复

使用道具 举报


ADVERTISEMENT

发表于 8-2-2009 07:47 PM | 显示全部楼层
不須要下載任何東西啊!
為什么要下載啊?
申請就可以啦!
回复

使用道具 举报

 楼主| 发表于 8-2-2009 09:15 PM | 显示全部楼层

回复 16# Darick_78560 的帖子

       
Confirm your computer IP address

Before your account can be activated, you need to confirm your computer IP address. It's easy - just download ip_confim.exe to your computer and run (execute) it. You will get 6 digit confirmation code which you will have to enter below.

    * 1. Download ip_confirm.exe to your computer and run it.
    * 2. You will get 6 digit confirmation code.
    * 3. Enter this 6 digit confirmation code here:

How ip_confirm.exe program works?

    * It is a very small program (size is only 27,9 Kb), that will generate access code needed for account activation.
    * We previously used email address confirmation system, but it was replaced to IP address confirmation system which is more reliable.
    * This program will send your computer IP address to our webserver and confirms your identify. Please allow access for this software to connect to members.000webhost.com if asked.

回复

使用道具 举报

发表于 8-2-2009 10:58 PM | 显示全部楼层
原帖由 1max1 于 8-2-2009 09:15 PM 发表


申請了六個不曾遇過這問題!
是你不是申請免費空間?
回复

使用道具 举报

 楼主| 发表于 8-2-2009 11:01 PM | 显示全部楼层
原帖由 Darick_78560 于 8-2-2009 10:58 PM 发表

申請了六個不曾遇過這問題!
是你不是申請免費空間?

免费的会中virus吗?
回复

使用道具 举报

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

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


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

GMT+8, 1-12-2025 10:37 PM , Processed in 0.135742 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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