Jump to content

Signature generator error


timelf123

Recommended Posts

Trying to get a more dynamic signature generator built for a forum based off of IPB, here is some of the 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];
        
?>

 

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

 

but the uncommented line after returns garbage. what is wrong with my syntax?

 

Tim

Link to comment
https://forums.phpfreaks.com/topic/46252-signature-generator-error/
Share on other sites

Sorry, by garbage I meant that instead of parsing the profile page and spitting out

timelf123
6

(which is what should happen, and works fine if I use the commented line (w/o a variable), but as soon as I add my variable, it spits out a bunch of malformed CSS and html, unformatted/plaintext

 

 

As for posting, yes, my form action is a post

Archived

This topic is now archived and is closed to further replies.

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