Jump to content


Photo

Do some script coding for website?


  • Please log in to reply
1 reply to this topic

#1 LegendBreath

LegendBreath
  • Members
  • Pip
  • Newbie
  • 6 posts
  • LocationNew Brunswick, Canada

Posted 08 September 2006 - 01:16 AM

Hi there,
I want to have a page, like for example, that it gets from the MySQL database, if it's like for example, "#include layouts/default/enterpage.php;". I want it to read that it needs to include a page, and include this page. I know that I can do that by searching for all #include then look after the include and etc. but you know, is there any better way?

#2 LegendBreath

LegendBreath
  • Members
  • Pip
  • Newbie
  • 6 posts
  • LocationNew Brunswick, Canada

Posted 08 September 2006 - 01:55 AM

Nvm, solved here is what I use:
		do{
			$in = "#include";
			if($pos = strpos($content, $in)){
				$pos = strpos($content, $in);
				$content = substr($content, 0, $pos) . "" . substr($content, $pos+strlen($in));
				include(trim(substr($content, $pos, strpos($content, ";") - 1)));
				$content = ReplaceOne(substr($content, $pos, strpos($content, ";")), "", $content);
			}else{
			    break;
			}
		}while(0);





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users