Jump to content

m-code

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

m-code's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm pretty new here, so I give it a shot of trying to help you. I don't really a big fan of using preg-functions so I just show you a different way of how I would do it. $content = file_get_contents("http://www.bungie.net/News/content.aspx?type=topnews&cid=12562",'r'); $content = strstr($content,'<div class="stdcontent" id="topStoryPreviewDiv">'); $len = strstr($content,'</div>'); $len = strlen($len); print substr($content,0,-$len); Good luck with it
  2. For who ever needs this solution too. I found a way of how to do it. Basically you need to use ob-handlers. What I did is create a function and return the eval'd code into a variable to be able to replace it later. function strInclude($content){ ob_start(); eval($content); $content = ob_get_contents(); ob_end_clean(); return $content; } $content = file_get_contents("file.php"); $content = strInclude($content); found help @ php.net browsing thru the eval posts
  3. I'm trying to include a php file at a certain point in my template. Including works fine, just it doesn't place it at the right place where I want it to be. The news.php file will be included up front and not at the desired place {content} where it should go to. I tried str_replace instead of ereg_replace, but str_replace displayed only the news.php page and truncated the rest of the page. main.php: $row = file_get_contents("template.htm"); $row = ereg_replace("{login}",$login,$row); $row = ereg_replace("{menu}",$menu,$row); $row = ereg_replace("{content}",eval(file_get_contents("news.php")),$row); print $row; template.htm: <table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="200"> </td> <td width="407" id="menu">{menu}</td> </tr> <tr> <td id="login">{login}</td> <td id="content">{content}</td> </tr> </table> I'd appreciate every help, I browsed thru the forum but could only find one closeley related post to my problem, but it didn't really help me any further as I was before. thx
×
×
  • 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.