Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="" method="get">
- <table align="CENTER" width="300">
- <tbody><tr class="alt">
- <td align="center">
- <p>Αναζήτηση συλλόγων, παικτών (* νέο)</p>
- </td>
- </tr>
- <tr class="">
- <td align="center">
- <p"><input type="text" name="q" maxlength="20" size="20"><br>
- <input type="submit" value="OK"></p"></td></tr>
- </tbody></table>
- <h1>result :
- <?php
- $player_id=$_REQUEST["q"];
- $url="https://chesstu.be/eso/player/".$player_id;
- echo $url;
- echo "<hR>";
- //$homepage = file_get_contents($url);
- /*
- $homepage = file($url);
- // turn array into one variable
- $homepage=implode('',$homepage);
- */
- //$url='https://oscarliang.com';
- $ch=curl_init();
- $timeout=5;
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
- // Get URL content
- $lines_string=curl_exec($ch);
- // close handle to release resources
- curl_close($ch);
- //output, you can also save it locally on the server
- #<tag>(.*?)</tag>#g
- $pattern = "/<th>Παρτίδες<\/th>
- <\/tr>
- <tr>
- <td>(.*?) <td>
- <a href=/s";
- $pattern = "/th>(.*?)<a href=/s";
- //preg_match($pattern, $lines_string, $matches);
- preg_match_all($pattern, $lines_string, $matches);
- //echo $lines_string;
- echo "<hr>matches : ";
- print_r ( $matches);
- #echo $homepage;
- ?>
- </h1>
- </form>
- <form action="https://chesstu.be/eso" method="get">
- <table align="CENTER" width="300">
- <tbody><tr class="alt">
- <td align="center">
- <p>Αναζήτηση συλλόγων, παικτών (* νέο)</p>
- </td>
- </tr>
- <tr class="">
- <td align="center">
- <p"><input type="text" name="q" maxlength="20" size="20"><br>
- <input type="submit" value="OK"></p"></td></tr>
- </tbody></table>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement