TinyPortal

Development => Feedback => Topic started by: redone on June 08, 2005, 07:51:21 PM

Title: Preview PHP block
Post by: redone on June 08, 2005, 07:51:21 PM
Okay, here is the error:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/britp2/public_html/forum/TPpreview.php(18) : eval()'d code on line 1

Parse error: parse error, unexpected $ in /home/britp2/public_html/forum/TPpreview.php(18) : eval()'d code on line 1

Done whilst previewing the following code:

echo $_SERVER['HTTP_USER_AGENT'];

echo '<p>Your IP address is:</p>';
echo $_SERVER['REMOTE_ADDR'];

But the code works! Any ideas?

Thanks!
Title: Re: Preview PHP block
Post by: Bjørn on June 08, 2005, 10:19:56 PM
I think its because SMF does some things to those variables, that the preview function doesn't. I made it separate, so it would not "break" the page.

..but I am thinking maybe just testing it in another window would be safe - and running it trough SMF that way would show it like its supposed to.have to test it, but it may be the way to go. As it is now, it isn't that much helpful.
Title: Re: Preview PHP block
Post by: redone on June 09, 2005, 12:44:14 PM
That's okay. I mean bottomline is the block works and displays just fine just no preview.