hello there, im tryng to get_data of pornhub.com videos page video url: http://www.pornhub.com/view_video.php?viewkey=2090183744 i try this code but is not working <?php $url = 'http://www.pornhub.com/view_video.php?viewkey=2090183744'; $url_page = get_data($url); echo $url_page; ?> can someone help me how i can make this script to work ? thanks
Whats inside the function get_data? It is not a predefined function! It seems that you have to use cURL to make what you want!
Try with file_get_contents : <?php $data = file_get_contents('http://www.pornhub.com/view_video.php?viewkey=2090183744'); echo $data ; ?>
Use curl my friend <?php $url = 'http://www.pornhub.com/view_video.php?viewkey=2090183744'; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, 'Firefox (WindowsXP) - Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6'); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_TIMEOUT, 30); $html= curl_exec($ch); if (!$html) { echo "<p>cURL error:" . curl_error($ch) . " (Number " . curl_errno($ch).")</p>"; } curl_close($ch); ?> PHP:
work thank you ! one more question, i try to add this command but is not working <?php $url = 'http://www.pornhub.com/view_video.php?viewkey=676a0528f8dd15588f85'; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, 'Firefox (WindowsXP) - Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6'); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_TIMEOUT, 30); $html= curl_exec($ch); if (!$html) { echo "<br />cURL error number:" .curl_errno($ch); echo "<br />cURL error:" . curl_error($ch); exit; } $live_sex_m = get_match('/<li>(.*)Live Sex<\/a><\/li>/',$html); $html = str_replace('<li>' . $live_sex_m . 'Live Sex</a></li>', '', $html); echo $html; ?> PHP: can someone tell me what is the problem, thanks
whats this get_match()?? try replacing: $live_sex_m = get_match('/<li>(.*)Live Sex<\/a><\/li>/',$html); $html = str_replace('<li>' . $live_sex_m . 'Live Sex</a></li>', '', $html); PHP: with: preg_match('/<li>(.*)Live Sex<\/a><\/li>/', $html, $live_sex_m); $html = str_replace('<li>' . $live_sex_m[1] . 'Live Sex</a></li>', '', $html); PHP: Also read up on user defined functions and their usage: http://php.net/manual/en/functions.user-defined.php
need help again, i make this code for the script but is show me error page "The document has moved here." command $ph_page = $_REQUEST['page']; $uri = $_SERVER['REQUEST_URI']; $uri = str_replace('pornhub/?page=videos&', 'video?', $uri); if ($ph_page != "") { if ($ph_page == "videos") { $url = 'http://www.pornhub.com' . $uri; } } else { $url = 'http://www.pornhub.com/'; } PHP: can someone help me with this ? thanks !
hello there, so is anyway to i can fix this ? look the page what is show me http://www.onjizz.com/pornhub/?page=videos&o=mr&c=&p=
Why is everybody set on Pornhub?? Ok, it's one of the most well known Adult Tube sites out there but isn't something like www.whoreslag.com better? I mean they got better content and all. I don't know but it seems that pornhub became a sell out!
$url = 'http://www.pornhub.com/view_video.php?viewkey=2090183744';$page_html = file_get_contents ($furl);$echo $page_html; Code (markup):