English 中文(简体)
简单的购买力平价
原标题:simple PHP syntax issues
  • 时间:2012-01-11 16:09:30
  •  标签:
  • php

<>strong>SOLVED 感谢你的反馈! 非常感谢。

如果任何人都能够帮助解决简单的yn子问题,我会非常赞赏。 我仍然处在学习阶段,而且现在似乎无法说明这一点。 在以下法典中,我分配了一个阵列和一个定义,以便与它一起,但当我试图重复信息时,它却不发挥作用。

   $arr_features=array("PasswordProtect");

  $arr_FeaturesDescriptions = array("Password Protection: Password Protection will be enabled, requiring participants to enter a password in order to access the event. Your password is: "echo ($_POST[ PasswordProtect ]);"");

因此,基本上来说,“Your 密码是:”部分是徒劳的,任何想法为什么? 提前感谢。

最佳回答

由于你正在学习PHP:

echo() will output a string to the rendered HTML. If you want to append a string (generated or not) to another string s end, you need to concatenate them, using the concatenation operator, which is . in PHP (yes, a dot).

In your example, it becomes: $arr_FeaturesDescriptions = array("Password Protection: Password Protection will be enabled, requiring participants to enter a password in order to access the event. Your password is: " . $_POST[ PasswordProtect ]);

问题回答

$arr_FeaturesDescriptions = array("Password Protection: Password Protection will be enabled, requiring participants to enter a password in order to access the event. Your password is: " . $_POST[ PasswordProtect ]);

因为你试图在扼杀中插入一句话。 相反,正确的辛加税

  $arr_FeaturesDescriptions = array("Password Protection: Password Protection will be enabled, requiring participants to enter a password in order to access the event. Your password is: {$_POST[ PasswordProtect ]}");

为了在座标中产生一个变量,需要使用<代码>。

$arr_FeaturesDescriptions = array("Password Protection: Password Protection will be enabled, requiring participants to enter a password in order to access the event. Your password is: " . $_POST[ PasswordProtect ]); 

或 brackets 括号{}:

$arr_FeaturesDescriptions = array("Password Protection: Password Protection will be enabled, requiring participants to enter a password in order to access the event. Your password is: {$_POST[ PasswordProtect ]}");

您应当从_POST中过滤数据,然后在你的代码中使用。 由于你正在使用双重报价,你可以很容易地插入一种变式,因为购买力平价中的双报价将评价以下变量:

$passwordprotect = validate_input($_POST[ PasswordProtect ]);
$arr_features=array("PasswordProtect");
$arr_FeaturesDescriptions = array("Password Protection: ... Your password is: $passwordprotect");

但是,你真的应该说的是,不管怎么说,都不会出现一个简单的文字密码。

http://php.net/manual/en/English.operators.string.php"rel=“nofollow” 您可在引证栏内填写_$_POST[ PasswordProtect],或将直观布拉({})的价值与操作者联系起来。

此处与,其中详细介绍了你在PHP中处理扼杀问题的不同方式。

$arr_features=array("PasswordProtect");

$arr_FeaturesDescriptions = array("Password Protection: Password Protection will be enabled, requiring participants to enter a password in order to access the event. Your password is: ".$_POST[ PasswordProtect ]);

修正





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签