View Single Post
Old 03-23-10, 02:49 AM   #6
Dethklok Returns!
t3hl33td4rg0n's Avatar
Join Date: Dec 2004
Location: Kent, OH
Posts: 2,142
Send a message via AIM to t3hl33td4rg0n Send a message via MSN to t3hl33td4rg0n Send a message via Yahoo to t3hl33td4rg0n
Default Re: LAMP Templating/CMS Performance

Originally Posted by ViN86 View Post
Yea there are some limitations to AJAX. Mostly that older browsers don't really support it and different browsers handle things differently.
As long as its supported in FF2, IE6 then you should be ok. From there it depends on the data output method you use. Doing straight preprocessed HTML shouldn't ever be a problem, however if the script is doing other stuff, you could run into issues.

Originally Posted by ViN86
Yea, I learned method 2 from a PHP book. Once I realized that you can pretty much insert PHP tags and write some code wherever you want, it only seemed natural to just insert data on the fly wherever instead of searching for strings to replace.
Some do argue against this point in that they should always be separate. IMO, it depends on context and usage.

Originally Posted by ViN86
Actually it's even simpler than that. I just write w/e PHP and HTML I need into a page called header.php or something, then I just put in include("header.php"); where I want the header to display and it just echoes the text. You have to be careful, though. I typically store my files in a template folder. But when you use include, it treats the inserted code as if it were coming from the home directory, not where it actually is. So if you're not careful you can mess up links this way.
I usually use a constant to get around this, so that any relative paths are updated, regardless of where you put the file, as long as you update the relative path locale base script.

In method 1, I did this...
table width="100%" border="0" cellspacing="0" cellpadding="0">
		<td width="169" align="left" valign="top" nowrap="nowrap"><img src="{{PATH}}img/head_top_01.jpg" width="169" height="61" alt="Logo"></td>
		<td align="left" valign="top" nowrap="nowrap"><img src="{{PATH}}img/head_top_02.jpg" ></td>
		<td colspan="2" class="headNav" nowrap="nowrap"><img src="{{PATH}}img/head_nav_01_home_n.jpg" width="68" height="28" alt="Home" /><img src="{{PATH}}img/head_nav_spacer.jpg" width="17" height="28"><img src="{{PATH}}img/head_nav_02_services_n.jpg" width="110" height="28" alt="Services"><img src="{{PATH}}img/head_nav_spacer.jpg" width="17" height="28"><img src="{{PATH}}img/head_nav_03_blog_n.jpg" width="63" height="28" alt="Blog"><img src="{{PATH}}img/head_nav_spacer.jpg" width="17" height="28"><img src="{{PATH}}img/head_nav_04_resume_n.jpg" width="96" height="28" alt="Resume"><img src="{{PATH}}img/head_nav_spacer.jpg" width="17" height="28"><img src="{{PATH}}img/head_nav_05_contact_n.jpg" width="106" height="28" alt="Contact"></td>

Of course this will be redone using the new method. Actually, this would be a good place to use AJAX, to minimize the number of php entries. It could be part of the constructor to be done automagically.

Method 1:
Method 2:

Intel QX9650 @ 3.83GHzXFX 780ieVGA GTX 560Ti8GB GSkill DDR800Creative Sound Blaster X-Fi Titanium PCI-ESeagate 1.5TB . 4x Samsung 2TB

Originally Posted by MowTin View Post's so clear how government makes things worse not better...

Last edited by t3hl33td4rg0n; 04-09-10 at 02:40 AM.
t3hl33td4rg0n is offline   Reply With Quote