im tryin to prog my own template system for somin im buildin using eregi_replace
ive managed to get it to do that but ive got a swtich statement (index.php?q=admin for example)
now what i need it to do is when admin is called is called scroll through the swtich to find the case admin load admin parse the code inside it and then echo it when eregi replace comes acrooss {content}
ive tried using fopen and fread but they dont parse the php include works ok but because its including the data before its echoing it its placing it in the wrong place
arrrrghhhhh i need some ideas how i can do this
1. get q from the url (dont this bit)
2. include the file assosiated with contents of q (array or switch) kina done this
3. parse the php inside the file
4. echo it when needed
ive managed to get number 2 to work by making an array but its using include but that goes wrong as i explained
You basically have to code it in the way to have it include the files where you want it to be outputed. I really doubt there is any other way that would be smart doing it. You could use output buffer stuff, but I wouldn't recommend it.