Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $typeDoiBong = array('0' =>'2399',
- '1' =>'2461',
- '2' =>'2649',
- '3' =>'2462',
- '4' =>'2463',
- '5' =>'2204',
- '6' =>'2464',
- '7' =>'2465',
- '8' =>'2466',
- '9' =>'2467'
- );
- $name=$_GET['name'];
- $number=$_GET['number'];
- echo '{
- "messages":[';
- //echo "<br>";
- foreach ($typeDoiBong as $key => $value) {
- # code...
- //echo "$value";
- $kq=getUrlAo($name,$number,$value);
- if($key==9){
- echo '{
- "attachment":{
- "type":"image",
- "payload":{
- "url":"'.$kq.'"
- }
- }
- }';
- }else{
- echo '{
- "attachment":{
- "type":"image",
- "payload":{
- "url":"'.$kq.'"
- }
- }
- },';
- }
- //echo "<br>";
- }
- echo "]
- }";
- function getUrlAo($name,$number,$type)
- {
- $url="http://footballshirtmaker.com/en/create-fc-barcelona-soccer-jersey-with-your-name-and-number-".$type.".html";
- //post
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36');
- curl_setopt($ch,CURLOPT_ENCODING , '');
- curl_setopt($ch,CURLOPT_TIMEOUT , 15);
- curl_setopt($ch,CURLOPT_CONNECTTIMEOUT , 15);
- curl_setopt($ch,CURLOPT_HEADER ,array('Content-Type: application/x-www-form-urlencoded'));
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS,
- "numero=".$number."&nombre=".$name."&Cambiar_Numero=Cambiar: undefined");
- $data = curl_exec ($ch);
- $err=curl_error($ch);
- if($err){
- echo "loi get data";
- return 0;
- }else{
- //echo $data;
- preg_match('/temporales(.*?)"/', $data,$match);
- //print_r($match);
- $kq='http://footballshirtmaker.com/temporales'.$match[1];
- return "$kq";
- }
- curl_close ($ch);
- }
- ?>
Add Comment
Please, Sign In to add comment