Jump to content

Recommended Posts

Hello,
I work on this code but I block ...
 
I should recover the url:
 
 
and display these links (youwatch etc ...)
 
Or is the counsel in my code?
 
<?php
  require_once "support/http.php";
  require_once "support/web_browser.php";
  require_once "support/simple_html_dom.php";

  $html = new simple_html_dom();


$titleok = "les-huit-salopards"
$urlok = 'http://full-stream.org/{id}-{titleok}.html'; for($i=1; $i<=$nbArticle; $i++; $titleok) {
$urlAScroller = str_replace('{id}', $i, $urlok);
  }
   
$html = file_get_html($urlAScroller);
$links = array();
foreach($html->find('a[href^="http://youwatch.org"]') as $a) {
 $links[1] = $a->href;
}
foreach($html->find('a[href^="http://exashare.com"]') as $a) {
 $links[2] = $a->href;
}
foreach($html->find('a[href^="https://openload.co"]') as $a) {
 $links[3] = $a->href;
}
echo "</BR></BR>{$links['1']}</BR>";
echo "{$links['2']}</BR>";
echo "{$links['3']}";




?>

 

Link to comment
https://forums.phpfreaks.com/topic/300373-help-for-my-code/
Share on other sites

alright, I'm guessing ther is a language barrier here, but this line:

 

$urlok = 'http://full-stream.org/{id}-{titleok}.html'; for($i=1; $i<=$nbArticle; $i++; $titleok) {

is wrong.

 

What is id?

{titleok} should be {$titleok} 

and a for loop only takes in 3 parameters so $titleok should not be there

 

Other than that, I'm not sure what your question is or why you posted in the regex section.

Link to comment
https://forums.phpfreaks.com/topic/300373-help-for-my-code/#findComment-1529758
Share on other sites

Also note that you are missing a semi-colon here:

$titleok = "les-huit-salopards"

...but this line:

$urlok = 'http://full-stream.org/{id}-{titleok}.html'; for($i=1; $i<=$nbArticle; $i++; $titleok) {

is wrong.

 

What is id?

{titleok} should be {$titleok} 

 

"{id}" and "{titleok}" seem to be a placeholder. Inside the foreach loop, "{id}" is supposed to be replaced with the value of $i. But snoVop doesn't seem to do anything with "{titleok}".

 

With that said, I'm having a difficult time understanding the question also...  :confused: It might help to know where $nbArticle comes from. Also, you are overwriting $urlAScroller in the following for loop:

for($i=1; $i<=$nbArticle; $i++) {
    $urlAScroller = str_replace('{id}', $i, $urlok);
}
 
The rest of your code will only be working with the last value that $urlAScroller is set to.
Edited by cyberRobot
Link to comment
https://forums.phpfreaks.com/topic/300373-help-for-my-code/#findComment-1529765
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.