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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to