English 中文(简体)
CURL and magic_quots
原标题:CURL and magic_quotes
  • 时间:2011-04-07 00:59:06
  •  标签:
  • php
  • curl

我对LURL和魔法有问题。

for different reasons i cannot turn magic_quotes off. But i do need to disable this feature when I create a CURL POST request.

在这项《欧洲禁止杀伤人员地雷行动计划》中,我通过一个包含XML和xml开标的变量,例如:

$xml_request =   <?xml version="1.0"?><SaleRequest> <CustomerData> <Email>alex@virtuman.com</Email> <CustomerData> <SaleRequest> ;

在我提出治疗员额请求后:

$url="https://my.secureserver.com/parsexmlscript.cgi";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "xml=".$xml_request);
curl_setopt ($ch, CURLOPT_HEADER, 0);
$result = curl_exec ($ch);
curl_close ($ch);

因此:在安全服务器上收到的申请——首批开端正像:

<?xml version="1.0"?>

(with version attribute is with magic quotes) after this xml parser dies telling me that XML document is not well formed.

是否有任何办法,只能用一种文字,提出这一职位要求?

或者是否有其他办法绕过它?

help!

问题回答

为什么不使用<条码>基准64_encode(xmldata )和tl<条码>64_decode($_newdata )?

这样,网站就没有编码的奇怪特征。

另一种方式是用“<代码>str_replace(”、“~~~>outstring)”、和即将替换的文字取代所有报价。

可能采取的步骤:

  • try stripslashes($xml_request) in your actual code
  • in 2003 set_magic_quotes_runtime(0) might have helped
  • .htaccess php_flag magic_quotes off maybe wrapped in a <Files specific.php>

这些信息大多载于PHP手册中,涉及magic_quotes

Comments will not be answered.

为此:

$xml_request = str_replace("\", "", $result);




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

热门标签