php-general Digest 17 Jan 2004 22:11:38 -0000 Issue 2536

Topics (messages 174916 through 174937):

Re: HTML tags inside PHP??
        174916 by: Binay

Re: dynamicly generating a transparent truecolor image
        174917 by: Mike Brum
        174923 by: Brian V Bonini

stdin from a pipe
        174918 by: Decapode Azur

Re: spelling without aspell/pspell?
        174919 by: Lowell Allen

How to grab a value from the database?
        174920 by: SASSINC Internet Solutions - Arabic Department

Re: Pdfs  getting corrupted during upload
        174921 by: Bogdan Stancescu

Thumbnails in database
        174922 by: Kevin Waterson
        174924 by: Daniel Guerrier
        174929 by: Robert Cummings
        174934 by: Mike Migurski
        174935 by: Kevin Waterson

Re: Image Header Issues
        174925 by: Brian V Bonini
        174927 by: Bob Eldred
        174932 by: Larry Brown
        174937 by: Toby Irmer

Please reply as fast as possible..
        174926 by: SASSINC Internet Solutions - Arabic Department
        174928 by: Richard Davey

Re: Trying again: Random(?) blank pages when using sessions
        174930 by: memoimyself.yahoo.com.br

I bought "SAMS PHP & mySQL WEB DEVELOPMENT":)
        174931 by: SASSINC Internet Solutions - Arabic Department
        174936 by: memoimyself.yahoo.com.br

Re: alternative to protecting files through http auth.
        174933 by: Scott Taylor

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 ---
echo '<html> <title>..........';

