Signature generator and IPB profile page

Discussion in 'PHP' started by timelf123, Apr 9, 2007.

  1. #1
    Trying to get a more dynamic signature generator built for a forum based off of IPB, here is some of the code:

    Code:
    
    <?php
    function GetUserInfo($ProfileURL){
            $pagecontent = file_get_contents($ProfileURL);
            $start = strpos($pagecontent, "class='pp-name'")+17;
            $end = strpos($pagecontent, "</font> | <a",$start);
            $pagecontent = substr($pagecontent, $start, $end-$start);
            $start = strpos($pagecontent, "<h3")+27;
            $pagecontent = substr($pagecontent, $start, strlen($pagecontent));
            $pagecontent = str_replace("<font color=\"green\">TR: ","",$pagecontent);
            $pagecontent = str_replace(" (","|",$pagecontent);
            $iArray = explode("|",$pagecontent);
            return $iArray;
        }
      			$pronumber = $_POST["pronumber"];
    
    				//$userinfo = GetUserInfo("http://www.anything4free.com/forums/index.php?showuser=16501");
    
            $userinfo = GetUserInfo("http://www.anything4free.com/forums/index.php?showuser='$pronumber'");
            echo $userinfo[0] . "<br>";
            echo $userinfo[1];
            
    ?>
    PHP:

    new to php, the
    //$userinfo = GetUserInfo("http://www.anything4free.com/forums/index.php?showuser=16501");
    PHP:
    line works,

    but

    $userinfo = GetUserInfo("http://www.anything4free.com/forums/index.php?showuser='$pronumber'");
    PHP:
    returns plaintext html garbage, instead of stripping the page down and returning
    
    timelf123
    6
    
    Code (markup):
    What is wrong with my syntax?

    Tim
     
    timelf123, Apr 9, 2007 IP