RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
php使用get提交数据的简单介绍

php html get提交数据的问题

首先要确定图片已经生成出来了。

创新互联公司-专业网站定制、快速模板网站建设、高性价比独山子网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式独山子网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖独山子地区。费用合理售后完善,十余年实体公司更值得信赖。

不知生成的图片是否保存成文件了,如果保存成了文件直接img src=""显示即可

如果没有生成图片文件,可以采取一种get模式的传值方式。需要三个文件。

第一个文件HTML文件此文件中放表单

第二个文件php的用于接收html文件传递的值。但是此文件不生成图片。在文件中放一个标签img src="three.php?a=1b=2c=3"

第三个文件即为three.php,此文件用get模式获取a=1b=2c=3等参数,根据参数生成图片并输出即可。

仅供参考,如果有其他问题请补充说明。

php中get提交方式怎么用

form action="include/add_add.php" method="post" enctype="multipart/form-data" /form

GET提交:method="get"

接取数据其中一个:$_GET['data']; 接取全部数据:$_GET[];

POST提交:method="post"

接取数据其中一个:$_POST['data']; 接取全部数据:$_POST[];

PHP怎么获取表单提交的数据啊?

一、用file_get_contents以get方式获取内容,需要输入内容为:

1、?php

2、$url='';

3、$html=file_get_contents($url);

4、echo$html;

5、?

二、用file_get_contents函数,以post方式获取url,需要输入内容为

1、?php

2、$url='';

3、$data=array('foo'='bar');

4、$data=http_build_query($data);

5、$opts=array(

6、'http'=array(

7、 'method'='POST',

8、 'header'="Content-type:application/x-www-form-urlencoded\r\n".

9、          "Content-Length:".strlen($data)."\r\n",

10、 'content'=$data

11、)

12、);

13、$ctx=stream_context_create($opts);

14、$html=@file_get_contents($url,'',$ctx);

15、?

三、用fopen打开url,以get方式获取内容,需要输入内容为

1、?php

2、$fp=fopen($url,'r');

3、$header=stream_get_meta_data($fp);//获取信息

4、while(!feof($fp)){

5、$result.=fgets($fp,1024);

6、}

7、echo"urlheader:{$header}br":

8、echo"urlbody:$result";

9、fclose($fp);

10、?

四、用fopen打开url,以post方式获取内容,需要输入内容为

1、?php

2、$data=array('foo2'='bar2','foo3'='bar3');

3、$data=http_build_query($data);

4、$opts=array(

5、'http'=array(

6、'method'='POST',

7、'header'="Content-type:application/x-www-form-urlencoded\r\nCookie:cook1=c3;cook2=c4\r\n".

8、"Content-Length:".strlen($data)."\r\n",

9、'content'=$data

10、)

11、);

12、$context=stream_context_create($opts);

13、$html=fopen(';id2=i4','rb',false,$context);

14、$w=fread($html,1024);

15、echo$w;

16、?

五、用fsockopen函数打开url,以get方式获取完整的数据,包括header和body,需要输入内容为

1、?php

2、functionget_url($url,$cookie=false)

3、{

4、$url=parse_url($url);

5、$query=$url[path]."?".$url[query];

6、echo"Query:".$query;

7、$fp=fsockopen($url[host],$url[port]?$url[port]:80,$errno,$errstr,30);

8、if(!$fp){

9、returnfalse;

10、}else{

11、$request="GET$queryHTTP/1.1\r\n";

12、$request.="Host:$url[host]\r\n";

13、$request.="Connection:Close\r\n";

14、if($cookie)$request.="Cookie:  $cookie\n";

15、$request.="\r\n";

16、fwrite($fp,$request);

17、while(!@feof($fp)){

18、$result.=@fgets($fp,1024);

19、}

20、fclose($fp);

21、return$result;

22、}

23、}

24、//获取url的html部分,去掉header

25、functionGetUrlHTML($url,$cookie=false)

26、{

27、$rowdata=get_url($url,$cookie);

28、if($rowdata)

29、{

30、$body=stristr($rowdata,"\r\n\r\n");

31、$body=substr($body,4,strlen($body));

32、return$body;

33、}

34、 returnfalse;

35、}

36、?

参考资料:

php-file_get_contents


新闻名称:php使用get提交数据的简单介绍
网站路径:http://cqwzjz.cn/article/ddjjded.html