时间:2021-07-01 10:21:17 帮助过:29人阅读
- <br><?php <br>header(“Content-Type:text/html;charset=utf-8″); <br>if (isset($_GET['number'])) { <br>$url = ‘http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/getMobileCodeInfo'; <br>$number = $_GET['number']; <br>$ch = curl_init(); <br>curl_setopt($ch, CURLOPT_URL, $url); <br>curl_setopt($ch, CURLOPT_POST, true); <br>curl_setopt($ch, CURLOPT_POSTFIELDS, “mobileCode={$number}&userId=”); <br>curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); <br>$data = curl_exec($ch); <br>curl_close($ch); <br>$data = simplexml_load_string($data); <br>if (strpos($data, ‘http://')) { <br>echo ‘手机号码格式错误!'; <br>} else { <br>echo $data; <br>} <br>} <br>?> <br><form action=”mobile.php” method=”get”> <br>手机号码: <input type=”text” name=”number” /> <input type=”submit” value=”提交” /> <br></form> <br>