cheers
Binay
----- Original Message -----
From: "SASSINC Internet Solutions - Arabic Department"
<[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 17, 2004 3:31 PM
Subject: [PHP] HTML tags inside PHP??


> Hi all!
>
> How is everything?
>
> I'm want to insert some HTML tags inside the PHP page to echo them.. And
then I will use "MARKER" to import them by VB program..
>
> So now how to insert HTML tags to PHP?
>
> Waiting your replies..
>
> Thanks alot for advance
>

--- End Message ---
--- Begin Message ---
PNG's support transparency as well as GIFs. 

The short answer is that you'll create your image and also specify a color
that will be made transparent. I don't see why imagecreatetruecolor making a
default black image is a problem? If it is, just set black to be the
transparent color and go from there. 

This is your friend:
http://us4.php.net/manual/en/function.imagecolortransparent.php

Regards
Michael Brum 

-----Original Message-----
From: Peter Vertes [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 17, 2004 1:48 AM
To: php
Subject: Re: [PHP] dynamicly generating a transparent truecolor image

If you want to create a transparent image don't forget it must be a GIF.  At
least that's what my graphics guys have been telling me all these years :)

-Pete

On Jan 16, 2004, at 04:41, Michel van der Breggen wrote:

> hi,
> i have a problem, i would like to dynamicly generete a transparent 
> truecolor image in php. The problem is that imagecreatetruecolor 
> standard creates a black image. Does anybody have a solution for this?
>
> Thanks in advance,
> Michel van der Breggen
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php
>

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

--- End Message ---
--- Begin Message ---
On Sat, 2004-01-17 at 08:12, Mike Brum wrote:
> PNG's support transparency as well as GIFs. 
> 

Just keep in mind that IE does not support transparency in png's.


-- 
Brian        GnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
                                          Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
hello,
What is the better way to read from a pipe from a php cli script?

#! /usr/bin/php -q
<?php
$stdin = fopen('php://stdin', 'r');
while (!feof($stdin))
    $buffer .= fgets($stdin, 4096);
fclose($stdin);
?>
or
<?php
while ($stdin = fread(STDIN, 4096)) $buffer .= $stdin;
?>

I have tryed these ways, but the problem is that if there is no pipe input,
the script is waiting for ^D from the user (so this is a problem if the php 
filter is used in a bash script, because it will block the process).

How can I detect if there is an stdin from a pipe or not?

I have tryed this but it does not work:
stream_set_timeout(STDIN, 1, 10);

-- 
thanks

--- End Message ---
--- Begin Message ---
> Hi,
> 
> I just found a really nice set of javascripts for spell-checking a
> textarea before submitting, which is really nice, BUT is shell_exec()'s
> to aspell, which neither my host or my staging server has installed.
> It works with both PHP and Perl too.
> 
> There's a demo here:
> http://www.netjs.com/speller/
> 
> What I'd like to know is if there's any other PHP-oriented solutions to
> spell checking that I might be able to integrate (with a fair amount of
> hacking) into this solution -- or perhaps a complete solution that
> doesn't require any compiling or libraries exists????

Just FYI -- if you've searched for information on a spell checker, I'm sure
you saw Jspell -- <http://www.jspell.com/jspell.html>. It's Java and
Javascript, but I found it fairly easy to add to a PHP CMS.

--
Lowell Allen

--- End Message ---
--- Begin Message ---
Hi...

I stopped here in my program :

I want to make a PHP page that reads from a mySQL Database.. This page displays two 
fields for the user : 1- Username. 2- Password.

Now in the database there are many columns.. each one has many fields :

Username, Password, Serial, Phone No., Address..Etc..

Now I want the PHP file to take the Username and Password after the user enter them in 
the fields and compare them with the ones inside the database.. if they are the same.. 
the serial field inside the database will send its value to the PHP page.. which will 
echo it as a variable ($var) there..

So every user has a column that has..

Waiting your replies..

Regards..
Hadi Aladdin

--- End Message ---
--- Begin Message --- You didn't specify whether you and your client are using the same server. If not, make sure you have the same gpc slashing settings on both servers.

Bogdan

Binay wrote:
Hi all,

I m undergoing a very weird kind of file uploading problem. I m trying to upload an image file and a pdf file using HTTP Upload form. Now my client is complaining that pdf file is getting corrupted during uploading as they do not open once uploaded. But when i try to upload(using WinXp home, I.E 6+) from my end every thing works perfectly ... so its very surprising for me.

Initially when client complained (using WinXp home editon , I.E 6+) , i thought it is some browser issue and hence instructed them to upload pdf using Win2K machine. But they are facing the same problem there also. I don know wht to do..

Any of u guys faced this sort of problem plz tell me where exactly is the problem? Why the pdf files are getting corrupted? is there some thing hidden which is causing the corruption?

Thanks in advance

Binay


--- End Message ---
--- Begin Message ---
I am storing some images in a database. No problems there.
But how can I create a thumbnail do store in the db also
without having to create the thumbnail image on the 
file system first?

Kind regards
Kevin

--- End Message ---
--- Begin Message ---
Why create thumnails?  You can resize the images on
the fly when needed.
--- Kevin Waterson <[EMAIL PROTECTED]> wrote:
> I am storing some images in a database. No problems
> there.
> But how can I create a thumbnail do store in the db
> also
> without having to create the thumbnail image on the 
> file system first?
> 
> Kind regards
> Kevin
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

--- End Message ---
--- Begin Message ---
> --- Kevin Waterson <[EMAIL PROTECTED]> wrote:
> > I am storing some images in a database. No problems
> > there.
> > But how can I create a thumbnail do store in the db
> > also
> > without having to create the thumbnail image on the 
> > file system first?
> > 
> > Kind regards
> > Kevin
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 

On Sat, 2004-01-17 at 10:24, Daniel Guerrier wrote:
> Why create thumnails?  You can resize the images on
> the fly when needed.

If you mean resize with <img /> tag then you are wasting bandwidth. If
you mean resize by creating the thumbnail at request time, then you are
wasting processing time. Unless the thumbnail is requested very
infrequently then it is usually better to have a pre-resized image, than
to resize it on the fly.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
>Why create thumnails?  You can resize the images on
>the fly when needed.

It's generally good practice to trade CPU for disk space, where possible.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

--- End Message ---
--- Begin Message ---
This one time, at band camp, Daniel Guerrier <[EMAIL PROTECTED]> wrote:

> Why create thumnails?  You can resize the images on
> the fly when needed.

This would be too expensive.

I need to store the thumbnails in the database.
So, I need to resize the image at the same time as I store it.

I can do this and save the thumbnail in the file system, but
cannot save the thumbnail in the database.

Kind regards
Kevin

-- 
 ______                              
(_____ \                             
 _____) )  ____   ____   ____   ____ 
|  ____/  / _  ) / _  | / ___) / _  )
| |      ( (/ / ( ( | |( (___ ( (/ / 
|_|       \____) \_||_| \____) \____)
Kevin Waterson
Port Macquarie, Australia

--- End Message ---
--- Begin Message ---
On Fri, 2004-01-16 at 20:48, Bob Eldred wrote:
> Grr.....that's *not* the problem.  IE saves JPGs just fine, so long as they
> are not passed through this particular script.  Which is why I think it has
> something to do with the headers.
> 
> Bob
> 
> ----- Original Message ----- 
> From: "Arthur Pelkey" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, January 16, 2004 6:29 AM
> Subject: RE: [PHP] Image Header Issues
> 
> 
> > I've had this same problem, and it was not related to any script I
> > wrote, ie just stopped saving in any other format(for images), besides
> > bmp, I  am sure there would be something on ms's knowledge base, but it
> > escapes me what I did to fix it, or updated.

This is a known issue with IE. And it is in their knowledge base. If I
recall the fix is to clear the cache, cookies, and broken/corrupt
objects.


-- 
Brian        GnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
                                          Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
Again, it is *not* that known issue.  That's the very first thing I checked.
If that were the issue, jpgs from other sources would also not save
properly.  But they do, as I've stated several times.

Thanks, though.

Bob

----- Original Message ----- 
From: "Brian V Bonini" <[EMAIL PROTECTED]>
To: "Bob Eldred" <[EMAIL PROTECTED]>
Cc: "PHP Lists" <[EMAIL PROTECTED]>
Sent: Saturday, January 17, 2004 7:28 AM
Subject: Re: [PHP] Image Header Issues

This is a known issue with IE. And it is in their knowledge base. If I
recall the fix is to clear the cache, cookies, and broken/corrupt
objects.

--- End Message ---
--- Begin Message ---
try adding showpicture.php?pid=111384&img=x.jpg to the end even though you
aren't using that variable, IE may see that the type is jpg here.  I have
this same problem/workaround in place right now for a script that wouldn't
work with IE without it for downloading pdf. (pdf was generated on the fly)

-----Original Message-----
From: Bob Eldred [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 17, 2004 12:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Image Header Issues


Again, it is *not* that known issue.  That's the very first thing I checked.
If that were the issue, jpgs from other sources would also not save
properly.  But they do, as I've stated several times.

Thanks, though.

Bob

----- Original Message -----
From: "Brian V Bonini" <[EMAIL PROTECTED]>
To: "Bob Eldred" <[EMAIL PROTECTED]>
Cc: "PHP Lists" <[EMAIL PROTECTED]>
Sent: Saturday, January 17, 2004 7:28 AM
Subject: Re: [PHP] Image Header Issues

This is a known issue with IE. And it is in their knowledge base. If I
recall the fix is to clear the cache, cookies, and broken/corrupt
objects.

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

--- End Message ---
--- Begin Message ---
I have the same problem. Strange: I have a session_start(); before the
header... if I take that out, the image will download as a JPG... so maybe
if you find a way to do things in this script without starting the session
first...

toby


----- Original Message -----
From: "Larry Brown" <[EMAIL PROTECTED]>
To: "Bob Eldred" <[EMAIL PROTECTED]>; "PHP List"
<[EMAIL PROTECTED]>
Sent: Saturday, January 17, 2004 6:32 PM
Subject: RE: [PHP] Image Header Issues


> try adding showpicture.php?pid=111384&img=x.jpg to the end even though you
> aren't using that variable, IE may see that the type is jpg here.  I have
> this same problem/workaround in place right now for a script that wouldn't
> work with IE without it for downloading pdf. (pdf was generated on the
fly)
>
> -----Original Message-----
> From: Bob Eldred [mailto:[EMAIL PROTECTED]
> Sent: Saturday, January 17, 2004 12:00 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Image Header Issues
>
>
> Again, it is *not* that known issue.  That's the very first thing I
checked.
> If that were the issue, jpgs from other sources would also not save
> properly.  But they do, as I've stated several times.
>
> Thanks, though.
>
> Bob
>
> ----- Original Message -----
> From: "Brian V Bonini" <[EMAIL PROTECTED]>
> To: "Bob Eldred" <[EMAIL PROTECTED]>
> Cc: "PHP Lists" <[EMAIL PROTECTED]>
> Sent: Saturday, January 17, 2004 7:28 AM
> Subject: Re: [PHP] Image Header Issues
>
> This is a known issue with IE. And it is in their knowledge base. If I
> recall the fix is to clear the cache, cookies, and broken/corrupt
> objects.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi...

I stopped here in my program :

I want to make a PHP page that reads from a mySQL Database.. This page displays two 
fields for the user : 1- Username. 2- Password.

Now in the database there are many columns.. each one has many fields :

Username, Password, Serial, Phone No., Address..Etc..

Now I want the PHP file to take the Username and Password after the user enter them in 
the fields and compare them with the ones inside the database.. if they are the same.. 
the serial field inside the database will send its value to the PHP page.. which will 
echo it as a variable ($var) there..

So every user has a column that has..

Waiting your replies..

Regards..
Hadi Aladdin

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

Saturday, January 17, 2004, 4:59:07 PM, you wrote:

SISAD> Now I want the PHP file to take the Username and
SISAD> Password after the user enter them in the fields and compare
SISAD> them with the ones inside the database.. if they are the same..
SISAD> the serial field inside the database will send its value to the
SISAD> PHP page.. which will echo it as a variable ($var) there..

We are not here to write your project for you. Plenty of people have
already told you to download the documentation and get yourself some
good books on the subject. It is becoming clear you have no wish to
teach yourself, so why should any of us?

RTFM.

-- 
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Matt,

You're not by any chance using an Apache server on a machine that also has a firewall, 
are you? I've had all sorts of mysterious session-related problems when running 
scripts 
on my test server (Apache on Win2k with a ZoneAlarm firewall). Took me *ages* to zero 
in on the source of the problem. Now whenever I need to test a script that involves 
sessions, I simply disconnect from the internet and shut down my firewall.

Cheers,

Erik


On 16 Jan 2004 at 16:32, Matt Grimm wrote:

> Can anyone think of ways I can troubleshoot this problem?  I still haven't
> found a solution.
> 
> > I'm using non-cookie-based sessions for authentication on a page.  The
> > session is set like so, which works (these values, along with the SID, are
> > always retrievable):
> >
> > $_SESSION['user'] = $_POST['UserName'];
> > $_SESSION['time'] = time();
> >
> > My problem is when I get to the protected site area, in which a header
> > script calls session_start() at the top (first line).  Seemingly randomly,
> > while navigating links within this area, I get blank white pages.  If I
> > comment out the session_start() line, it doesn't happen.  If I spit out
> the
> > session variables in the resulting page, they are echoed, but that's it -- 
> > it's a blank white page otherwise.
> >
> > The apache error log is silent, and the access log is normal.  No php
> errors
> > are displayed or written to the log.  Here's the real kicker -- if I
> refresh
> > the page, it loads correctly.  What is going on?
> >
> > Thank you,
> > --
> > Matt Grimm
> > Web Developer
> > The Health TV Channel, Inc.
> > (a non - profit organization)
> > 3820 Lake Otis Parkway
> > Anchorage, AK 99508
> > 907.770.6200 ext. 686
> > 907.336.6205 (fax)
> > E-mail: [EMAIL PROTECTED]
> > Web: www.healthtvchannel.org
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi all..

Now I have SAMS book for PHP and mySQL but in Arabic.. so now at the moment I only 
want to learn things which will help me in my project.. so which lessons must I see.. 
and which PHP Actions will I use for that?

I want to make a PHP page that reads from a mySQL Database.. This page displays two 
fields for the user : 1- Username. 2- Password.

Now in the database there are many columns.. each one has many fields :

Username, Password, Serial, Phone No., Address..Etc..

Now I want the PHP file to take the Username and Password after the user enter them in 
the fields and compare them with the ones inside the database.. if they are the same.. 
the serial field inside the database will send its value to the PHP page.. which will 
echo it as a variable ($var) there..

So every user has a column that has..

So which actions must I use.. and which lessons are important for me at the moment? 
because my project must be finnished in the comming week..

Thanks alot for you help in advance..

Cheers.

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

On 17 Jan 2004 at 21:28, SASSINC Internet Solutions -  wrote:

> Now I have SAMS book for PHP and mySQL but in Arabic.. so now at the
> moment I only want to learn things which will help me in my project..
> so which lessons must I see.. and which PHP Actions will I use for
> that? 

What do you mean "which actions"?
 
> I want to make a PHP page that reads from a mySQL Database.. This page
> displays two fields for the user : 1- Username. 2- Password. 
> 
> Now in the database there are many columns.. each one has many fields
> : 
> Username, Password, Serial, Phone No., Address..Etc.. 
> 
> Now I want the PHP file to take the Username and Password after the
> user enter them in the fields and compare them with the ones inside
> the database.. if they are the same.. the serial field inside the
> database will send its value to the PHP page.. which will echo it as a
> variable ($var) there.. 

Whatever do you want to do that for? What do you need (or want) to accomplish? What 
kind of project is this? Give us the big picture!

> So every user has a column that has.. 

That has...?? Your unfinished sentences presume telepathic powers that few of us 
have. :-)
 
> So which actions must I use.. and which lessons are important for me
> at the moment? because my project must be finnished in the comming week.

What exactly do you expect the people on this list to do for you? Help you with your 
project because you're running out of time? Most of us are very busy too, so take it 
nice 
and easy.

Have you opened the book that you've bought and had a look at its table of contents? 
Have you read the introduction? Authors usually tell you in the introduction which 
parts 
you absolutely must read to get up and running. Assuming that your book has a section 
on PHP, a section on MySQL and a section on PHP interacting with MySQL, you'll 
probably want to read the first few chapters in each section.

When you have a better idea of what it is that you want to accomplish and stumble on a 
problem that you can't solve, then by all means post a question to this list — 
preferably 
with a title that reflects the issue you're addressing, not the urgency of your 
personal 
needs.

Good luck,

Erik

--- End Message ---
--- Begin Message ---

Subject: Re: [PHP] Re: alternative to protecting files through http auth. From: Jason Wong <[EMAIL PROTECTED]> Date: Sat, 17 Jan 2004 05:08:29 +0800

To:
[EMAIL PROTECTED]


On Saturday 17 January 2004 04:03, Scott Taylor wrote:


>Alternately, if you aren't able to create directories or access files
>outside the DocumentRoot for your site, you can create an unbrowsable
>storage directory protected with a .htaccess file.  If the filesystem
>permissions are correct, your PHP script will be able to read content


>from that directory, because PHP code isn't subject to .htaccess rules.

It actually does not work.



Could you explain what, exactly, does not work?


I am trying to load a PDF file.  I've tried
to load it from a protected directory loading it with headers, but this
fails if the protection is on.  Does this make sense to you?



The above outlines a scheme which is workable. Could you describe the steps you took to implement said scheme which lead you to the conclusion that "It actually does not work" ?

Yes, sorry. Here is the code: $file = 'http://miningstocks.com/protected/archive/Dec03PostPress.pdf'; //now view the PDF file header("Content-Type: application/pdf"); header("Accept-Ranges: bytes"); header("Content-Length: ".filesize($file)); readfile($file); I can send the rest if necessary. You can see the results yourself of this: http://miningstocks.com/enteremail.php (just enter [EMAIL PROTECTED] for an email address). Yet, when I have changed the $file to hold a path that is not protected through http auth. it works perfectly fine and loads the file. Best Regards, Scott
--- End Message ---

Reply via email to