FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Re: URL-String-concatenation within Curl-Multi: a Loop-array: [can i do like so]
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Re: URL-String-concatenation within Curl-Multi: a Loop-array: [can i do like so] [message #170824] Tue, 30 November 2010 18:04
matze is currently offline  matze
Messages: 5
Registered: November 2010
Karma: 0
Junior Member
Hi - good evening!



Thx for the answer and all the help so far Oncemore the "Fetching-
part" for a little parser-script:

Here we go - new target urls:

see the overview: http://dms-schule.bildung.hessen.de/index.html
http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html
Search by pressing the button "type" and then choose all schools with
the mouse!
Results 2400 schools: Here i can provide some "more help for getting
the target!" -


btw: see some details for this target-server:
http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school= 9009
http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school= 9742
http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school= 9871


well - you see i have to iterate over the sites - with a function /(a
loop)
http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school= 1000
to 10000

BTW - after fetching the page i have to see which one are empty -
those ones do not need to be
parsed! Well - i want to do this with curl-multi since this is the
most advanced way to do this:

I see i have an array that can be filled I have to try it out...!!

Well, I'm not pretty sure - but judging by the low level of PHP i
have:
I think that i may need a double array to define the URLs like:


Can i do like so?:
<?php
$urls 
= array(
   
"siteone" =>  "suche_schul_db.html?show_school=%i",
   
"sitetwo" =>  "suche_schul_db.html?show_school=%i",
   
"sitethree" =>"suche_schul_db.html?show_school=%i"
);


$params = array ( for ($i 1$i <= 10000$i++) {
  
// body of loop
}

// well i have to  define the variables in a open form like  abvove
nand not below:
// better  than doing it like so:   "siteone" => array(9009, 9742,
9871),

);

then pass them to curl-multi as:

foreach (
$urls as $id => $url) {
    foreach (
$params[$id] as => $param) {
        
$i $id $param;
        
$finalurl sprintf($url$param);
        
$conn[$i] = curl_init($finalurl);
?>


I don't know if that's fits the needs tip that i am looking for but I
hope so ;-)

Can i do like so [see above]? What do yu think.


i send you many greetings

martin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Zendmail attachments
Next Topic: Configuring PHP with Apache 2 under Windows Vista
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 18:04:44 GMT 2024

Total time taken to generate the page: 0.02517 seconds