[PHP] ftp file exists

2002-11-08 Thread Fifield, Mike
How do you check if a file exists a remote ftp site. 




RE: [PHP] Dynamic HTML Email

2002-09-20 Thread Fifield, Mike

$header .= MIME-Version: 1.0\r\n;
$header .= Content-Type: text/html; charset=iso-8859-1\r\n;
$header .= From: $sender_email\r\n;

mail($rcpt_email, $subject, $msg, $header);

This works it is what I use.




-Original Message-
From: Mike Dunlop [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 20, 2002 2:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Dynamic HTML Email

Hello,

I am wondering how it would be possible to generate an html response 
email via a PHP script. I have tried and all that has happened is the 
html source code appears in the message body as plain text. I believe 
this is happening because the email needs an additional header 
stating the email needs to be parsed as html not plain text (or both).

I am using the mail command.

Can someone shed some light on the subject for me???

Thanks so much in advance!
Mike Dunlop



-- 
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] Image resizing

2002-09-06 Thread Fifield, Mike

I have been trying to figure out the best way to resize photo quality images
to thumbnail size and have them come out looking good. I have read about the
function  http://www.php.net/manual/en/function.imagecreatetruecolor.php
imagecreatetruecolor() and it looks like it may do this. However I do not
have GD 2 installed which is required for this function to work. In the
process of trying to figure out how to install GD v2 I came across the
following page. 

http://www.php.net/manual/en/ref.image.php
http://www.php.net/manual/en/ref.image.php 

On this page is says;

 

 Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled
version has some additional features like alpha blending and should be used
in preference to the external library since it's codebase is better
maintained and more stable.

 

I thought the most recent version of php was 4.2.2? 

 

Anyway if there is a better way to resize images to create high quality
thumbnails I would love to hear about it. I am on a redhat 7.3 server and
not very familiar with linux. I would prefer not to have to take the time
involved in learning how to install new packages right now, but realize this
may be unavoidable. 

 

Thanks in advance for any help.

 

 

 

 

 




[PHP] Image Resizing ... lets try this again.

2002-09-06 Thread Fifield, Mike

I sent this email out earlier this morning and got no response. It was quite
early so I thought I would send it again now that more people are hopefully
at work :-)

 

 

I have been trying to figure out the best way to resize photo quality images
to thumbnail size and have them come out looking good. I have read about the
function  http://www.php.net/manual/en/function.imagecreatetruecolor.php
http://www.php.net/manual/en/function.imagecreatetruecolor.php 

imagecreatetruecolor() and it looks like it may do this. However I do not
have GD 2 installed which is required for this function to work. In the
process of trying to figure out how to install GD v2 I came across the
following page. 

 

http://www.php.net/manual/en/ref.image.php
http://www.php.net/manual/en/ref.image.php 

http://www.php.net/manual/en/ref.image.php
http://www.php.net/manual/en/ref.image.php  

 

On this page is says;

 

 

 

 Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled
version has some additional features like alpha blending and should be used
in preference to the external library since it's codebase is better
maintained and more stable.

 

 

 

I thought the most recent version of php was 4.2.2? 

 

 

 

Anyway if there is a better way to resize images to create high quality
thumbnails I would love to hear about it. I am on a redhat 7.3 server and
not very familiar with linux. I would prefer not to have to take the time
involved in learning how to install new packages right now, but realize this
may be unavoidable. 

 

 

 

Thanks in advance for any help.

 

 

 

 

 

 

 

 

 

 

 

 

 




[PHP] check for a number

2002-09-04 Thread Fifield, Mike

I am using  

substr($f, 0, 1); 

to get the first character of a string but what to be able to tell if the
first character is a digit or a letter is there a way to do this?

 

 




[PHP] mysql_query() ERROR

2002-08-21 Thread Fifield, Mike

This is a query that I am sending to mysql. The problem is that sometimes in
the variable $message characters like ) will get posted and when they do
it makes mysql die. I can only assume that mysql thinks that the ) in the
$message variable is meant to close the sql query, but I am having trouble
figuring out how to avoid this. I suppose I could use a regex to replace all
special characters with something more sql friendly but I am hoping there is
a better way to do this. Thanks for any help.  

 

