GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Wierd fucking PHP & HTML error. HELP! (https://gfy.com/showthread.php?t=840326)

Emil 07-09-2008 04:12 PM

Wierd fucking PHP & HTML error. HELP!
 
I got a fucking weird html error and it's driving me nuts.

I got a bit of html-table code. It's working fine if I add it in the index.php-file.
But if I save the same bit of code in toplist.html

and replace the part in the index.php-file with:
<?php include "./sloth_toplist/toplist.html"; ?>

The table gets fucked up. But it's the same fucking HTML-code!

Any idea what can cause this? There's no extra spaces or linebreaks...

:mad::mad::mad::mad::mad:

brandonstills 07-09-2008 04:45 PM

Do you have apache configured to treat .html as PHP code?

Deej 07-09-2008 04:48 PM

Quote:

Originally Posted by brandonstills (Post 14442097)
Do you have apache configured to treat .html as PHP code?

hooooty hooooo~!

natkejs 07-10-2008 12:55 AM

If you're willing to pay or my time I'll fix it.

Azathoth 07-10-2008 01:01 AM

Quote:

Originally Posted by Emil (Post 14441986)
I got a fucking weird html error and it's driving me nuts.

I got a bit of html-table code. It's working fine if I add it in the index.php-file.
But if I save the same bit of code in toplist.html

and replace the part in the index.php-file with:
<?php include "./sloth_toplist/toplist.html"; ?>

The table gets fucked up. But it's the same fucking HTML-code!

Any idea what can cause this? There's no extra spaces or linebreaks...

:mad::mad::mad::mad::mad:

Your server probably only parses PHP in .php files, not .html files. Rename the file to a .php and it will work (or reconfigure your server).

- Az

Alky 07-10-2008 01:12 AM

err wait is it loading the include?

Alky 07-10-2008 01:15 AM

Also it's not the extension... you could do .blah and as long as <?php are in it, it should still process the php code. I think ;)

Ecchi22 07-10-2008 01:20 AM

Is there anything else in the PHP file? Maybe some style or code in it is making the problem. Or toplist.html is loading external css file but because of include, the location is different and it can't be loaded..

Also, try to remove that ./ thingie, so instead of ./sloth_toplist/toplist.html just put sloth_toplist/toplist.html

;)

Emil 07-10-2008 01:38 AM

I was trying to get it working for 4 fucking hours! Still no luck! It's only HTML in the file I try to include. I renamed it to a .txt file just to try but the table get fucked up anyway.

I also tried to change the format of the file I include to ANSI and UTF-8 but it didn't have anything to do with it either.

Also tried different method to include the file with PHP but no luck there either.


Thanks for trying to help me with this shit. I'll ask the designer if he knows whats going on when he gets online.

yahoo-xxx-girls.com 07-10-2008 01:57 AM

use note pad or similar program and open up your html page and save such as "index.php" and keep the quotes... (if you are using Windows) plus check your php plug ins options within your server.... there should be a small list.

brandonstills 07-10-2008 02:11 AM

Quote:

Originally Posted by Alky (Post 14443528)
Also it's not the extension... you could do .blah and as long as <?php are in it, it should still process the php code. I think ;)

By default Apache will only treat .php extensions as having PHP content. It doesn't matter if you put <?php in it. It will be treated as plain text if the web server doesn't pass it to the PHP engine.

brandonstills 07-10-2008 02:15 AM

I just tried including a file that only contained text (no PHP).

include 'blah.html';

It included it and displayed the contents of blah.html.

Check the path to the file and to make sure it's in the correct spot. The working directory should be relative to the first .php file invoked, not the last one.

LazyD 07-10-2008 02:16 AM

Quote:

Originally Posted by brandonstills (Post 14442097)
Do you have apache configured to treat .html as PHP code?

The file extension doesn't matter when including a file located on a local server. PHP parsing is done after inclusion, so even if you include txt files it will work :2 cents:

(if you specify a URL instead of a server path then in that case yes the extension must be PHP... when including external ressources the parsing is done during inclusion)


Well... Emil send me the files by icq, i will have a quick look at your problem :)

Emil 07-10-2008 03:06 AM

lol, finally solved it.

for some reason I got some table-error when I had this line in the include file "<table width="100&#37;" border="0" cellspacing="4" cellpadding="0" class="fg">"

But if I left it in the index.php file and just included the rest of the table everything worked fine.


All times are GMT -7. The time now is 05:55 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123