Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php脚本和GET方法在mysql数据库中插入URL_Php_Mysql - Fatal编程技术网

使用php脚本和GET方法在mysql数据库中插入URL

使用php脚本和GET方法在mysql数据库中插入URL,php,mysql,Php,Mysql,这是脚本的结果: firebasestorage.googleapis.com/v0/b/carsstore-1c8c5.appspot.com/o/photos/image:60Sat Dec 24 10:39:10 EST 2016?alt=media 我总是得到缺少“&token=”方法后最后一部分的url,因为您将url作为另一个url中的get参数传递,所以您必须以某种方式对其进行转义,以便它与包含它的url区分开来 一个简单的解决方案是使用POST,其中数据不会作为URL的一部分发送

这是脚本的结果: firebasestorage.googleapis.com/v0/b/carsstore-1c8c5.appspot.com/o/photos/image:60Sat Dec 24 10:39:10 EST 2016?alt=media


我总是得到缺少“&token=”方法后最后一部分的url,因为您将url作为另一个url中的get参数传递,所以您必须以某种方式对其进行转义,以便它与包含它的url区分开来

一个简单的解决方案是使用POST,其中数据不会作为URL的一部分发送,因此不存在此问题

否则,您必须在一个URI中编码您的URI:

您可以使用

当对URL的查询部分中使用的字符串进行编码时,此函数非常方便,可以方便地将变量传递到下一页

例如:

您可以在标记、表单操作等中使用$my_url


然后annoce.php中的$_GET[urlFace]将提供您所需的完整url

请显示完整代码。该url中没有urlFace,但只有mysql,所以为什么要添加标签?这个问题太不清楚了。您可能留下了问题或没有回复评论。你已经得到了下面的答案,问问他们。我留下了这个问题。我编辑了它,它是否清晰?鉴于给出的代码/信息很少,这可能是最好的评论。你可能会有一段很长的路要走。更有可能的是,这个问题会被放弃。看起来OP还没有达到stackoverflow级别。OP似乎已经回来了,他们的编辑使得它更加不清楚。叹气
   $urlFace=$_GET['urlFace'];
   echo $urlFace;
$my_url = "http://192.168.1.7/cars_store/insert_annoce.php?
urlFace=".urlencode("firebasestorage.googleapis.com/v0/b/carsstore-
1c8c5.appspot.com/o/photos%2Fimage%3A60Sat+Dec+24+10%3A39%3A10+EST+2016?
alt=media&token=908e383e-1901-4c04-855d-d6c7280b40a1");