Results 1 to 5 of 5

Thread: Very Difficult Ajax and Php extraction

  1. #1

    Very Difficult Ajax and Php extraction

    Hi!

    I have a problem:

    in these pages when you make a click on a row, it displays a div with info i need to get, i need a php script to allow me to go all across the table and get the info in the divs. i think it may be very hard!

    http://bccathletics.cstv.com/sports/...ched-2006.html

    http://aamusports.cstv.com/sports/m-...ched-2006.html

  2. #2
    not really

    just analyze the source for client-side (I guess it's a <hr onClick><hr>)

    give the row an ID and fetch the corresponding row in your database, load it into a div and voila

    what's bugging you ?

  3. #3
    icio's Avatar
    3,810
    posts
    looks better in lowercase
    This will return all of the XML files containing the information used to populate each div:

    Edit: MLK, I think here was asking for a script to get the information from the page, not recreate the effect. Which is it, dinchu37?

    PHP Code:
    <?

        $url 
    'http://bccathletics.cstv.com/sports/m-basebl/archive/beth-m-basebl-sched-2006.html';
        
        
    // This script might take a while to run...
        
    set_time_limit(0);
        
        
    // Setup and execute the curl session
        
    $curl curl_init($url);
        
    curl_setopt($curlCURLOPT_RETURNTRANSFERTRUE);
        
    $source curl_exec($curl);
        
    curl_close($curl);
        
        if (
    $source === false) {
            
    // Weren't able to retrieve the page
            
    die("An error occured");
        }
        
        
    header('content-type: text/plain');
        
        
    // Now we need to get the information from the table rows
        
    preg_match_all('/<tr id="(\\d+)" title="(.*?)"/'$source$matchesPREG_SET_ORDER);
        foreach (
    $matches as $match) {
            
    print_r($match);
            
            
    $xml_file "http://bccathletics.cstv.com/data/xml/events/m-basebl/2006/{$match[1]}.xml";
            
            
    $curl curl_init($xml_file);
            
    curl_setopt($curlCURLOPT_RETURNTRANSFERTRUE);
            
    $source curl_exec($curl);
            
    curl_close($curl);
            
            echo 
    $source;
            echo 
    "\n-----------------------------------------------------\n";
        }
    "60% of the time it works... every time." -- Paul Rudd as Brian Fantana.

  4. #4
    icio: you solved me more troubles than what i was asking for!

    I just wanted a code to make appear all the data included in the div, but now the entire problem is solved. thank you very much!

  5. #5
    icio's Avatar
    3,810
    posts
    looks better in lowercase
    Awesome. Glad I could help
    "60% of the time it works... every time." -- Paul Rudd as Brian Fantana.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012