mysql_query(insert into guestbook
(gb_entry_id,date,name,email,website_name,website_url,message) values
('',CURDATE(),'$name','$email','$website_name','$website_url','$message'))
or die (mysql_error());






[PHP] php 4.2.2 on redhat 7.3

2002-07-26 Thread Fifield, Mike

I am trying to figure out how to upgrade php from 4.1.2 (which is the
default that comes with redhat 7.3), to version 4.2.2. From the small amount
of documentation I have been able to find on the subject, it looks like I
need to download a rpm. Is this the best way to do it or would it be better
to try to use the install files off of php.net, and if the php.net install
files are the way to go, how would I go about installing them over the
current copy of php. I know this may not be the proper list for this
question but I am also sending this email to the redhat list in hopes that
someone from one of these two lists can point me in the right direction. 
 
Thanks in advance for any help. 
 
 
Mike Fifield
Charles Schwab  Co, Inc.
WARNING: All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.
 



RE: [PHP] INCLUDE vs Functions

2002-06-27 Thread Fifield, Mike

I cannot answer this for sure but my guess would be that having separately
included files would be faster. There are two reasons for this. First
functions are almost always slower then regular php code. Second you will be
loading the entire Routines.php on every page even if you only require one
of the functions.

-Original Message-
From: Jeff Gannaway [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 27, 2002 10:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP] INCLUDE vs Functions

I'm re-writing a medium-sized commercial site in PHP.  There will be 
elements that will on nearly every page.  I was considering writing each 
element as a program and then using INCLUDE statements wherever I wanted 
that element displayed.  Now I'm wondering if grouping all those elements 
into 1 file and defining them as functions would save on system resources 
and improve speed.

In other words is
?
include Menu.php;
include Ads.php;
include Headlines.php;
?

More or less efficient than...
?
include Routines.php;
Menu();
Ads();
Headlines();
?

Thanks,
Jeff Gannaway
It's a feeling of fresh opportunity. You're placed in a position a lot of 
times where not only you're wanted, but where God feels you're needed.

-Jalen Rose on being traded to the Bulls


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

2002-06-04 Thread Fifield, Mike

Correction Redhat7 :-) Got it working thanks for all the help!

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, June 04, 2002 9:36 AM
To: Fifield, Mike; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP_AUTH_USER 

 I have a bunch of pages on my site inside an apache .htaccess protected
 directory. After visitors have logged in I am on part of my site I need to
 find out which user it is that has logged in. I thought this information
was
 stored in the $PHP_AUTH_USER variable, but when I print this variable it
is
 empty. Does anyone know of way to tell on apache 7 how to tell with php
who
 is logged in?

PHP might not be very stable with apache 7... :)

What version of PHP are you using? Try using the variable
$_SERVER['PHP_AUTH_USER'] or $HTTP_SERVER_VARS['PHP_AUTH_USER']. If it's not
in _SERVER, someone please correct me.

---John Holmes...

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




RE: [PHP] PHP_AUTH_USER

2002-06-04 Thread Fifield, Mike

The information is stored in the $PHP_AUTH_USER variable but only appears to
be accessible while you are viewing a page that is protected by that
.htaccess file. To make it available to other pages I assigned
$PHP_AUTH_USER to a session variable. :o) 



-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, June 04, 2002 10:48 AM
To: Fifield, Mike
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP_AUTH_USER 

And the solution was? remember, other people actually search the archives
before they post, so giving the solution to your problem will help those
people out. (Even if it was something simple)

---John Holmes...

- Original Message -
From: Fifield, Mike [EMAIL PROTECTED]
To: '1LT John W. Holmes' [EMAIL PROTECTED]; Fifield, Mike
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, June 04, 2002 12:19 PM
Subject: RE: [PHP] PHP_AUTH_USER


 Correction Redhat7 :-) Got it working thanks for all the help!

 -Original Message-
 From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 04, 2002 9:36 AM
 To: Fifield, Mike; [EMAIL PROTECTED]
 Subject: Re: [PHP] PHP_AUTH_USER

  I have a bunch of pages on my site inside an apache .htaccess protected
  directory. After visitors have logged in I am on part of my site I need
