Re: [PHP] Documentation on features not in current release (SimpleXML PHP5 Beta 3)

2004-01-17 Thread Chris Shiflett
--- Jonathan [EMAIL PROTECTED] wrote:
 Where would I be able to find a function reference or documentation
 on new features that are not documented in the official manual?

Usually nowhere. Features that have yet to be documented are probably so
experimental, new, unfinished, or whatever, that documentation written now
would be wrong by the time those features are stable.

However, if you're just wanting to learn more about SimpleXML
specifically, Adam wrote a nice article about it yesterday. You can find
it here:

http://www.onlamp.com/pub/a/php/2004/01/15/simplexml.html

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



[PHP] Pdfs getting corrupted during upload

2004-01-17 Thread Binay
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


[PHP] HTML tags inside PHP??

2004-01-17 Thread SASSINC Internet Solutions - Arabic Department
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


Re: [PHP] HTML tags inside PHP??

2004-01-17 Thread Binay
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


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



RE: [PHP] dynamicly generating a transparent truecolor image

2004-01-17 Thread Mike Brum
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

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



[PHP] stdin from a pipe

2004-01-17 Thread Decapode Azur
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

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



Re: [PHP] spelling without aspell/pspell?

2004-01-17 Thread Lowell Allen
 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

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



[PHP] How to grab a value from the database?

2004-01-17 Thread SASSINC Internet Solutions - Arabic Department
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


[PHP] Re: Pdfs getting corrupted during upload

2004-01-17 Thread Bogdan Stancescu
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

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


[PHP] Thumbnails in database

2004-01-17 Thread Kevin Waterson
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



RE: [PHP] dynamicly generating a transparent truecolor image

2004-01-17 Thread Brian V Bonini
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.


-- 
BrianGnuPG - 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


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


Re: [PHP] Thumbnails in database

2004-01-17 Thread Daniel Guerrier
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

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



Re: [PHP] Image Header Issues

2004-01-17 Thread Brian V Bonini
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.


-- 
BrianGnuPG - 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


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


[PHP] Please reply as fast as possible..

2004-01-17 Thread SASSINC Internet Solutions - Arabic Department
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


Re: [PHP] Image Header Issues

2004-01-17 Thread Bob Eldred
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



Re: [PHP] Please reply as fast as possible..

2004-01-17 Thread Richard Davey
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,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] Thumbnails in database

2004-01-17 Thread Robert Cummings
 --- 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.  |
