【发布时间】:2017-06-14 09:27:30
【问题描述】:
下面是我的php代码:
<?php
session_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://192.168.1.220/cgi-bin/handle_login.tcl");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"user=admin&pw=admin&submit=Login&sid=' '");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
$response=curl_exec($ch);
echo "<script type='text/javascript'>alert('$response');</script>"."<br/>";
echo strpos("$response","sid")."<br/>";
echo strstr($response, 'sid')."<br/>";
echo substr($response,90,19)."<br/>";
//$_SESSION['value'] = $response;
curl_close ($ch);
?>
当用户点击谷歌地图标记时,我需要执行上述代码并将其内容打印为输出。
上面的代码可以执行吗?
【问题讨论】:
-
是的,找到标记的点击事件。并进行 ajax 调用并将这些代码放入该 ajax 调用中。
-
@Bhavin..非常感谢..完全忘记了ajax..
-
尝试获取标记的点击事件,然后对将执行此 curl 代码的 php 页面进行 ajax 调用
标签: javascript php google-maps google-maps-api-3