to
  find out which user it is that has logged in. I thought this information
 was
  stored in the $PHP_AUTH_USER variable, but when I print this variable it
 is
  empty. Does anyone know of way to tell on apache 7 how to tell with php
 who
  is logged in?

 PHP might not be very stable with apache 7... :)

 What version of PHP are you using? Try using the variable
 $_SERVER['PHP_AUTH_USER'] or $HTTP_SERVER_VARS['PHP_AUTH_USER']. If it's
not
 in _SERVER, someone please correct me.

 ---John Holmes...

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




[PHP] PHP_AUTH_USER

2002-06-04 Thread Fifield, Mike

I have a bunch of pages on my site inside an apache .htaccess protected
directory. After visitors have logged in I am on part of my site I need to
find out which user it is that has logged in. I thought this information was
stored in the $PHP_AUTH_USER variable, but when I print this variable it is
empty. Does anyone know of way to tell on apache 7 how to tell with php who
is logged in?
 
 
Mike Fifield
Charles Schwab  Co, Inc.
WARNING: All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.
 



[PHP] sum

2002-05-06 Thread Fifield, Mike

I am using the mysql sum() function to return the sum of a bunch of dolor
amounts stored  float values. But what I get back it something like this
98.18855591 it is to precise. All I want is the dolor amounts added up
and rounded up to the closest penny. Is there a better value type to use or
a function that will return the information properly formatted. 
 
Mike Fifield
Charles Schwab  Co, Inc.
WARNING: All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.
 



[PHP] sessions

2002-04-26 Thread Fifield, Mike

Is there a way to return the total number of sessions currently registered
on a server?
 
 



[PHP] authentication

2002-04-23 Thread Fifield, Mike

I have one directory that is protected with an .htaccess file on my server
where I store all member content. What I want to do is have a page where
members can log in, and after they have entered there user name and password
I what the php script to authenticate them against the .htaccess file. If
they are authenticated I would like to keep track of that as one of there
session variables, so that they do not have to re-authenticate when they try
to access content in the protected directory. Essentially what I am trying
to do is give them access to the .htaccess protected based from a submit
form. Instead of requiring that they get the standard user name and
password pop up window that one gets when you try to access a directory that
is password protected on Apache. 
 
 
 



RE: [PHP] If else question

2002-04-23 Thread Fifield, Mike

Have you checked the obvious, that the condition of the if statement is
actually being met? I mean are you sure that $var is returning greater then
1? 


-Original Message-
From: Jennifer Downey [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 23, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] If else question

No this is the first if statement but there are nested if's after that. I'd
post the code but everyone yells at me about my coding style.
If you promise not to yell I will post it.

Jennifer
-Bd- [EMAIL PROTECTED] wrote in message
001d01c1eae9$d58f4360$[EMAIL PROTECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]...
 Is this a nested if? (inside another if statement?)




 - Original Message -
 From: Jennifer Downey [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, April 23, 2002 1:05 PM
 Subject: Re: [PHP] If else question


 
  I just looked at my hosting service thinkg it may have been because they
  just upgraded to 4.1 php. so I dumped my database and loaded it to my
  machine at home and find that it does the same thing.
 
  I have 4.06 php on win me my hosting service is 4.1 php on redhat linux
so
  I'm thinking that is not the case.
 
  I have used this code through out my site and this is the only part it
 does
  this on and I am not understanding why.
 
  Jennifer
 
 
 
 
  Natalie Leotta [EMAIL PROTECTED] wrote in message
  7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC4@SSIMSEXCHNG...
   My officemate and I talked about this and the only thing he could come
 up
   with was a possible problem with your parser.  Are you using a beta
  version
   or something unusual?  I don't know if you have a way to know this -
the
   programmers didn't set up PHP where I work, but I know our web server
is
   apache and it's on a unix box.  I've never run into this problem
before.
   Have you had it happen in other programs?  Have you ever used this
code
 in
   another program?  If it's consistently incorrect then it may be a
 problem
   with your parser.  That's not really my area of expertise, but it's
   something you could look into if no one else has any better ideas :-)
  
   -Natalie
  
   -Original Message-
   From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, April 23, 2002 12:26 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] If else question
  
  
   It shows both.
  
   Natalie Leotta [EMAIL PROTECTED] wrote in message
   7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024ABFC3@SSIMSEXCHNG...