`'

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



Re: [PHP] Trying again: Random(?) blank pages when using sessions

2004-01-17 Thread memoimyself
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

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



[PHP] I bought SAMS PHP mySQL WEB DEVELOPMENT:)

2004-01-17 Thread SASSINC Internet Solutions - Arabic Department
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.


RE: [PHP] Image Header Issues

2004-01-17 Thread Larry Brown
try adding showpicture.php?pid=111384img=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



Re: [PHP] Re: alternative to protecting files through http auth.

2004-01-17 Thread Scott Taylor
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

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


Re: [PHP] Thumbnails in database

2004-01-17 Thread Mike Migurski
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/cahttp://mike.teczno.com/contact.html

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



Re: [PHP] Thumbnails in database

2004-01-17 Thread Kevin Waterson
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

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



Re: [PHP] I bought SAMS PHP mySQL WEB DEVELOPMENT:)

2004-01-17 Thread memoimyself
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

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



Re: [PHP] Image Header Issues

2004-01-17 Thread Toby Irmer
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=111384img=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


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



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

2004-01-17 Thread php-general-digest-help

php-general Digest 17 Jan 2004 22:11:38 - 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]


--
---BeginMessage---
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---
---BeginMessage---
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---
---BeginMessage---
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.


-- 
BrianGnuPG - 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


signature.asc
Description: This is a digitally signed message part
---End Message---
---BeginMessage---
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---
---BeginMessage---
 Hi,
 
 I just found a really nice set of javascripts for 

Re: [PHP] Thumbnails in database

2004-01-17 Thread Peter Vertes




On Sat, 2004-01-17 at 16:44, Kevin Waterson 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.


Kevin,

 I'm working on a web based photo gallery site which stores images in a MySQL database so you and I are working on something pretty similar. Like you I'm storing both the thumbnail (150x150) and a full sized image (768x512 or 512x768 depending on image orientation) in the database. You you could only store the full sized images in a database and resize them to thumbnails when they are needed but when you have 25 or more thumbnails to display on the same page resizing them on the fly pegs the CPU at 100% and if you have any other sites running on that same box they will experience a slow down too so that is why I opted to store the thumbnails in the database also. Disk space is very cheap and the thumbnails don't take too much space. Worse case scenario you can add another drive to the machine you are hosting the site on and presto, you have more disk space.
 In my web application I create the thumbnail and the full sized image all in one pass when a user uploads an image though a web page. Creating both the thumbnail and the full size images doesn't take that much CPU time. If I load in an image from my 2 megapixel digital camera (1600x1200) it will take 0.3 seconds on my 1.8GHz P4 to resize the image to a thumbnail and to a full sized image to be displayed in my web gallery.
 I don't know how to create an image in memory and write that to the database so I'm writing both the thumbnail and the full sized image out to my /tmp directory and then re-reading them into the database. At first I thought it might seem to be a bit inefficient but with this method I'm getting the 0.3s time to read in the original file, create a thumbnail, write it out to disk, read it into the database, create a full sized image, write it out to disk, read it into the database so I'm pretty happy with it. The code goes something like this:

---

// read in the image file from the disk that needs to be resized and uploaded
$image_original = ImageCreateFromJpeg($path_to_image_file_on_disk);

// allocate memory for the thumbnail image
$image_thumbnail = ImageCreateTrueColor($thumbnail_width, $thumbnail_height);

// copy and resize the original image into the thumbnail memory we have allocated
ImageCopyResized($image_thumbnail, $image_original, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, imagesx($image_original), imagesy($image_original));

// save the newly created thumbnail to disk
ImageJpeg($image_thumbnail, $path_to_save_thumbnail_image, 100);

// open up the thumbnail file for reading and then encode it with MIME Base64
$thumbnail_contents = base64_encode(fread(fopen($path_to_read_thumbnail_from, rb), filesize($path_to_read_thumbnail_from)));

// delete the thumbnail file from the disk
unlink($path_to_read_thumbnail_from);

// deallocate memory used to create our original and thumbnail images
ImageDestory($image_original);
ImageDestory($image_thumbnail);

---

 You do the same thing for the full sized image you want to store in the database as well but you have to make sure you get the image's orientation right otherwise your resize will give you a hard time. When it's time to insert the images into the database for the thumbnail you will insert $thumbnail_contents and whatever else variable you chose for the full sized image. One thing to watch out for is that when you read the images from the database you want to use base64_decode() on them. Hope this works out for you. If you need more help give me a shout.

-Pete




-- 
perl -e 'print pack(H*, 70766572746573406E79632E72722E636F6D0A)'








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


Re: [PHP] Thumbnails in database

2004-01-17 Thread Toby Irmer
http://www.sum-it.nl/en200319.php3

quote
Create thumbnail
  a.. Cropping and scaling a photo is surprisingly easy with PHP.
  b.. Unfortunately the functions imagecreatetruecolor() and
imagecopyresampled() exist only since PHP 4.0.6 using GD 2.0.1. Older PHP
version supports the functions imagecreate() and imagecopyresized(), which
are good enough to do the job.
  c.. It is possible to generate a thumbnail on the fly, in RAM memory,
using ob_start() and ob_end_clean(). That saves unnecessary fumbling around
with temporary files.
  d.. ...

/quote

hth

toby


 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



Re: [PHP] Thumbnails in database

2004-01-17 Thread Jason Sheets
The latest version of GD adds support for opening an image from a 
pointer to the C/C++ API but that support is not in PHP.

It is recommended to create the thumbnail on file upload using the 
$_FILES array to get the temporary file name, if you need to create a 
thumbnail from a file only in the database you need to read it, write it 
to a temporary file and then resize it, then do your action with it.

Look at tempnam() , it will generate a temporary file name for you to open.

Jason

Kevin Waterson 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


[PHP] Win32 Getting username from windows

2004-01-17 Thread Gastovski \(James\)
I'm using the following code to extract the username running on the windows
machine:

[start code]
$api = new win32;
$api-registerfunction(long GetUserName (string a, int b) From
advapi32.dll);
$len = 255;
$name = str_repeat(\0, $len);
if ($api-GetUserName($name, $len) == 0)
{
   die(failed);
}
[end code]

However when I 'echo ($name);' I get the value SYSTEM. This is correct,
because advapi32.dll is probably being run by SYSTEM user on windows.
However I need to get the name of the person logged onto the computer, not
the SYSTEM running processes in the background. Is there any way of doing
this?

Many Thanks - James Gastovski

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.553 / Virus Database: 345 - Release Date: 18/12/2003
 

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



Re: [PHP] Thumbnails in database - SOLUTION

2004-01-17 Thread Kevin Waterson
This one time, at band camp, Kevin Waterson [EMAIL PROTECTED] wrote:

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

Ok, so the secret here is output buffering

 // prepare the image for insertion
 $imgData =addslashes (file_get_contents($_FILES['userfile']['tmp_name']));
 // do not use addslashes yet
$thumbData = $_FILES['userfile']['tmp_name'];
// get the image info..
$size = getimagesize($_FILES['userfile']['tmp_name']);
// database connection
mysql_connect(localhost, $dbusername, $dbpassword) OR DIE 
(mysql_error());
// select the db
mysql_select_db ($dbname) OR DIE (Unable to select db.mysql_error());

// create the thumbnail
$height   = '50'; // the height of the thumbnail
$width= '50'; // the width of the thumbnail
// snarf the thumbdata
$src = ImageCreateFromjpeg($thumbData);
// create the thumbnail
$destImage = ImageCreateTrueColor($height, $width);
// copy the resize/resampled image to the destImage
ImageCopyResampled($destImage, $src, 0,0,0,0, $width, $height, $size[0], 
$size[1]);
// start the output buffering
ob_start();
// pretend to send the image to the browser
imageJPEG($destImage);
// stick the output buffer in a variable
$photo_thumb = ob_get_contents();
// now we can addslashes for inserting into the db
$photo_thumb = addslashes($photo_thumb);
// tidy up a little
ob_end_clean();

   $sql = INSERT INTO phototable ( photo_id, photo_cat, photo_type ,photo_thumb, 
photo_data, photo_size, photo_name) VALUES ('', 'cat', '{$size['mime']}', 
'{$photo_thumb}', '{$imgData}', '{$size[3]}', '{$_FILES['userfile']['name']}');
   
  
// insert the image
   mysql_query($sql)

Easy as that! You do not need to create the file on the filesystem as some have 
suggested,
or use ImageCreateFromString() and pull the original out of the db. It can all be done 
in
one dastardly sweep.

Thanks to all
Kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

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



RE: [PHP] Image Header Issues

2004-01-17 Thread Larry Brown
Since putting .jpg solved the problem for me, I'm ok with that work around,
but you're right.  I'm using session_start() on all of my scripts.  That's
also good to know that it doesn't fail without that function so I have a
better idea of where to look, the next time I have header problems.

Thanks

Larry

-Original Message-
From: Toby Irmer [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 17, 2004 5:12 PM
To: Larry Brown; Bob Eldred; PHP List
Subject: Re: [PHP] Image Header Issues


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=111384img=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


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



Re: [PHP] Win32 Getting username from windows

2004-01-17 Thread John W. Holmes
Gastovski (James) wrote:

I'm using the following code to extract the username running on the windows
machine:
[start code]
$api = new win32;
$api-registerfunction(long GetUserName (string a, int b) From
advapi32.dll);
$len = 255;
$name = str_repeat(\0, $len);
if ($api-GetUserName($name, $len) == 0)
{
   die(failed);
}
[end code]
However when I 'echo ($name);' I get the value SYSTEM. This is correct,
because advapi32.dll is probably being run by SYSTEM user on windows.
However I need to get the name of the person logged onto the computer, not
the SYSTEM running processes in the background. Is there any way of doing
this?
Try $_SERVER['LOGON_USER']. With IIS, you will need to disable anonymous 
access.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


Re: [PHP] Re: alternative to protecting files through http auth.

2004-01-17 Thread Jason Wong
On  18 [EMAIL PROTECTED] 2004 01:59, Scott Taylor wrote:

 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're telling PHP to get the file using HTTP, thus subjecting it to Apache's 
protection mechanism.

You need to get the file via the filesystem:

  readfile('/local/path/to/file.pdf');

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The absence of labels [in ECL] is probably a good thing.
-- T. Cheatham
*/

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



Re: [PHP] Justin is a genius

2004-01-17 Thread Justin French
On Friday, January 16, 2004, at 11:57  PM, Robert Temple wrote:

In particular, Justin French solved the problem with just a few lines 
of code - the sign of a true genius. Thanks again, Justin!
LMFAO -- that's two compliments off this list in a few days... I should 
start a consultancy :P

Justin French

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


[PHP] POST method for hyperlink

2004-01-17 Thread Joe Harman
Hello,

I am curious if there is anyway to take a variable that is passed via a
URL by a reguler text hyperlink

Ex: http://localhost/Calendar/active_layout.php?d=2.1.2004

and hide it like you would do with the POST method using forms

Ex: http://localhost/Calendar/active_layout.php

Hidden or POSTed part: d=2.1.2004

It seems like I saw some WML code that did something like this

Thanks in advance,
Joe

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



[PHP] help with form

2004-01-17 Thread eawilkes
I'm creating a form that puts data into two different tables in the
database.  I was wondering how to get the ID from the first table and, in
the background, associate it with the second table?

any help is GREATLY appreciated!

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



Re: [PHP] help with form

2004-01-17 Thread daniel
 I'm creating a form that puts data into two different tables in the
 database.  I was wondering how to get the ID from the first table
 and, in the background, associate it with the second table?

 any help is GREATLY appreciated!


Firstly you never said which db ? I'll assume mysql, check out
mysql_insert_id


 --
 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



Re: [PHP] help with form

2004-01-17 Thread Justin French
On Sunday, January 18, 2004, at 01:39  PM, eawilkes wrote:

I'm creating a form that puts data into two different tables in the
database.  I was wondering how to get the ID from the first table 
and, in
the background, associate it with the second table?

any help is GREATLY appreciated!
Check out mysql_insert_id() -- there's an example in the manual of how 
to determine what was the ID of the row you just inserted.

http://www.php.net/mysql_insert_id

FYI, this page was easy to find searching the PHP manual functions for 
mysql id -- perhaps a timely reminder that you should search the 
manual before posting a question???

Come back if you need more help after that.

Justin French

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


Re: [PHP] POST method for hyperlink

2004-01-17 Thread Richard Davey
Hello Joe,

Sunday, January 18, 2004, 3:26:18 AM, you wrote:

JH I am curious if there is anyway to take a variable that is passed via a
JH URL by a reguler text hyperlink

JH Ex: http://localhost/Calendar/active_layout.php?d=2.1.2004

JH and hide it like you would do with the POST method using forms

Not really, no. One solution might be to use mod_rewrite on Apache so
at least it could look like:

http://localhost/Calendar/active_layout/d/2.1.2004

(or something like that).

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



RE: [PHP] POST method for hyperlink

2004-01-17 Thread Joe Harman
Thanks Richard... I will do some erading on that

Cheers!
Joe

-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 17, 2004 11:08 PM
To: Joe Harman
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] POST method for hyperlink


Hello Joe,

Sunday, January 18, 2004, 3:26:18 AM, you wrote:

JH I am curious if there is anyway to take a variable that is passed 
JH via a URL by a reguler text hyperlink

JH Ex: http://localhost/Calendar/active_layout.php?d=2.1.2004

JH and hide it like you would do with the POST method using forms

Not really, no. One solution might be to use mod_rewrite on Apache so at
least it could look like:

http://localhost/Calendar/active_layout/d/2.1.2004

(or something like that).

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] Image Header Issues

2004-01-17 Thread Bob Eldred
OK, that's it.  The session_start() is the issue.  Unfortunately, the
img=x.jpg didn't help.

Now I've got to figure out some sorta security without using sessions.

Thanks, for at least pointing me in the right direction.  Now if we could
figure out why this would be happening, that would be great.

Bob

- Original Message - 
From: Toby Irmer [EMAIL PROTECTED]
To: Larry Brown [EMAIL PROTECTED]; Bob Eldred
[EMAIL PROTECTED]; PHP List [EMAIL PROTECTED]
Sent: Saturday, January 17, 2004 2:11 PM
Subject: Re: [PHP] Image Header Issues


 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=111384img=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
 



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



[PHP] Troubles Accessing Global Variables

2004-01-17 Thread Adelaide Yip

 Hi,

 I'm having troubles accessing the global variables.  From my understanding
 of PHP, when you declare a variable 'global' it is no longer just in the
 local scope, but becomes known in the global scope of the program.

 In file, 'layout.php' ...
 function top_sidebar_header() {
 global $g_graphic;
 echo $g_graphic;
 }

 In file, 'body.php' ...
 include_once( $GLOBALS[DOCUMENT_ROOT] . /include/layout.php );
 top_sidebar_header();// function is called, but when echo
 $g_graphic is executed,
 // nothing prints out because
 $g_graphic is empty or 

 In file, 'about/index.php' ...
 $g_graphic = /media/image.jpg;
 include_once( $GLOBALS[DOCUMENT_ROOT] . /body.php );

 Have I overlooked something crucial?

 I haven't been able to find much documentation on this topic.  (Please
keep
 in mind that I am also a newbie at PHP.  :) )  ~ It'd be really great if
any
 of you have suggestions on this.

 Thanks in advance,
 Adelaide


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



[PHP] Troubles Accessing Global Variables

2004-01-17 Thread Adelaide Yip
Hi,

I'm having troubles accessing the global variables.  From my understanding
of PHP, when you declare a variable 'global' it is no longer just in the
local scope, but becomes known in the global scope of the program.

In file, 'layout.php' ...
function top_sidebar_header() {
global $g_graphic;
echo $g_graphic;
}

In file, 'body.php' ...
include_once( $GLOBALS[DOCUMENT_ROOT] . /include/layout.php );
top_sidebar_header();// function is called, but when echo
$g_graphic is executed,
// nothing prints out because
$g_graphic is empty or 

In file, 'about/index.php' ...
$g_graphic = /media/image.jpg;
include_once( $GLOBALS[DOCUMENT_ROOT] . /body.php );

Have I overlooked something crucial?

I haven't been able to find much documentation on this topic.  (Please keep
in mind that I am also a newbie at PHP.  :) )  ~ It'd be really great if any
of you have suggestions on this.

Thanks in advance,
Adelaide

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



Re: [PHP] Justin is a genius

2004-01-17 Thread Ryan A
Hey,

Only problem with that idea is most of the people who ask for help here
are broke SOBs like me :-)

Cheers,
-Ryan

On 1/18/2004 4:11:21 AM, Justin French ([EMAIL PROTECTED]) wrote:
 On Friday, January 16, 2004, at 11:57  PM, Robert Temple wrote:
 
  In particular, Justin French solved the problem with just a few lines
  of code - the sign of a true genius. Thanks again, Justin!
 
 LMFAO -- that's two compliments off this list in a few days... I should
 start a consultancy :P
 
 Justin French
 
 --
 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



RE: [PHP] Image Header Issues

2004-01-17 Thread Larry Brown
Giving up sessions for one simple issue sounds a bit drastic.  I'll dig up
the header information I'm sending that the x.pdf addition helped me with
and send them to you if you'd like.  I can't see anything as strong/secure
as sessions to manage authentication as well as a dozen other performance
benefits.

Larry.

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


OK, that's it.  The session_start() is the issue.  Unfortunately, the
img=x.jpg didn't help.

Now I've got to figure out some sorta security without using sessions.

Thanks, for at least pointing me in the right direction.  Now if we could
figure out why this would be happening, that would be great.

Bob

- Original Message -
From: Toby Irmer [EMAIL PROTECTED]
To: Larry Brown [EMAIL PROTECTED]; Bob Eldred
[EMAIL PROTECTED]; PHP List [EMAIL PROTECTED]
Sent: Saturday, January 17, 2004 2:11 PM
Subject: Re: [PHP] Image Header Issues


 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=111384img=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
 



--
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



[PHP] Drop down lists

2004-01-17 Thread BigMark
Is it possible to have usernames from my db populated  into a drop down
list.
If so What and where does it go to make it all work, ive tried everything i
know
( which is not much by the way).

Mark

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