php-general Digest 6 Oct 2004 15:18:51 -0000 Issue 3037

Topics (messages 198742 through 198757):

Re: A question of style....
        198742 by: John Nichel
        198757 by: Chris Boget

Re: Upload problems
        198743 by: Dennis Gearon
        198744 by: raditha dissanayake
        198747 by: Robert Sossomon

Last call. For PHP/PEAR @ FOSDEM 2005
        198745 by: Christophe Gesché

pdf_open_pdi_page
        198746 by: Hendrik Schmieder
        198750 by: Matt M.

Re: [PHP Attachement Problems - MAC ISSUE!!
        198748 by: PHP Junkie
        198749 by: PHP Junkie

proper method to do the following...
        198751 by: Hugh Beaumont
        198752 by: John Nichel
        198753 by: Greg Donald
        198754 by: Hugh Beaumont
        198755 by: Michael Sims

Memory limit reached but no error displayed
        198756 by: Paulo JF Silva

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Jay Blanchard wrote:
Anything that doesn't use the word 'flava' :)


What if I name all my variables after Rocky characters? ;)

Now for the real can of worms...

On odd lines, I use spaces, and on even lines, I use tabs.

<serious mode>
The above is an attempt at humor.
The below is an attempt at addressing the question.
</serious mode>

http://www.google.com/search?hl=en&ie=UTF-8&q=php+code+standards&btnG=Google+Search

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
> > Anything that doesn't use the word 'flava' :)
> What if I name all my variables after Rocky characters? ;)

Hey!  You stole my method!  Actually, mine are Rocky and
Bullwinkle, but still! :p

thnx,
Chris

--- End Message ---
--- Begin Message ---
Would you mind sharing what it was so that it hits the archives and a few 'enquiring 
minds'?
"Pablo Gosse" <[EMAIL PROTECTED]> wrote:
<quote ------------------------------------------------------->
[snip]

Look in your php.ini for max_upload_size or something like it.

[/snip]

'Twas an apache problem.  Thanks the help.

Cheers,

Pablo
</quote -------------------------------------------------------->

--- End Message ---
--- Begin Message ---
Dennis Gearon wrote:

Would you mind sharing what it was so that it hits the archives and a few 'enquiring minds'?

it probably was the LimitRequestBody apache directive which is set to 512 Kb in some 'out of the box' installations.



-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
With apache, check out the php.conf file located at:
/etc/httpd/conf.d

and modify it to be:
<Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    LimitRequestBody 838860800
</Files>


That'll allow a full CD worth of information to be uploaded... :)

Robert

raditha dissanayake wrote:
Dennis Gearon wrote:

Would you mind sharing what it was so that it hits the archives and a few 'enquiring minds'?


it probably was the LimitRequestBody apache directive which is set to 512 Kb in some 'out of the box' installations.



-- Robert Sossomon, Business and Technology Application Technician 4-H Youth Development Department 200 Ricks Hall, Campus Box 7606 N.C. State University Raleigh NC 27695-7606 Phone: 919/515-8474 Fax: 919/515-7812 [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
I need a Schedule, speaker and public.
That must be request this month.

I think  to 2 themes.
1° PHP5 (real use of  new feature and first feedback)
2° PEAR to a stability and an better reputation.

http://www.fosdem.org/2004/index/news/fosdem

The FOSDEM (Free and Open Source Developers' European Meeting) is a free and non-commercial event for the community and organized by the community. Its goal is to provide Free and Open Source developers and communities a place to meet to
# get in touch with other developers and projects,
# get informed about the latest developments in the Free and Open Source world,
# attend to interesting talks and presentations held in large conference rooms by Free and Open Source project leaders and committers on various topics,
# and to promote the development and the benefits of Free and Open Source solutions.





My English is bad.
If you want, you can short-cut me and direct contact fosdem team by send an e-mail to [EMAIL PROTECTED]


--
---------------------------------
Moosh -- php.net -- phpfrance.com
=== Php & Pear @ Fosdem  2005 ===

--- End Message ---
--- Begin Message ---
Hello,

when I try to execute the php script below
I get the following error message

*Fatal error*: PDFlib error: [2016] PDF_open_pdi: PDF import (PDI) not supported in this configuration in *d:\worksheet-server\wss\html\pdf\test2.php* on line *7*

I'm using Apache 1.3.31 with php 4.3.8 on Windows 2000 .

The line
extension=php_pdf.dll
is uncommented in php.ini

phpinfo shows

PDF Support                        enabled
PDFlib GmbH Version          5.0.3
Revision                                $Revision: 1.112.2.9 $

What am I missing ?

Here is the script :

<?php

$pdf = pdf_new();

if (pdf_open_file($pdf))
{
   $pdi = pdf_open_pdi($pdf, 'pdf/pdftest.pdf', "", 0);
   $page = pdf_open_pdi_page($pdf, $pdi, 1, "");

   $page = pdf_open_pdi_page($pdf, $pdi, 1, "");
   $width = pdf_get_pdi_value($pdf, "width", $pdi, $page, 0);
   $height = pdf_get_pdi_value($pdf, "height", $pdi, $page, 0);

   pdf_begin_page($pdf, $width, $height);

   pdf_place_pdi_page($pdf, $page, 0.0, 0.0, 1.0, 1.0);

   $font = pdf_findfont($pdf, "Courier", "host", 0);
   pdf_setfont($pdf, $font, 20);
   pdf_show_xy($pdf, "Second page", 200, 350);

   pdf_close_pdi_page($pdf, $page);

   pdf_end_page($pdf);
   pdf_close($pdf);

   $data = pdf_get_buffer($pdf);

   $fp = fopen ('pdftest.pdf', 'wb');
   fwrite ($fp, $data);
   fclose ($fp);
}
else echo "pdf_open_file failed <br>\n";

?>

with best regards

Hendrik Schmieder
--- End Message ---
--- Begin Message ---
> *Fatal error*: PDFlib error: [2016] PDF_open_pdi: PDF import (PDI) not
> supported in this configuration in
> *d:\worksheet-server\wss\html\pdf\test2.php* on line *7*

I could be wrong but I think you need a special license for this functionality.

--- End Message ---
--- Begin Message ---
Ave,

Manuel...

I saved the new email_message.php class that you sent me replacing the old
one. I used the test_attachment_message.php to test the new class. This time
it didn't send the email with the corrupted attachments, instead, gave me an
error on the screen... This is the error that I received:

³Error: the length of the file that was read does not match the size of the
part file CarsContract-Generic.pdf due to possible data corruption²

I understand now that garbage characters are being inserted by PHP in the
attachment files. Which is why also the other day when I tried your little
php code, it gave Size 35823 but Read 36704 with the additional garbage
characters added. Unfortunately, I think with the new class too, the same is
happening, as per the error. Only this time it is actually giving the error
instead of sending the corrupted file.

Please advice what I can do next... Iım looking into the Mac compatibility
issue everywhere but I donıt see anywhere anyone else complaining about such
a thing.

Thanks again,
Junkie



On 10/5/04 10:22 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 10/05/2004 04:57 PM, PHP Junkie wrote:
>> I replaced the code and added my PDF file in the required place, and this is
>> what it displays now:
>> 
>> Size 35823 Read 36704
>> 
>> I'll put in your address and send out the mail your way with the PDF
>> attachment using the class script.
> 
> It seems that the problem has to due with garbage characters inserted by
> PHP during the read of the file because some PHP options set in your
> environment.
> 
> I have added a few workarounds to the class and it should avoid the
> problem now. I am sending you the new class version attached to this
> message. Please try it now and let me know if you still have problems.


--- End Message ---
--- Begin Message ---
Ave,

One more thing I'd like to point out, which I just discovered. The php code
I was using earlier, prior to using Manuel's mail class... Was not able to
send any kind of attachment except .txt files. Niether images nor pdf nor
anything would go through without being corrupted.

However, using Manuel's class, the images are going through attached
properly, without being corrupted. The PDF files still give the error that
the file size & read size isn't the same, but text and image attachments are
going through.

Junkie

--- End Message ---
--- Begin Message ---
I've been working with 

error_reporting(E_ALL)

set lately trying to write code that does not give notices or errors. 

I have not been able to solve the following: 

given a form with a checkbox that may or may not be set, we'll call it "exact" as in

<input type = "checkbox" name = "exact">

the following code outputs :

Notice: Undefined index: exact in search.php on line 10

code :

if (!isset($_POST['exact'])) {   <--------- line 10
  $_POST['exact'] == false;
}

if ($_POST['exact'] == "checked")   <------ also here
{
  $exact_match_only = true;
}
else {
  $exact_match_only = false;
}

I understand why it is giving the notice but I'm not sure how to make it stop. 

What is the proper way to set a variable so that it's non-existance will not generate
a notice?

Any ideas?

Let me know if the above is not clear. Thanks.





                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

--- End Message ---
--- Begin Message --- Hugh Beaumont wrote:
I've been working with

error_reporting(E_ALL)

set lately trying to write code that does not give notices or errors.

I have not been able to solve the following:

given a form with a checkbox that may or may not be set, we'll call it "exact" as in

<input type = "checkbox" name = "exact">

the following code outputs :

Notice: Undefined index: exact in search.php on line 10

code :

if (!isset($_POST['exact'])) {   <--------- line 10
  $_POST['exact'] == false;
}

if ($_POST['exact'] == "checked")   <------ also here
{
  $exact_match_only = true;
}
else {
  $exact_match_only = false;
}

I understand why it is giving the notice but I'm not sure how to make it stop.

What is the proper way to set a variable so that it's non-existance will not generate
a notice?

Any ideas?

Let me know if the above is not clear. Thanks.

Try it like this...

if ( isset ( $_POST['exact'] ) ) {
        // do what you need to do if it's checked
} else {
        // do what you need to do if it's not checked
}

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
On Wed, 6 Oct 2004 06:53:34 -0700 (PDT), Hugh Beaumont
<[EMAIL PROTECTED]> wrote:
> Notice: Undefined index: exact in search.php on line 10
> 
> code :
> 
> if (!isset($_POST['exact'])) {   <--------- line 10
>   $_POST['exact'] == false;
> }

Reverse the logic of isset().  

if (isset($_POST['exact'])) {
  $_POST['exact'] == TRUE;
}

If a variable is genuinely not set, it will produce the warning or
notice you are seeing.  There are a few ways to circumvent that: lower
your error reporting level, or quiet the error with @, or reverse the
logic so the error doesn't exist.  I prefer the last method as I
always use full error reporting during development.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--- End Message ---
--- Begin Message ---
> I've been working with 
> 
> error_reporting(E_ALL)
> 
> set lately trying to write code that does not give notices or errors. 
> 

> 
> What is the proper way to set a variable so that it's non-existance 
will not generate
> a notice?
> 

Thanks all for the replies. I also noticed a small typo in the code I 
posted which made it even
worse (used == instead of = when doing the assignment).

Thanks again!


                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

--- End Message ---
--- Begin Message ---
Hugh Beaumont wrote:
> the following code outputs :
>
> Notice: Undefined index: exact in search.php on line 10
>
> code :
>
> if (!isset($_POST['exact'])) {   <--------- line 10
>   $_POST['exact'] == false;
> }

You have a typo in line 11.  I'm assuming you want to use the assignment operator
"=" instead of the equality operator "==".  The PHP parser seems to be incorrectly
attributing the error to line 10 when it should be on line 11.  If you change "=="
to "=" your error will go away.  It took me a moment to catch it because of the
misleading error message.

HTH

--- End Message ---
--- Begin Message ---
Hi,

I have found a bug in one of my scripts. It doesn't output anything, just a 100% blank page. I debugged it to a single implode line. If I comment it, it's ok, the page show my debug echo's and stuff, if i let the script run that line the result is a blank page even with echo's done before that line.

I think the problem is memory limit, when i change it to 16M it works fine.

But my doubt/problem is about error reporting. Shouldn't it appear something saying: memory error or something? It doesn't appear anything... I have error_reporting E_ALL, maybe I should look to other config's? which ones?

Thanks in advance for your help,
Paulo JF Silva

--- End Message ---

Reply via email to