steveiwonder — 2011-09-01T11:07:40-04:00 — #1
Simple one but confusing, feel slightly embaressed to ask tbh but oh well.
I'm using include('/somepath/somefile.html');
inside somefile.html i have some blurb like this:
"This is some text which includes a ' some more text... bla bla"
If i try and include the .html it doesn't include any of the text. However if i remove the ' then it works fine.
steveiwonder — 2011-09-01T13:21:06-04:00 — #2
I am extremely sorry to have wasted your time peeps, it was a stupid mistake.
Back in the nav i forgot to add an ending ' .
Again, very sorry.
But thank you.
colinhughes — 2011-09-01T12:38:13-04:00 — #3
Does somefile.html actually contain any markup?
system — 2011-09-01T12:43:34-04:00 — #4
I think we'd have to see the file you're trying to include to say for certain. Could be a character encoding mismatch to the source you're trying to include from -- could be you've got php in that .html (which WILL execute if you use include)
Include is for code -- have you tried using readfile instead? Readfile is for when you do not want the possibility of code execution... include/require is for when you want the file (regardless of it's extension) to be checked for and allowed to execute php.
ralphm — 2011-09-01T11:24:46-04:00 — #5
That's weird. Sounds like there's more than meets the eye here. All the same, you could perhaps replace the ' with a corresponding entity reference if you want a quick fix: '
steveiwonder — 2011-09-01T11:33:34-04:00 — #6
It is weird but yeah that's the other option. I have tested it with " & lots of special characters but its only ' that seems to fail.
Any idea's of what it might be?
ralphm — 2011-09-01T11:38:38-04:00 — #7
It's not my area, I'm afraid. All I can think to ask is what happens if you use
include(<font color='"Red"'>"</font>/somepath/somefile.html<font color='"Red"'>"</font>);
(with double quotes), but I'd be surprised if that makes a difference.
steveiwonder — 2011-09-01T11:41:56-04:00 — #8
Still same result.
Anyone else got any idea's?