PDF_function HELP again!!! :(

From: Date: Tue, 30 Jul 2002 18:57:09 +0000
Subject: PDF_function HELP again!!! :(
Groups: php.general 
Request: Send a blank email to php-general+get-110389@lists.php.net to get a copy of this message
Here we go again; I posted the message "pdflib, NEED HELP with function problem (newby)" and thank you to all that helped. Even after that help, seems I cant understand scope to well. Im trying to make a function that creates another page when I have reached the bottom of a page. For some reason everytime I try to include a PDF_function call inside a function I get an out of scope error message. Like so: "Fatal error: PDFlib error: function 'PDF_begin_page' must not be called in 'page' scope" The function I created is below function next_page($throw) { global $p; if ($throw = "open") { PDF_begin_page($p, 600, 800); return; } if ($throw = "close") PDF_end_page($p); return; } } All I do is put in to var $throw open or close and its not working; $p is global, what am I doing wrong? Im really having a terrible time with scope and php, no calles from PDF seem to want to work inside a function. Thanks for any help you guys can give me. Im pulling my hair out. PHP is a great language but this scope stuff is givin me fits. Jeff

« previous php.general (#110389) next »