简体   繁体   English

如何在网页中嵌入php图

[英]How to embed a php graph in a web-page

I am using this script which is one of the examples provided by the graph itself. 我正在使用此脚本,这是图形本身提供的示例之一。 When I put this on a web-page by itself, it's drawing the graph. 当我将其单独放在网页上时,它正在绘制图形。 But when I embed the code in an already existing web-page (with some content), it doesn't draw a graph. 但是,当我将代码嵌入到已有的网页(包含某些内容)中时,它不会绘制图形。

I did the experiment using img src and its working fine. 我使用img src进行了实验,并且工作正常。 But I just wanted to submit some parameter along with that graph in same web page. 但是我只想在同一网页中提交一些参数以及该图形。 How do I do that one without using "img src"? 不使用“ img src”怎么办?

Thanks in advance 提前致谢

您可以通过生成新的CSS或使用javascript来做到这一点。

but i just want to copy the total graph code in my exist php script 但我只想在我现有的php脚本中复制总图形代码

Better don't. 最好不要。 It's best to just use an <img> element to embed the graph. 最好只使用<img>元素嵌入图形。 Use GET parameters to pass values: 使用GET参数传递值:

<img src="script.php?param1=123456&param2=124050">

Creating inline images is theoretically possible using data: URIs , but it's not fully supported by Internet Explorer yet. 理论上,可以使用data: URI创建内联图像,但Internet Explorer尚未完全支持它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM