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?

 

Link to comment
Share on other sites

[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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.