English 中文(简体)
能够变数的尿液如何成为变数的价值?
原标题:How an url with get variables can be a value of a get variable?

I want to use an API of a web-site. It works in a simple way. I specify URL and get the information that I need. In the URL, that I specify, I give URL of a web site about which I want to know the information. For example:

www.websiteapi.org?url=http://www.google.com&format=extended

I do not understand how API should work in cases where the URL (that I want to use as an argument) contains several get variables separated by &. In other words, how the API will know that sequence of symbols coming after & is part of the input URL and not an indication of a new variable that should be passed to the API?

如何对待这种情况?

ADDED

下面是亚特兰大如何发挥作用的一个例子:

http://www.reddit.com/api/info.json?url=http://neatorama.cachefly.net/images/2007-08/iq-ocs.jpg&count=1

最佳回答

rel=“nofollow”>urlencode(

甚至更好,

$data = array( url  =>  http://neatorama.cachefly.net/images/2007-08/iq-range-occupations.jpg&count=1 );
// or (depends on what url the count variable belongs to):
$data = array(
  url    =>  http://neatorama.cachefly.net/images/2007-08/iq-range-occupations.jpg ,
  count  => 1,
);
$url = "http://www.reddit.com/api/info.json?".http_build_query($data);
问题回答

http://en.wikipedia.org/wiki/URL-Encoding”rel=“nofollow” 也就是说,将特殊性质改为%<>/code>及其ASCII轴值。

您和您再次确认了这一点。 具体来说,将<代码>和p>的所有发生地点改为%26/code>。

在服务器上,应用在字面<代码>&后>转换<代码>%26后回&。 这就是你通过“吉大港”申请获得<代码>和>;签署(和其他特殊性质,如<代码>#)。

Count and URL are two parameters.

我将取代任何<代码>&。 http://php.net/manual/en/Function.urlencode.php





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

热门标签