English 中文(简体)
我出乎意料的“战略”在哪里?
原标题:Where is my unexpected T_STRING?
  • 时间:2012-04-28 01:26:44
  •  标签:
  • php
  • eval

通常,人们会期望,意想不到的T_STRING意味着失踪的半殖民地。 然而,在这种情况下,半殖民地失踪吗?

        global $lay;
        $yal = eval("return  $lay ;");
        echo $yal . "
";

错误被推向Eval,即:

Parse error: syntax error, unexpected T_STRING in ... BOGARIP.php(140) : eval() d code on line 1

(千美元)

$reportDate	$heads[ Account ]	$id	$heads[ Time zone ]	$heads[ Campaign ]	$heads[ Ad group ]	$heads[ Network ]	$heads[ Network (with search partners) ]		$heads[ Ad group state ]	$heads[ Campaign state ]	$heads[ Impressions ]	$heads[ Clicks ]	$heads[ CTR ]	$heads[ Avg. CPC ]	$heads[ Avg. CPM ]	$heads[ Cost ]	$heads[ Avg. position ]

这是否意味着 b费实际上为美元,还是我没有其他东西? 这种扼杀性替代程度是否可行?

最佳回答

注 现有格式

%DATE%	%Account%	%ID%	%Time zone%	%Campaign%	%Ad group%	%Network%	%Network (with search partners)%		%Ad group state%	%Campaign state%	%Impressions%	%Clicks%	%CTR%	%Avg. CPC%	%Avg. CPM%	%Cost%	%Avg. position%

和法典

    $heads["ID"] = $id;
    $heads["DATE"] = $reportDate;

......

    global $lay;
    $layout = $lay;
    foreach ($heads as $key => $value) {
        $layout = str_replace("%" . $key . "%", $value, $layout);
    }
    $layout = str_replace("\n", "
", $layout);
    $layout = str_replace("\t", "	", $layout);
问题回答

通常说,你没有做任何事情。 但为了这里的技术问题,考虑如下:

eval("return  $lay ;");

页: 1 现在请看这一变量的内容:

$reportDate	$heads[ Account...

见问题? 你在价值中还使用了单一报价。 你们的长篇大论中引述的,不再有冲突:

eval( return "$lay"; );

同样,请不要使用该法典。 总的来说,专业人员将引导你们不要使用<代码>eval,因为这将你的申请传给大量潜在的伤口。 请找到另一种方式来做你重新尝试的一切。





相关问题
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 ...

热门标签