Forum Moderators: open

Message Too Old, No Replies

HTML code on PHP site?

Hold back the laughter, I'm really new at this...

         

PrattTA1

4:11 pm on Jan 17, 2007 (gmt 0)

10+ Year Member



Hello WebmasterWorld! I'm trying to do (what I would think would be) an easy change to my website. I just started using a new Email Marketing service and I want to put the code on my PHP site so my visitors can sign up for my monthly newsletter.

The problem is, when I put the HTML code in the INC file, it doesn't display correctly. I suppose my question is, can I put HTML code in the INC file on a PHP site? Try to hold back the laughter and not roll your eyes :)

Any quick solutions?

phranque

10:58 pm on Jan 17, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



are you saying the file is not being included or its contents are not displaying properly?

cameraman

12:56 am on Jan 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Quick solution, no, because it depends on both the INC file and the document that's INCluding it.
Stuff that's in between "<?php" and its closing "?>" gets 'executed' by the server. It can be splattered anywhere around a document; before the opening <html>, in the header, in the body, or after. If you place html in between those tags, it's probably not going to get displayed. Even if you place your html between sets of those in the INC file, if the php code in the document isn't saying, 'hey, display this', it won't be displayed.
You're probably going to have to learn a little php to get it to do what you want.

eelixduppy

4:36 am on Jan 18, 2007 (gmt 0)



Welcome to WebmasterWorld, cameraman! :)

PrattTA1, cameraman is correct in that it depends on the situation and where you want the html to be included. You might want to read the include [us3.php.net] documentation as it explains how the process works.

You might also want to look into auto_prepend_file [us3.php.net] and auto_append_file [us3.php.net] as they might provide solutions for you if they fit well within what you are trying to accomplish.

Good luck! :)

PrattTA1

6:06 pm on Jan 18, 2007 (gmt 0)

10+ Year Member



You were right cameraman, thanks for the help everyone. I'm working on my PHP skills as we speak.