Does it show the message and the form or just the message?
   
-Natalie
   
-Original Message-
From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 12:23 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] If else question
   
   
   
 If and else expect to be followed by exactly 1 statement. To
 aggregate multiple statements as one, surround them with {curly
 braces}. I'm guessing you didn't do that, and you're seeing the
 execution of all but the first of the statements following the
else.

 So it should be:

   if ($var1)
 echo can't be found;
   else
   {
 echo first line of form;
 echo second line of form;
   }
This is what I have:
   
if($quantity  1)
{
echo Sorry I can't seem to locate this item;
}
else
{
do this
}
So yes I have done exactly as you have stated and it still shows the
form.
   
Jennifer
   
   
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
  
  
   ---
   Outgoing mail is certified Virus Free.
   Checked by AVG anti-virus system (http://www.grisoft.com).
   Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002



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

2002-04-23 Thread Fifield, Mike

If you go to a site that has a password protected directory and you access a
file in that directory, you have to enter your user name and password. After
you have entered your user name and password, as long as you keep the
browser window open you can navigate to any other file that is in the
password protected directory. I can only assume that some sort of session
has been started that allows you to do this with out having to keep
re-authenticating. What I need to be able to do is start this session and
authenticate the user with out actually having them log in via the pop up
window. I would think that there should be some way of doing this. I thought
of writing a include statement that looked something like this.
Include(http://username:[EMAIL PROTECTED]/members/); which I believe
would work but it seems like kind of a ugly way of doing it. If it is a
session that is keeping track of authenticated users, is there some way of
initiating via a script? I hope this makes it a little more clear as to what
I am trying to accomplish. Thanks in advance for any help. 

Mike 

-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 23, 2002 1:18 PM
To: Morten Ronseth
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] authentication 

On Tue, 23 Apr 2002, Morten Ronseth wrote:
 Anybody know how to revoke the HTTP authentication, i.e. log people out,
 using PHP?

With most browsers, you can send HTTP status 401 and re-send your realm in 
the WWW-Authenticate header. The browser will assume its cached 
credentials have become invalid and toss them, asking the user once again 
to log in.

It's still a little awkward, and is one more reason why using 
session/cookie-based auth is much friendlier.

miguel


-- 
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: Backup of MySQL database

2002-04-22 Thread Fifield, Mike

I think everyone is aware that there is a mysql manual, obviously if someone
is posting in this forum they have not been able to find what they are
looking for in the manual. Or simply do not have to time to wade through the
manual to find what they are looking for. 

Here is a link to a script that does essentially what you are looking for.
http://www.zend.net/codex.php?id=634single=1


-Original Message-
From: Julio Nobrega Trabalhando [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 6:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Backup of MySQL database

 Can anybody explain me how to do the backup?

  Mysql's manual?

 I want to make a script to do a backup of a MySQL DB and email me it. It
is
 posible?

  Then you take the backup (aka Mysql's dump), and attach it to a mail();


--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Julian [EMAIL PROTECTED] wrote in message
005601c1e9fb$7bc42600$45102bc8@julian">news:005601c1e9fb$7bc42600$45102bc8@julian...
 Hi list!!!

 I want to make a script to do a backup of a MySQL DB and email me it. It
is
 posible?

 Can anybody explain me how to do the backup?

 Thanks! Julian




-- 
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: Backup of MySQL database

2002-04-22 Thread Fifield, Mike

I agree it is annoying to see someone ask a question when it doesn't look
like they even tried to find the answer on there own. We just have to
remember that we have all been in the situation where we new so little about
a subject that we didn't even know were to begin to look. 

When a beginner posts a question on the forum, it only takes a couple of
seconds to read the question. On the other hand if you choose to respond to
every under researched question with useless information such as RTFM that
takes more of your time. As well as more time from everyone else who reads
your response. So really by responding with an answer that does not answer
anything is adding to the problem.

Not really that big of a deal though, just my opinion :o) 

Regards

Mike


-Original Message-
From: Julio Nobrega Trabalhando [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 7:27 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Backup of MySQL database

 I think everyone is aware that there is a mysql manual, obviously if
someone
 is posting in this forum they have not been able to find what they are
 looking for in the manual. Or simply do not have to time to wade through
the
 manual to find what they are looking for.

  Hi Mike, I am not trying to start another flame war on this subject. But I
could have been harsh and just replied RTFM, which was the perfect case
for this. I don't like to answer simple questions, that the poster didn't
look like searched enough for the answer. I am, and I believe you are, busy
men.

  We're here to do the best we can, to help other people, but I believe we
also expect others to act at the same level. When I see a message here,
makes me wonder that the poster has searched for the answer on his own, has
tried, has fought to overcome a problem. A google search, a manual word
search, would give the poster the answer quickly than it took for him to
type his message. Probaly saving not only the original poster, but everyone
who downloaded and read the message, plus who whatever replied.

  Again, this is one of the oldest wars that can be fought in any
newsgroups, but I couldn't not let it pass without brief comments of what is
usually expected in such enviroments :-)

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Mike Fifield [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I think everyone is aware that there is a mysql manual, obviously if someone
is posting in this forum they have not been able to find what they are
looking for in the manual. Or simply do not have to time to wade through the
manual to find what they are looking for.

Here is a link to a script that does essentially what you are looking for.
http://www.zend.net/codex.php?id=634single=1


-Original Message-
From: Julio Nobrega Trabalhando [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002 6:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Backup of MySQL database

 Can anybody explain me how to do the backup?

  Mysql's manual?

 I want to make a script to do a backup of a MySQL DB and email me it. It
is
 posible?

  Then you take the backup (aka Mysql's dump), and attach it to a mail();


--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Julian [EMAIL PROTECTED] wrote in message
005601c1e9fb$7bc42600$45102bc8@julian">news:005601c1e9fb$7bc42600$45102bc8@julian...
 Hi list!!!

 I want to make a script to do a backup of a MySQL DB and email me it. It
is
 posible?

 Can anybody explain me how to do the backup?

 Thanks! Julian




--
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] MySql query

2002-04-19 Thread Fifield, Mike

Ok this could be the wrong place to ask this but there seems to be some
people in here that know mysql quite well. 
My question is this; I have a database that looks like this. 
galleries

gallery_id
gallery_name

 1
3d

2
fractals

3
abstract

4
cats

5
cars
 
Images

image_id
gallery_id
image_name
etc

1
4
cat1
 

2
4
cat2
 

3
2
sky
 

4
2
blue
 

5
5
car1
 
 
I am trying to run a SQL query that will return an array of rows from the
images table. But I want the gallery_id number to be replaced with the
actual gallery name from the galleries table. 
 
 



RE: [PHP] MySql query

2002-04-19 Thread Fifield, Mike

Ok the formatting got lost on that I will try this again. 


-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 19, 2002 8:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] MySql query

Ok this could be the wrong place to ask this but there seems to be some
people in here that know mysql quite well. 
My question is this; I have a database that looks like this. 


galleries
gallery_id gallery_name
1   3d
2   fractals
3   abstract
4   cats
5   cars
 
Images
image_idgallery_id  image_name  etc
1   4   cat1
2   4   cat2
3   2   sky
4   2   blue
5   5   car1
 
 
I am trying to run a SQL query that will return an array of rows from the
images table. But I want the gallery_id number to be replaced with the
actual gallery name from the galleries table.

-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 19, 2002 8:57 AM
To: [EMAIL PROTECTED]
Subject: [PHP] MySql query

Ok this could be the wrong place to ask this but there seems to be some
people in here that know mysql quite well. 
My question is this; I have a database that looks like this. 
galleries

gallery_id
gallery_name

 1
3d

2
fractals

3
abstract

4
cats

5
cars
 
Images

image_id
gallery_id
image_name
etc

1
4
cat1
 

2
4
cat2
 

3
2
sky
 

4
2
blue
 

5
5
car1
 
 
I am trying to run a SQL query that will return an array of rows from the
images table. But I want the gallery_id number to be replaced with the
actual gallery name from the galleries table. 
 
 

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




RE: [PHP] Images don't save

2002-04-18 Thread Fifield, Mike

Actually you can do this if all you are trying to do is disable right
clicking. If you are thinking this will stop people from getting your
pictures this is not the case. When a picture is viewed by someone it is
downloaded to there comp first. No way to disable this. 
To disable right clicking you would have to do it with java. 

-Original Message-
From: Gunther E. Biernat [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 18, 2002 12:17 PM
To: [EMAIL PROTECTED]; 'Php-General (E-mail)
Subject: Re: [PHP] Images don't save

You can't. Period. Simple as that. 
Oh, and BTW, it's not even a PHP question...


On Thu, 18 Apr 2002 20:10:13 +0200, Manu Verhaegen wrote:

Hi,
You can right click on a image on your browser and choose save.
I want to disable this option, how can i do this




Greetings,
   Manu


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


Regards,

Gunther E. Biernat



-- 
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] Images don't save

2002-04-18 Thread Fifield, Mike

This is not PHP so does not really belong here but since you asked. Here is
a java script that will disable right clicking and display a copyright. 

Script language='Javascript'
!--
var message='Copyright (c) 1999 Sakki.';
function click(e) {
 if (document.all) {
  if (event.button == 2) {
   alert(message);
return false;
 }}
 if (document.layers) {
 if (e.which == 3) {
   alert(message);return false;
}}}
if (document.layers) {
 document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --/script



-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 18, 2002 12:21 PM
To: 'Gunther E. Biernat'; [EMAIL PROTECTED]; 'Php-General (E-mail)
Subject: RE: [PHP] Images don't save

Actually you can do this if all you are trying to do is disable right
clicking. If you are thinking this will stop people from getting your
pictures this is not the case. When a picture is viewed by someone it is
downloaded to there comp first. No way to disable this. 
To disable right clicking you would have to do it with java. 

-Original Message-
From: Gunther E. Biernat [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 18, 2002 12:17 PM
To: [EMAIL PROTECTED]; 'Php-General (E-mail)
Subject: Re: [PHP] Images don't save

You can't. Period. Simple as that. 
Oh, and BTW, it's not even a PHP question...


On Thu, 18 Apr 2002 20:10:13 +0200, Manu Verhaegen wrote:

Hi,
You can right click on a image on your browser and choose save.
I want to disable this option, how can i do this




Greetings,
   Manu


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


Regards,

Gunther E. Biernat



-- 
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] Performance question

2002-04-16 Thread Fifield, Mike

Ok I have a performance question. I run a wallpaper site; this is the url to
the main gallery page http://www.cognitivedistortion.com/php/gal.php
http://www.cognitivedistortion.com/php/gal.php  The page does a dir read
and lists all pictures found in each directory, it does this every time the
page is loaded. Now at first this seemed like a incredible inefficient way
to do generate pages. The alternatives to this would be to generate a list
of the pictures and save them in a text file, or create a list of the
pictures and store them in a database. If I use a text file I will have to
read the text file every time the page is generated which seems like it
would take just as long as reading the file allocation table, which I am
doing now. As for the database to get the same thing done I would first have
to log into the database and then pull the information. 
I was hoping to get some input as to which would be the fastest/ best way to
use. 
 
 
Mike Fifield
Charles Schwab  Co, Inc.
WARNING: All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.
 



[PHP] Performance question

2002-04-16 Thread Fifield, Mike

If no one in this forum can answer this, can someone point me in the
direction of list or other resource that may be able to provide some input? 

Thanks in advance. 

-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 16, 2002 9:22 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Performance question

Ok I have a performance question. I run a wallpaper site; this is the url to
the main gallery page http://www.cognitivedistortion.com/php/gal.php
http://www.cognitivedistortion.com/php/gal.php  The page does a dir read
and lists all pictures found in each directory, it does this every time the
page is loaded. Now at first this seemed like a incredible inefficient way
to do generate pages. The alternatives to this would be to generate a list
of the pictures and save them in a text file, or create a list of the
pictures and store them in a database. If I use a text file I will have to
read the text file every time the page is generated which seems like it
would take just as long as reading the file allocation table, which I am
doing now. As for the database to get the same thing done I would first have
to log into the database and then pull the information. 
I was hoping to get some input as to which would be the fastest/ best way to
use. 
 
 


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




[PHP] Storing images in MySql

2002-04-16 Thread Fifield, Mike

After posting my question about performance earlier this morning it was
suggested that I also store the jpg's in the database, (thanks Maxim). I did
a little research and got a lot of conflicting information on weather this
is a good idea or not. For example the following url states that you suffer
a 30% performance hit by doing it this way. 
http://www.zend.com/zend/trick/tricks-sept-2001.php
http://www.zend.com/zend/trick/tricks-sept-2001.php 
Is anyone out there running a website that stores images as binary data in
MySql that could comment on this?
Any and all comments are welcome. 
 
Mike
 
 
 



[PHP] Sorting an array of arrays....

2002-02-14 Thread Fifield, Mike

What I am trying to do is sort a array of arrays but I want to sort by one
of the pieces of data stored in the arrays inside the array. For example;
$data[blue] = array(name, age, time, 3);
$data[green] = array(name, age, time, 7);
$data[red] = array(name, age, time, 6);
$data[yellow] = array(name, age, time, 2);
$data[white] = array(name, age, time, 1);
$data[black] = array(name, age, time, 9);

I want to be able to sort this array of arrays by the very last element, the
numbers. 

Mike Fifield
Charles Schwab  Co, Inc.
WARNING: All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.



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




RE: [PHP] Sorting an array of arrays....

2002-02-14 Thread Fifield, Mike

Does anyone have an example of code that does this, I have been trying to
decipher the instructions on the use of uasort but it does not make a hole
lot of sense. They are using static keys and sorting by one of the array
elements of each of there static keys. It does not seem like one should have
to do it this way. I need it to go through each key and sort the keys based
on a value in the array held in that key. 

Thanks 

Mike

-Original Message-
From: Darren Gamble [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 9:35 AM
To: 'Fifield, Mike'; [EMAIL PROTECTED]
Subject: RE: [PHP] Sorting an array of arrays


Good day,

uasort() should do what you need.

http://www.php.net/manual/en/function.uasort.php

There's an example for the usort function that does something similar to
what you want, in fact.


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 9:26 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Sorting an array of arrays


What I am trying to do is sort a array of arrays but I want to sort by one
of the pieces of data stored in the arrays inside the array. For example;
$data[blue] = array(name, age, time, 3);
$data[green] = array(name, age, time, 7);
$data[red] = array(name, age, time, 6);
$data[yellow] = array(name, age, time, 2);
$data[white] = array(name, age, time, 1);
$data[black] = array(name, age, time, 9);

I want to be able to sort this array of arrays by the very last element, the
numbers. 

Mike Fifield
Charles Schwab  Co, Inc.
WARNING: All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.



-- 
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] Checking to see it a host is up.

2002-02-08 Thread Fifield, Mike

I am looking for  a way to check to see if a website is up, something like a
ping command. Does anyone know of a way to do this?

Mike Fifield
Charles Schwab  Co, Inc.
WARNING: All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.



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




[PHP] Checking to see it a host is up.

2002-02-08 Thread Fifield, Mike

Ok let me be more specific. I know I could do this with perl but it is going
to be used on a page that will be loaded hundreds of times a minute, and so
it needs to be fast. I was hoping that php had a function that could be used
to do this, something like perl's webping.

-Original Message-
From: Fifield, Mike [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 9:36 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Checking to see it a host is up.


I am looking for  a way to check to see if a website is up, something like a
ping command. Does anyone know of a way to do this?

Mike Fifield
Charles Schwab  Co, Inc.
WARNING: All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.



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