timelf123 Posted April 9, 2007 Share Posted April 9, 2007 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 More sharing options...
veridicus Posted April 9, 2007 Share Posted April 9, 2007 Define garbage. Is it malformed HTML? Or an error? Link to comment https://forums.phpfreaks.com/topic/46252-signature-generator-error/#findComment-224943 Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 you sure its $_POST and not $_GET ? Link to comment https://forums.phpfreaks.com/topic/46252-signature-generator-error/#findComment-224945 Share on other sites More sharing options...
timelf123 Posted April 9, 2007 Author Share Posted April 9, 2007 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 Link to comment https://forums.phpfreaks.com/topic/46252-signature-generator-error/#findComment-225262 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.