Jump to content

prospect

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Posts posted by prospect

  1. hey guys cheers for all the input

     

    Seems like I don't have cURL installed so I tried MB's idea using fopen

     

     

    <?
    
    $ip = addslashes($_SERVER['REMOTE_ADDR']);
    $data = fopen("http://www.showmyip.com/?ip=$ip", "r");
    print' $data';
    ?>

     

    that returns only $data seems nothing is caputered

    but when i try

    http://www.showmyip.com/?ip=xxx.xxx.xxx.xxx

    it returns all the details so the format is right

     

    again thanks

  2. okai keep getting this error

     

    <?php
    
    
    $ip = addslashes($_SERVER['REMOTE_ADDR']);
    
    // initialise the session, this time with no URL
        $ch = curl_init();
        
        // Setting the URL including the IP
        curl_setopt($ch, CURLOPT_URL, "http://www.showmyip.com/?ip=$ip");
        
        // Return the output from the cURL session rather than displaying in the browser.
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        
        //Executting  the session, returning the results to $country, and close.
        $html = curl_exec($ch);
        curl_close($ch);
        print "$html";
    
    ?>

     

     

    Fatal error: Call to undefined function: curl_init() in /home/www/digitall/func_test.php on line 7

  3. Okai gotcha

     

    <?php
    
    
    $ip = addslashes($_SERVER['REMOTE_ADDR']);
    
    // initialise the session, this time with no URL
        $ch = curl_init();
        
        // Setting the URL including the IP
        curl_setopt($ch, CURLOPT_URL, "http://www.showmyip.com/?ip=$ip");
        
        // Return the output from the cURL session rather than displaying in the browser.
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        
        //Executting  the session, returning the results to $country, and close.
        $Country = curl_exec($ch);
        curl_close($ch);
        print "country of $ip: $Country";
    
    ?>
    

     

    doesn't return anything :(

  4. Thanks guys , but don't think I explained myself good

     

    I did try the IP range but thats too much and don't have that of a big database so I jsut wanted to use showmyip.com as webservice to check the ip I send and recive back the country name

     

    $ip=$_SERVER['REMOTE_ADDR'];

    $url='http://www.showmyip.com/?ip=';

     

    Its just how to actully send it automaticlly when the user logs in the page and then direct him upon finding his country

     

  5. umh okai I am a student so take it easy on me, I though the page will be generated on the fly, do i have to create a indivdual page for each and every result? cause that will just defy the purpose of the database..
    ps; thanks ALOT for the help :)
  6. nah it doesn't give me any error but when i click on the titles it doesn't take me to the relvant topic its just reloads the page and change the url to www.domain.com/blah.php?id=2 or 3 or 1 depending on what i clicked on so it is working but it displays the same page with all the headers again doesn't display the topic
  7. Hey guys , I am working on a news script, i did my table and i extract the news and display them and i even made the pagination and everything but i am trying to make a topic list using $title as variable, so far i been able to display all the titles but i want to be able to click on them and that takes me to the relevant specific topic please help...

    this is what I tried so far



    <?

    include "*****.php";

    $headers = mysql_query("select id, title from news ");
    while( $row = mysql_fetch_array($headers) )
    {
      echo "    <div><p style=\"padding:0;margin:3px 0;\">
            <b><a href=?id=$row[id]> ". $row[title] ."</a></b><br /></p>
        </div>\n";
    }

    ?>
×
×
  • 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.