Results 1 to 6 of 6

Thread: Grabbing Variables from a specified url

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    65

    Grabbing Variables from a specified url

    I was wondering if it was possible too grab variables from a specified url stored in a mysql table named users and the field name being stat?

    stat containing the url of course?

    and then i want too grab data from that page :P

  2. #2
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Grabbing Variables from a specified url

    only way i no to grab data from a url is using the $_GET superglobal

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Grabbing Variables from a specified url

    Do you mean variables from a query string? Yes, it is possible, you can make an array in the same format asthe $_GET super global:
    PHP Code:
        function get_querystring_vars($url)
        {
            
    $ret_array = Array();
            
            
    $url parse_url($url);

            if (
    $url['query']) {
                
    $var_array explode('&'$url['query']); // you may need to replace & with & here

                
    foreach($var_array as $var_pair) {
                    if ((
    $pos strpos($var_pair'=')) !== false) {
                        
    $ret_array[substr($var_pair0$pos)] = substr($var_pair$pos 1);
                    }
                }
            }

            return 
    $ret_array;
        } 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: Grabbing Variables from a specified url

    never knew that

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Grabbing Variables from a specified url

    You can do anything with PHP
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6
    Hyperactive Member PlaGuE's Avatar
    Join Date
    Jun 2005
    Location
    in ur mind.
    Posts
    445

    Re: Grabbing Variables from a specified url

    can it make my bed and do my chores?
    Without balance, there could only be chaos.
    Without chaos, there could be no balance.
    I live with karma. Eat with destiny. Dream of life without shackles....
    Yet. If life had no consequences, life could not exist, nor could it flourish.


    If at first you dont succeed.You're screwed.

    C++/Java NOOB.

    I aint a professional at PHP, but if i can help i will.

Posting Permissions

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



Click Here to Expand Forum to Full Width