草庐IT

Example_c

全部标签

php - 为什么 www.example.com/index.php/my/path/here 是由 index.php 处理的?

我只是好奇,apache的功能是如何调用的,它是这样引导请求的www.example.com/index.php/my/path/here到一个文件index.php?一开始,您可能会想,如果此请求导致404错误页面,那将是正确的,因为在站点根目录中没有名为index.php的文件夹。顺便说一句,是否有可能关闭此Apache功能(如果它是一个功能)以便此类请求真正以404结束? 最佳答案 这不是URL重写功能。或者至少它不需要是。参见AcceptPathInfoDirective:Thisdirectivecontrolswheth

php - '在插件管理器 Zend\Router\RoutePluginManager 中找不到名为 "Example\Segment"的插件

我目前正在学习Zend3教程。唯一的区别是我使用的是示例表/类而不是相册。一切似乎都符合规范,除了我每次尝试访问开发服务器时都会收到以下错误:Fatalerror:Uncaughtexception'Zend\ServiceManager\Exception\ServiceNotFoundException'withmessage'Apluginbythename"Example\Segment"wasnotfoundinthepluginmanagerZend\Router\RoutePluginManager'inC:\Websites\ZEND2\vendor\zendframe

php - parse_url() 在传递 example.com 时返回错误

根据以下代码,如果$host_name类似于example.comPHP返回通知:Message:Undefinedindex:host但在完整的URL,如http://example.comPHP返回example.com。我尝试了带有FALSE和NULL的if语句,但没有成功。$host_name=$this->input->post('host_name');$parse=parse_url($host_name);$parse_url=$parse['host'];如何修改脚本以接受example.com并返回它? 最佳答案

php - "example@something.com"-> "example"PHP

我对正则表达式还很陌生,无法真正弄清楚它是如何工作的。我试过这个:functionchange_email($email){returnpreg_match('/^[\w]$/',$email);}但这只返回bool值true或false,我希望它返回@之前的所有内容。这可能吗?我什至不认为我在这里使用了正确的php函数.. 最佳答案 使用explode尝试更简单的方法:explode('@',$email)[0]; 关于php-"example@something.com"->"exa

PHP SDK - 如何让 example.php 工作?

我在我的服务器上从Github(https://github.com/facebook/facebook-php-sdk)下载了PHPSDK,但无法让example.php工作:当我在Safari中打开example.php时,我得到-你没有连接我点击登录链接我输入用户并传递给Facebook浏览器重定向回我的example.php-有“state”和URL中的“代码”参数example.php仍然显示“你没有连接”(这是我的问题的本质)如果我添加:print$facebook->getAccessToken();-它会打印一个Accesstoken(!!!)所以我的问题是-examp

php - 元素 'foo' : This element is not expected. 预期为 ( {http ://www. example.com}foo )

当尝试使用schemaValidate方法根据模式验证PHPDOMDocument对象时,将生成下一个警告:Warning:DOMDocument::schemaValidate():Element'foo':Thiselementisnotexpected.Expectedis({http://www.example.com}foo).inXonlineY它只发生在附加到DOMDocument的元素上。我准备了下一个代码片段和架构,以便任何人都可以立即进行测试:片段:$template='';$DD=newDOMDocument();$DD->loadXML($template);$

javascript - example.com 中的 setcookie(),在 www.example.com 中找不到 cookie

我加载了http://example.com包含:然后在浏览器的Javascript控制台中写入document.cookie显示cookie。有用。然后我关闭并重新打开浏览器并转到http://www.example.com.然后在Javascript控制台中编写document.cookie不会显示任何cookie。如何修改此PHP代码以在http://example.com之间共享cookie和http://www.example.com? 最佳答案 请像这样更正代码-这个斜杠(/)可能同时触发WWW和非WWW以及站点的每个页

php - api.example.com 比 example.com/api 好吗?

似乎大多数流行的RESTfulAPI更喜欢子域而不是子目录:api.twitter.comapi.linkedin.comapi.foursquare.comgraph.facebook.com我想知道这背后是否有任何技术论据。 最佳答案 这是一个负载均衡的东西。twitter.comhasaddress199.59.150.39twitter.comhasaddress199.59.149.230twitter.comhasaddress199.59.150.7api.twitter.comhasaddress199.59.150

php - 错误 : No route found for "GET/app/example"

我刚刚使用SymfonyInstaller在我的Windows10笔记本电脑上创建了一个Symfony应用程序.然后,我开始了:phpapp/consoleserver:run然后,我打开了http://localhost:8000/app/example如文档中所述,但我收到以下错误消息:ERROR-UncaughtPHPExceptionSymfony\Component\HttpKernel\Exception\NotFoundHttpException:"Noroutefoundfor"GET/app/example""atC:\Users\JVerstry\morepath\

php - 将 www.domain.com/example.com 重定向到 example.com

很多年前我读到有一个简单的php脚本可以将您的网站重定向到http://example.com/google.com到google.com它适用于正斜杠右侧的任何域。我忘记了这个脚本是什么或在哪里可以找到它 最佳答案 如果您在文档根目录中创建一个htaccess文件,并添加:RewriteEngineOnRewriteRule^/?([a-z0-9-.]+)$http://$1/[L,R] 关于php-将www.domain.com/example.com重定向到example.com,