how to grab

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

2 replies · 458 views · started 15 years ago · 1 min read

2 participants
atef201080 Developer · 58 posts #1

hey all i want to grab a page with changing virubl i use that code but not working

$room = $_GET['room']; $page = file_get_contents('http://test/s.php?bd=$room');

i0nutzxp Developer · 150 posts #2

for that use cURL: eg:

<?php
  $room = $_GET['room'];
    $ch = curl_init('http://test/s.php?bd='.$room);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Googlebot/2.1 (http://www.googlebot.com/bot2.html)');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $text = curl_exec($ch);       
    curl_close($ch);
    echo $text;

?>
<?php unlink('World/Europe/Romania.country'); ?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close