English 中文(简体)
• 如何从营地传播图像
原标题:how to send a image path from php

我必须撰写一份“加拿大”申请(删除我们称之为“形象”的网址),以支持一台电话/ipad。

图像。 php需要回到图像榜样:www.xyz.com/whatever/image.jpeg

In imagepath.php I am successfully able to get correct image path from Here is an example: http://cdn.svcs.x.y.com/c2/37a86590e709012e2fb300163e41dd5b

如果我把这条道路送给一把电话/单板,那不会奏效,但如果我送上适当的图像途径,例如www.xyz.com/whatever/image.jpeg,它会做罚款。

How do I fix it?

我目前的法典

<?php
..
..
..
// With some code above I am able to get image path in remote_img 
$remote_img = $results[1][0];
//send image out
header( Content-Type: image/jpeg );
echo(file_get_contents($remote_img));
?>

Here is a sample image path that comes to $remote_img http://cdn.svcs.c2.uclick.com/c2/37a86590e709012e2fb300163e41dd5b

问题回答

Your code should work as is, as long as $remote_img is correct when you do the file_get_contents()





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

热门标签