Jump to content

spending too long on a php issue that was infact something very simple


spiderwell

Recommended Posts

i run wamp on my laptop, and have just started an attempt at an MVC styled website, and had got myself to a point were I was ready to run a test page with a simple view page showing my $_GET array just to test it all worked.

I was for the first time using buffering like this, which was in a class called via the page:

<?php
                ob_start();
	require_once('../ph-admin/views/sample.php');
	$txtDisplay = ob_get_contents();
	ob_end_clean();
?>

 

I then echoed $txtDisplay in the page to show the final out put of sample.php. all it would do though was show the actual php code in sample and in the main page.

3 days of endless jigging around and hairpulling I finally worked out it was because those 2 bits of scripts had short tags and my dev environment had them turned off!!

sad but true!! lols

I was convinced it was to do with the buffering since I was my first attempt at trying that, and didn't even think to check short tags!!

 

Anyone else want to confess to something stupid like this?

 

[ot]magic_quotes short open tags (and all the other things php put into the language to HELP people write 'working' code) has wasted a HUGE amount of man hours and processor cycles.[/ot]

 

Doesn't the offtopic/ot bbcode tag exist/work anymore?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.