Reputation: 865
Hi I'm new to PHP and CodeIgniter and I have the following problem
I have a controller in which I want to call a PHP funnction that is defined on another .php.
This is the function:
function createNote($note_text){
header('Content-type: image/jpeg');
$note = "./application/controllers/notes/note.jpg";
$rImg = ImageCreateFromJPEG($note);
imagejpeg($rImg);
//After this I want to use the "imagettftext" function to insert the $note_text in
//the image
}
This is suposed to load that image and show it (I guess) but it doesn't, instead it shows the following:
I know the path to the image is correct because if I change it the ImageCreateFromJPEF returns an error saying that the image was not found...
Any ideas?
Thanks in advance!
Upvotes: 1
Views: 2300
Reputation: 865
After VictorKilo answered I searched how to set the .htaccess file.
This question helped me a lot: How do I write a .htaccess file to make CodeIgniters URL routing work?
Before, my .htaccess had "Deny from all", now it looks like this:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|stylesheets|scripts|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
Hope this helps someone else. Thanks for your time and answers Umair Iqbal, VictorKilo and Robbie.
Upvotes: 0
Reputation: 17710
Troubleshooting tips:
Upvotes: 1