我想从apache下载httpConnection类,但我找不到链接,还需要知道如何导入它以及在我拥有类文件的位置.
我使用php和mysql支持在我的localhost上运行apache服务器.唯一的问题是,那$_GET并且$_POST根本不起作用.
这是我的html文件:
<html>
<body>
<form action="message.php" method="GET">
Enter your message here: <input type="text" name="msg" size="30">
<input type="submit" value="Send">
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是我的message.php文件:
<?php
$input = $_GET('msg');
echo "$input";
?>
Run Code Online (Sandbox Code Playgroud)
如果我在我的html中的文本输入字段中键入"blablabla",它会将我重定向到[localhost] /message.php?msg=blablabla,这很好但是php给了我一个空页面.我检查了[localhost] /message.php?msg=blablabla的源代码,但它只有一个空部分和一个空部分.
我犯了什么错误或者这是一个错误吗?
我的网站用户个人资料页面是
http://website.com/profile?name=test
Run Code Online (Sandbox Code Playgroud)
我正在使用 get 方法来获取变量名称, 我试图使上面的 url 被清理,例如,
http://website.com/test
Run Code Online (Sandbox Code Playgroud)
我的 .htaccess 内容
RewriteEngine On
RewriteBase /creatorsink/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L]
RewriteRule ^([a-z]+)/?$ profile.php?name=$1 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
有没有办法通过选择获取名称来做到这一点?
我使用这个htaccess url mywebsite.com/xyz/search.html
这里xyz是root中的一个文件夹
在.htaccess中使用此URL的代码
# enable apache modRewrite module #
RewriteEngine On
RewriteBase /
RewriteRule ^([^//]+)/?(^/*)?.ht(m?ml?)$ index.php?page=$1 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
现在我希望这
xyz/search.html 是击中网址xyz/index.php?page=search
但是这个:
RewriteRule ^([^//]+)/?(^/*)?.ht(m?ml?)$ index.php?page=$1 [L,QSA])
Run Code Online (Sandbox Code Playgroud)
代码不起作用..对此有任何想法......
我想用PERL做一个简单的测试.我编写了input.html并将其放在hgi文件夹中,并将其放在cgi-bin中的output.cgi中.两者都在XAMPP文件夹中,使用mac.这也是使用apache.
HTML文件
<!doctype html>
<html lang="en">
<body>
<form action="/cgi-bin/output.cgi" method="post">
Enter Fahrenheit: <input type="text" name="fahrenheit" /><br />
Enter Distance in Miles: <input type="text" name="distance" /><br />
<input type="submit" value="Convert!" />
</form>
Run Code Online (Sandbox Code Playgroud)
这是用户按"转换"时应显示的CGI文件
#!/usr/bin/perl -w
use strict;
use warnings;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
print "Content-type: text/html\n\n";
#### read form data
my $fahrenheit = param('fahrenheit');
my $distance = param('distance');
#### do the math
my $celcius = ($fahrenheit * 18.8) + 32;
my $kilometers = $distance * 1.60934;
#### display results …Run Code Online (Sandbox Code Playgroud) 我需要执行以下操作:URL http://domain.com/view.php?show=my_article_name应该被重定向到http://domain.com/my_article_name/我该怎么做?提前致谢.
.htaccess我的服务器网站文件夹中没有文件,所以我.htaccess从我网站的其他网站粘贴文件并将规则写为
RewriteRule ^terms-of-use$ terms-of-use.php [L]
RewriteRule ^privacy-policy$ privacy-policy.php [L]
Run Code Online (Sandbox Code Playgroud)
但不起作用.
我有这个网址:
http:// localhost:8080/cgi-bin/gestionale/dashboard.pl?user = santaclaus
我的问题是如何转换它:
http:// localhost:8080/cgi-bin/gestionale/dashboard. pl?user = santaclaus
在
http:// localhost:8080/cgi-bin/gestionale/dashboard.pl
我可以在我的.htaccess文件中使用重写规则进行修改吗?如果答案是肯定的,请解释我该怎么做.
当我使用这个脚本时:
<?php
print strftime('%c');
?>
Run Code Online (Sandbox Code Playgroud)
我明白了
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/www/apache22/data/virtual/midterm/boballo.php on line 3
Sun Jul 6 20:41:17 2014
Run Code Online (Sandbox Code Playgroud)
我想要显示的是服务器的当前日期/时间并将其打印到PHP脚本.我以为服务器(freebsd)会设置时区.如何显示服务器的当前日期并使用php脚本打印?
出于商业目的而未在我们的应用程序中提及其许可证?
例如android第三方库?
我可以在我的应用程序中使用Android第三方库而不显示其作者姓名吗?
我想使用第三方库,但不希望任何人知道他们的名字!
我一直在重建我们的Chef主服务器以在T2实例中运行,这意味着将其移至VPC。旧的主机正在运行11.10.4,而我一直在修改的新主机正在运行11.16.4。我已经接近让它在VPC内构建适当的服务器,但是它挂了设置Apache的电话。
ohai [reload_users]操作重新加载[2014-11-25T08:13:58-06:00]错误:运行插件时遇到错误:#<Ohai :: Exceptions :: AttributeNotFound:无此类属性:'passwd'
具体来说,它似乎在配方中不喜欢此代码
if node[:etc][:passwd][:apache] == nil
ohai "reload_users" do
plugin "passwd"
action :reload
end
end
Run Code Online (Sandbox Code Playgroud)
在Ohai 6中,passwd插件(名为passwd.rb)设置了'current_user'属性,为了使用此数据,需要知道这一事实。
require_plugin(“ passwd”)在Ohai 7中,用户交互现在基于属性名称。仅指定要为其收集数据的属性的名称。Ohai 7找出需要哪些插件,然后收集数据。
在Ohai 7中,无需知道底层详细信息即可发现current_user
取决于'currentuser'
看起来接近......但如果我取代它失败plugin "passwd"与depends 'currentuser'它也会失败。
我想我正在使用Ohai 7(gem list显示ohai (7.4.0))。我不是一个红宝石家伙,所以那里有点模糊。这段代码到底应该做什么?这是自定义添加到旧Opscode食谱的仓库中的。我们的食谱主要由不再为我们公司工作并且也不知道答案的其他人撰写。如果我将其注释掉,它可以很好地工作并安装Apache,但是如果不理解它就删除一些代码,我将不予理miss。
apache ×11
.htaccess ×4
mod-rewrite ×4
php ×3
perl ×2
android ×1
cgi ×1
chef-infra ×1
chef-recipe ×1
connection ×1
freebsd ×1
get ×1
github ×1
http ×1
java ×1
licensing ×1
localhost ×1
ohai-gem ×1
permissions ×1
post ×1
ruby ×1
xampp ×1