RE: [PHP] sending attachments via mail(), possible?

2001-05-09 Thread Benjamin Munoz


There is a PHP class someone wrote called mime_mail that makes this easy. 

The resulting code using this class is something like:


// create new mime_mail object instance
$mail = new mime_mail;

// set all data slots
$mail-from= [EMAIL PROTECTED];
$mail-to  = [EMAIL PROTECTED];
$mail-subject = here's that file;
$mail-body= here's that file;

// read the file from disk
$fd = fopen($file_location, r);
$data = fread($fd, filesize($file_location));
fclose($fd);

// append the attachment
$mail-add_attachment($data, $file_name, $file_mime_type);

// send e-mail
$mail-send();

Look in phpclasses.upperdesign.com or search in Google.

-Ben

-Original Message-
From: Tym Rehm [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 12:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] sending attachments via mail(), possible?


You have to open the file and encode it.
Check out this:

html
head
  titleFitnessQuest FTP user request form - results/title
/head
body
?php
$date = exec(date);
$border=--==_856811060==_;
/* Define the attachment and encode it base64 */
$filename=/var/www/sf/Ftp_User_Info.doc;
$fd = fopen($filename, r);
$contents = fread($fd, filesize($filename));
$encoded=chunk_split(base64_encode($contents));
fclose($fd);
/* Trim white spaces */
$request_by = trim($request_by);
$email = trim($email);
$company = trim($company);
/* testing if form is filled out */
if (empty($email) )
{
  print h1FAILED!/h1;
  print pThis form can't be sent! You did not fill the form out
bcompletely!/bbrThe email address is missing!br;
  print brbrPlease click the bback/b button and fill in the email
addressbr;
  print Thank you;
  return;
}
if (empty($dr_ret) )
{
  print h1FAILED!/h1;
  print pThis form can't be sent! You did not fill the form out
bcompletely!/bbrThe system is not selected!br;
  print brbrPlease click the bback/b button and select a system (DR
or Retail)br;
  print Thank you;
  return;
}
#/* recipients */
$recipient = $email;

#/* subject */
$subject = FitnessQuest FTP account form;

#/* message */
$message .= --$border\n;
$message .= Content-Type: text/plain; charset=us-ascii\n\n;
$message .= Attached is a FTP account access form. The form is in Microsoft
Word 97 format, please fill it out completely\n;
$message .= and email it back to [EMAIL PROTECTED] After a completed
form has been recieved your FTP account will be\n;
$message .= created. It will take approximately two working days to
complete your FTP account. You will recieve an email with\n;
$message .= username, password, and ftp server name. If you have questions,
email [EMAIL PROTECTED] or call your account\n;
$message .= representative. Thank you\n\n;
$message .= \n--$border\n;
$message .= Content-Type: application/msword; name=\Ftp\ User\
Info.doc\\n;
$message .= Content-Transfer-Encoding: base64\n;
$message .= Content-Disposition: attachment; filename=\Ftp\ User\
Info.doc\\n;
$message .= \n;
$message .= $encoded;
#$message .= --$border\n;

/* Header infomation */
$headers .= From: FTP Accounts [EMAIL PROTECTED]\n;
$headers .= X-Sender: [EMAIL PROTECTED]\n;
$headers .= Mime-Version: 1.0\n;
$headers .= Content-Type: multipart/mixed; boundary=\$border\\n;

#/* and now mail it */
mail($recipient, $subject, $message, $headers);
print h1Notices Sent/h1;
print h2pEmailed out!br/h2;

print pMail Sent to $recipientp;

/* Send notices to the distribution list */
/* Read Distribution list from text file */
$dlist = file(/var/www/sf/dlist);
$line = explode( ,, $dlist[0]);
array_push ($line, $request_by);
$dnumber = count($line);
if ($dnumber == 0)
{
  print The list is emptyp;
}
for ($i=0; $i$dnumber; $i++)
{
#  print $line[$i]br;
   $line[$i] = trim($line[$i]);
/* Clear Notices var */
   unset ($not_mess);
   unset ($not_headers);
   unset ($not_sub);
/* Notice Email Message */
   $not_mess .= --$border\n;
   $not_mess .= Content-Type: text/plain; charset=us-ascii\n\n;
   $not_mess .= An FTP access form was emailed to $email.\n;
   $not_mess .= Company name: $company\n;
   $not_mess .= $company will be a $dr_ret customer\n\n\n\n;
   $not_mess .= The request form was completed by $request_by on
$date.\n\n;
#   $not_mess .= \n--$border\n;
/* Notice Subject */
  $not_sub .= FTP user setup notice;
/* Notice Headers */
  $not_headers .= From: FTP Accounts [EMAIL PROTECTED]\n;
  $not_headers .= X-Sender: [EMAIL PROTECTED]\n;
  $not_headers .= Mime-Version: 1.0\n;
  $not_headers .= Content-Type: multipart/mixed; boundary=\$border\\n;

/* Send Notice email to distribution list */
/* Diag testing */
#  print |$line[$i]|br;
#  print |$not_sub|br;
#  print |$not_mess|br;
#  print |$not_headers|brp;
  mail($line[$i], $not_sub, $not_mess, $not_headers);
}


?
/body/html


- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 09, 2001 3:10 PM
Subject: [PHP] sending attachments via mail(), possible?


 Is it possible to send attachments via mail() function?

 I tried it, and 

RE: [PHP] manipulating files with php

2001-05-09 Thread Benjamin Munoz


There are a number of ways to do this.  Mine is something like this:

if (has_read_perm($user_id, $file_id)) {
send_file_to_browser($file_id);
} else {
// print error message();
}

...

function has_read_perm($user_id, $file_id) {
// check db table
// return true/false
}

function send_file_to_browser($file_id) {
$file_location = get_file_location($file_id); // get full path of
this file_id
$file_mime = get_file_mime($file_id); // I store this info in the db
$fp = fopen($file_location,r); 
$buff = fread($fp,800); 
header(Content-Type: $file_mime_type\n);
echo $buff; 
}

function get_file_location ($file_id) {
// return full path to the file, including file_name
}

function get_file_mime_type($file_id) {
// return the original file mime type, I have this stored into the
db when a file is uploaded
}

Because you are sending a header here, you can't print html before the
function send_file_to_browser() is called.

-Ben

-Original Message-
From: Andrew Coles [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 12:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP] manipulating files with php


I am creating a CRM system using php for my final year university project.
I would like to enable the storing of files on the system.  However I want
to restrict access to these files according to privilege tables stored in
local mysql tables.  In order to prevent access to the files by simply
typing the url, they would be stored outside the web directory.

Is it possible to create a php page which will read a local file from
outside the web directory and pass the data straight to the http output, in
affect allowing checking of a users status before allowing access to the
file?

I would be grateful for any suggestions,

Thanks,

Andrew



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Simple Questions

2001-05-08 Thread Benjamin Munoz

This is not working?

echo(trtd align=\center\ bgcolor=\$bc\ style=\color: $text;
font-family: $font; font-size:
$fontsize\$server-server_num_players./.$server-server_max_players/td
/tr);

If you are trying to print out 
trtd align=center bgcolor=$bc style=color: $text; font-family:
$font; font-size: $fontsize4/4/td/tr
but can't because it is evaluating it mathematically, try using the HTML
character entity for /, #047;

echo(trtd align=\center\ bgcolor=\$bc\ style=\color: $text;
font-family: $font; font-size:
$fontsize\$server-server_num_players#047;$server-server_max_players/td
/tr);

Hope this is what you meant.

-Ben

-Original Message-
From: Ender [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 08, 2001 3:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Simple Questions


Okay few questions, I am pretty new to this hehe.

If I have a number say, 123.123.123.123.

$ip = 123.123.123.123;

How do I put a starting  and an ending  to make it

123.123.123.123

AND

This doesn't work:

echo(trtd align=\center\ bgcolor=\$bc\ style=\color: $text;
font-family: $font; font-size:
$fontsize\$server-server_num_players./.$server-server_max_players/td
/tr);

What do I need to do to put a / between the two variables?


Best regards,

Ender [Clan Leader]
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Commercial sites that use PHP

2001-04-10 Thread Benjamin Munoz


Yahoo uses a lot of Python.  Yahoo Mail pages have extensions of .py,
indicating Python.  Yahoo acquired eGroups and Google this past year, both
of which openly use Python to generate pages.  They most likely use Python
in conjunction with other scripting and compiled languages.

-Ben

-Original Message-
From: Michael Kimsal [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 10, 2001 9:47 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Commercial sites that use PHP




Brent Langston wrote:

 Does anyone know what Yahoo uses?  It's obviously some form of
scripting...
 especially at http://my.yahoo.com.  I've always been curious about what
they
 are using as their parser... it appears to spit out pure HTML, so it acts
 like PHP...

 Any thoughts?

No offense here, but EVERYTHING does that.  ASP, JSP, CF, Perl, Frontier,
etc.
I think it's pretty impossible to tell what someone's using unless they
announce

via file extensions or something, and even then you can't always tell.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PHPSESSID sticks to every link after upgrate of Apache/PHP

2001-04-08 Thread Benjamin Munoz

In your php.ini, change the following line:
session.use_trans_sid = 1   ; use transient sid support if enabled
to
session.use_trans_sid = 0   ; use transient sid support if enabled

And see if that solves your problem.  Also, check the change with phpinfo(),
and if nothing changed, look for a second evil twin of php.ini

-Ben
-Original Message-
From: trogers [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 08, 2001 6:59 PM
To: 'PHP General List. (E-mail)'
Subject: Re: [PHP] PHPSESSID sticks to every link after upgrate of
Apache/PHP


Hi
You will probably need to make clean and rebuild php config and do a new 
make against the new version of apache.
Just a guess
Tom

At 12:28 PM 5/04/01 +0900, Maxim Maletsky wrote:

Hello,

my co-worker has reinstalled Apache and PHP over the last night.

The Apache was upgraded to the new version while PHP was re-installed the
same.
PHP.ini was untouched.

Site uses sessions and, somehow, after this upgrade started carrying
PHPSESSID through HREF.

What should look for to bring the sessions using Cookies?

from PHP-INI:

NOTE : this was untouched.



[Session]
session.save_handler  = files   ; handler used to store/retrieve data
session.save_path = /tmp; argument passed to save_handler
 ; in the case of files, this is the
 ; path where data files are stored
session.use_cookies   = 1   ; whether to use cookies
session.name  = PHPSESSID ; name of the session
 ; is used as cookie name
session.auto_start= 0   ; initialize session on request startup
session.cookie_lifetime   = 0   ; lifetime in seconds of cookie
 ; or if 0, until browser is restarted
session.cookie_path   = /   ; the path the cookie is valid for
session.cookie_domain = ; the domain the cookie is valid for
session.serialize_handler = php ; handler used to serialize data
 ; php is the standard serializer of
PHP
session.gc_probability= 1   ; percentual probability that the
 ; 'garbage collection' process is
started
 ; on every session initialization
session.gc_maxlifetime= 1440; after this number of seconds, stored
 ; data will be seen as 'garbage' and
 ; cleaned up by the gc process
session.referer_check = ; check HTTP Referer to invalidate
 ; externally stored URLs containing
ids
session.entropy_length= 0   ; how many bytes to read from the file
session.entropy_file  = ; specified here to create the session
id
; session.entropy_length= 16
; session.entropy_file  = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
 ; determine HTTP caching aspects
session.cache_expire  = 180 ; document expires after n minutes
session.use_trans_sid = 1   ; use transient sid support if enabled
 ; by compiling with --enable-trans-sid
=


Has upgrade of apache (modules, etc) anything to do with it?

I can't really give you any more details since my co-coworker is
unreachable
right now, and this is kinda urgent.

Cheers,
Max.



Maxim Maletsky - [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
Webmaster, J-Door.com / J@pan Inc.
LINC Media, Inc.
TEL: 03-3499-2175 x 1271
FAX: 03-3499-3109

http://www.j-door.com http://www.j-door.com/
http://www.japaninc.net http://www.japaninc.net/
http://www.lincmedia.co.jp http://www.lincmedia.co.jp/




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] double byte problem

2001-04-08 Thread Benjamin Munoz

Can you send some code?


-Original Message-
From: Subhrajyoti Moitra [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 08, 2001 8:41 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] double byte problem


hi,
i am having a little problem in using php with double byte character.

a user enters double byte character in some html form.. this user data is
converted into a gif image. and later stored in a mysql/pgsql database...

i have no clue how go about doing this .. can someone please please please
help me .. i am stuck..

_
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Bad Practices

2001-02-13 Thread Benjamin Munoz

Three good articles by the author of PHP Developer's Cookbook.

Top 21 PHP progamming mistakes 
By Sterling Hughes 

http://zend.com/zend/art/mistake.php

http://zend.com/zend/art/mistake1.php

http://zend.com/zend/art/mistake2.php

-Ben Munoz

-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 10:11 AM
To: PHP
Subject: [PHP] Bad Practices


Would people like to list bad practices and also point us
newbies to any articles online dealing with syntax, correct
use of single and double quotes etc.? 

I would like to get a good handle on these issues right
from the beginning. As a Web designer I like to use 
standard HTML and do everything correctly even if the
browser is forgiving. I notice that a LOT of programmers
write bad HTML and I would imagine many of the publicly
available PHP scripts aren't exactly kosher either. What are 
some of the most objectionable things you see? Thanks.
Jeff Oien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] A php-xml mailing list?

2001-02-09 Thread Benjamin Munoz


Yes, I subscribe to this PHP-XML mailing list, but it is very low volume.  

I'd encourage anyone considering using XML/XSL/SOAP/RSS to join this list,
so that XML and SOAP can be easily used with a PHP web app environment.  

I've used ASP/COM when I really wanted to use PHP, but the Microsoft SOAP
servers/listeners made XML communication much easier, especially since I'm
new to SOAP.

-Ben

-Original Message-
From: Matt McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 09, 2001 3:24 PM
To: Michael Dearman
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] A php-xml mailing list?


On Fri, Feb 09, 2001 at 05:37:04PM -0700, Michael Dearman wrote:

 I think it would be helpful.
 What do you folks think?

You'd think it would be a popular thing, but the one O'Reilly hosts
is more or less silent.

http://www.oreillynet.com/pub/a/php/php-xml-ml.html

Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] 20 Million Fresh E-mail Addresses

2001-02-06 Thread Benjamin Munoz


On replying to SPAM:

Most of you already know this, but replying to SPAM (even if they tell you
that you can remove yourself) usually leads to more SPAM, b/c you've just
given the SPAMMERS your email address confirmed.  
http://www.chugach.net/~techtips/spam3.htm

Just a warning.  

-Ben

-Original Message-
From: Luke [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 05, 2001 6:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] 20 Million Fresh E-mail Addresses


TO BE REMOVED FROM FUTURE MAILINGS, SIMPLY REPLY TO THIS 
MESSAGE AND PUT
"REMOVE" IN THE SUBJECT.


   20  MILLION
 E-MAIL ADDRESSES
  FOR ONLY $249
**Over Night International Shipping Included** 


Many Call This "The "Perfect E-Mail List"

Over 20-Million Of The Best E-Mail Addresses Available

_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/

Our research has found that many people have tried one or more of
the following...

Free Classifieds? (Don't work anymore)
Web Site? (Takes thousands of visitors)
Banners? (Expensive and losing their punch)
E-Zine? (Hope they have a *huge* subscriber list)
Search Engines? (Forget it, unless you're in the top 20)

 S O   W H A T   W I L L   W O R K ?

Although often misunderstood, there is one method that has proven
to succeed time-after-time.

 E - M A I L   M A R K E T I N G ! !

IT'S A FACT... If you're not using your computer to generate
income,  GOOD income,  you're leaving money on the table.

Here's what the experts have to say about E-Mail Marketing:

"E-mail is an incredible lead generation tool"
-Crains Magazine

"A gold mine for those who can take advantage of
bulk e-mail programs" - The New York Times

"Blows away traditional Mailing" - Advertising Age

Here's an example of your potential earnings if you have a
product or service that brings you a profit of around $30.
Remember, on the Internet, you can make money 7 days a week, 24
hours a day... even while you sleep, orders come from all over
the world!

Orders
Per DayWeekly  Monthly  Yearly

   1   $  210  $   840  $ 10,080
   2  4201,68020,160
   3  6302,52030,240
   51,0504,20050,400
  102,1008,400   100,000
  153,150   12,600   151,200

THE QUESTION IS... how do you generate those orders?

The least expensive and fastest way is through E-Mail Marketing.



  You want to make some money?

  I can put you in touch with over 20 million people at virtually no cost.

  Can you make one cent from each of theses names?

If you can you have a profit of over $200,000.00


  That's right, I have over 20 Million  Fresh  email

addresses that I will sell for only $249. These are all

fresh addresses that include almost every English person

on the Internet today, with no duplications. They are

all sorted and ready to be mailed.  That is the best

deal anywhere today!  


  Don't believe it? People are making that kind of

money right now by doing the same thing, that is

why you get so much email from people selling you

their productit works! 


  These 20 Million email addresses are 

yours to keep, so you can use them over and

over. 


  This offer is not for everyone. If you can not

see just how excellent the risk / reward ratio

in this offer is then there is nothing I can do

for you.  To make money you must stop dreaming

and TAKE ACTION.



Over the past 2 years, we have gained a reputation for having the
cleanest, most responsive e-mail address lists in the industry.
No one has gone to the work it takes to produce an e-mail address
list of this quality.

Here's how we prepare our e-mail lists:

1. We clean and eliminate all duplicates.

2. Next, we use a filter list of 400+ words/phrases to clean even
more. No address with inappropriate or profane wording survives!

3. Then we use our private database of thousands of known
Internet "extremists", those opposed to any kind of commercial
e-mail, and kicked off every one we could find.

4. All domains were verified to insure they're valid.

5. And finally, we sorted the list into easy-to-manage packets of
20,000 addresses in simple text (.txt) format that will work with
any computer operating system.

**
It is time to order!

Shipping is not an issue. 

**FedEx next day world wide shipping included  

As soon as we receive payment we will FedEx your e-mail list via 

CD straight to your door anywhere in the world FedEx next day guaranteed.

**International Orders Welcome*

US funds paid via paypal.com welcomed

PayPal is now available in the following countries:

Australia 
Austria 
Belgium 
Brazil 
Canada 
Denmark 
France 
Germany 
Hong Kong 
Ireland 
Israel 
Italy 
Japan 
Mexico 
Netherlands 
New Zealand 
Norway 
Portugal 
Singapore 
South Africa 
South Korea 
Spain 
Sweden 
Switzerland 
United Kingdom

PayPal.com is very easy to sign up 

RE: [PHP] Suggest for List

2001-02-01 Thread Benjamin Munoz

April, 

There was a discussion like in 1999 (i remember cuz I was learning PHP
then), and Richard Lynch (i think) had a good point that splitting the list
would reduce the quality of the answers on the beginners list--PHP newbies
answering each others questions, you see.

Newbies should continue to post here.  A tip: some developers preface their
posts with something like: "newbie question".  If you do this, you'll likely
get flooded with friendly and helpful responses.Try it :)

-Ben

-Original Message-
From: April [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 01, 2001 11:25 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Suggest for List


I've been searching for a much smaller PHP beginners lists, away from the
official one, because I know I'm much too beginner for this one.  Everytime
I post, I feel like I'm trying to snatch a cookie in full view of the
headmistress, and probably going to get hit with her spoon for it.  You'll
always get the idiots posting to the advanced list, yeah, it happens.  But I
think that the quality of lists would generally go up for both advanced and
beginning people - less interference and less pressure, respectively.


- Original Message -
From: "Boget, Chris" [EMAIL PROTECTED]
To: "'Chris Lee'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, February 01, 2001 12:42 PM
Subject: RE: [PHP] Suggest for List


  Good idea, I agree, this would be nice. It would allow
  posters to better categorize their question, and would
  give responders a good place to hangout depending on
  their skill set.

 This has been suggested before.  What you will invariably
 find is that all users (beginner and advanced) will subscribe
 and post to the advanced list because the beginners will
 know there are people there who can answer any ?'s whereas
 there may not be on the beginner list...

 Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] PDF Questions

2001-01-30 Thread Benjamin Munoz


http://www.phpbuilder.com/columns/perugini20001026.php3

http://www.phpbuilder.com/columns/uwe20001116.php3

http://php.net/manual/en/ref.pdf.php

-Ben

-Original Message-
From: Conover, Ryan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 6:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] PDF Questions 


I was wondering if anyone has any good places to answer questions pertaining
to PDF and PHP.

Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How can I make PHP to work on Win98 ?

2001-01-30 Thread Benjamin Munoz


You can find some info here...
http://php.net/manual/en/install-windows95-nt.php

And more here...
http://php.weblogs.com/easywindows

First requirement is to have a web server (Xitami, Apache, Personal
Webserver) on your Win98 box.
Then you can run one of the installers found on one of the above links.  

Good luck.

-Ben

-Original Message-
From: nastaran kashani [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 10:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How can I make PHP to work on Win98 ?




   Hi,
 I work with Winows98  , and I want to make my system 
a really server.I have two questions :
 
1}What component  I should install on my system to 
  make it a really server ? IIS3 ? or IIS4 ?
2)Where can I get this component (IIS3 or IIS4
  for Windows98) ?


Thanks a lot
 Atieh Kashani

__
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Uploading images only

2001-01-30 Thread Benjamin Munoz


You can check the mime type of the uploaded file.

First upload the file, as usual.  Then check the mime type before copying
from the temp directory to the files directory.

If this is your form:
form action="flm_upload.html" method="post" enctype="multipart/form-data"
input type=hidden name=MAX_FILE_SIZE value=?=$max_file_size?
File: br
input type=file name=userfile/td
input type=submit value="Upload File"
/form

Then on submission, $userfile will be your file, $userfile_name will
automatically be the original file name, and $userfile_type will be the mime
type.  Check if image/gif or image/jpg (double check these) are in the mime
type, and copy($userfile, $file_directory.$userfile_name) for images only.
http://php.net/manual/en/features.file-upload.php


-Ben

-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 30, 2001 8:30 AM
To: PHP User Group
Subject: [PHP] Uploading images only


Hello,

Is there a way to only let images get upload while doing a simple file
upload form?

Thank you,


Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem!

2001-01-29 Thread Benjamin Munoz


Stephen,

If this date format is coming from a MySQL database (frequently the case),
you might want to look at the date formatting functions of MySQL.
http://www.mysql.com/doc/D/a/Date_and_time_functions.html.  

ex. select DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');

One drawback is that this is not standard SQL, so it's not too portable, if
you are concerned with that.

-Ben

-Original Message-
From: Stephan Ahonen [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 5:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Problem!


1.
$date = "20010101";

How could I output 01 01 2001 (or make it 3 variables, like day, month,
year)?

$year = substr($date,0,4);
$month = substr($date,4,2);
$day = substr($date,6,2);

...Assuming that the date is stored in mmdd format.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Export to Spreadsheet Format

2001-01-23 Thread Benjamin Munoz


I want to run a query on a database and export the recordset to a
spreadsheet, preferably Excel native.  

The box is on a Win32 OS, so I can instantiate a Excel COM object (similar
to the PHPBuilder COM article), and use the COM methods to create an Excel
file.

Or, I can fopen and fput a CSV formatted file ready to import into Excel.

My question is this: can anyone recommend a script/class where this has
already been done?  Thanks, PHP list.

Ben Muoz

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Multiple Page Form

2001-01-23 Thread Benjamin Munoz


Make sure you are not forgetting to include $action as a hidden input, so
your script can know how to process.

input type=hidden name=action value=Send, for example

-Ben

-Original Message-
From: Jeremy Bowen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 12:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Multiple Page Form


hey,

I am sure this is a dumb question but, I cannot seem to find out what i am
doing wrong. 

I have a three page form, it basically takes a users input, displays it on
the
next page to make sure the users info is correct (i store the variables on
this page in a form in hidden input tags), when the user clicks subscribe on
this page it is supposed to go on to the third page which is a confirmation
page. We instead of doing that it just reloads the page and resets all of
the
values!

My form looks something like this (This is a simplified version):

?

if ($action=="")

{


PAGE ONE TEXT AND FORM


form method=post action=$PHP_SELF

input type=text name=name
input type=text name=email

input type=submit value=Subscribe
/form


}

elseif ($action="Send")

{


PAGE TWO


form method=post action=$PHP_SELF

$name input type=hidden name=name
$email input type=hidden name=email

input type=submit value=Subscribe

form

}

elseif ($action="Send")

{


Thanks for Subscribing!

mail("Args","Args","Args");

}

?

I have looked on php.net but i cannot seem to find docs on how to do this!

Thanks,

Jeremy






 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Two things

2001-01-17 Thread Benjamin Munoz


Did you mean this?

?php
$i = 0
$colors = array('#ff','#0');
?

-Ben

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 11:52 AM
To: Phil Labonte
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Two things


 When I get a list of items from a database I would like to display them
with
 alternating colors.  Does anyone know how or where I can get some code
that
 will show me how to do that?

$col = 0;
$colors = array('#ff','#00');

while($row=mysql_fetchrow($result)) {
echo "td bgcolor=".$colors[$i++%2]."".$row[0]."/td\n";
}

 The other question is what is the code to get the ip of the client that is
 accessing your site?  I know that one is easy but I forget how to do it.

$REMOTE_ADDR

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Strings??

2001-01-16 Thread Benjamin Munoz

Ade,

What kind of string?  What do you want to do with them?  

-Ben

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 2:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Strings??


Quick Question.

I have a form which has 10 fields, is there any way in PHP to take the
values 
once submitted and create a string for each??

Thanks 
Ade

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] How to keep unauthorized viewers out

2001-01-16 Thread Benjamin Munoz


Correction:
Inside X.php, you have some authentication code.  Maybe something simple as:
?
if (!$valid) {
// redirect to story.php?storynum=X
}
// rest of article follows
?

-Ben
-Original Message-
From: Benjamin Munoz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 4:20 PM
To: 'Miles Thompson'; [EMAIL PROTECTED]
Subject: RE: [PHP] How to keep unauthorized viewers out


Miles,

If you can save 2.htm as 2.php, use some authentication code.

Story.php becomes
?
include "auth.inc";
include "header.inc";
include $storynum.".php";
include "footer.inc";
?

Inside X.php, you have some authentication code.  Maybe something simple as:
?
if ($valid) {
// redirect to story.php?storynum=X
}
// rest of article follows
?

Inside story.php, set $valid to true
?
$valid = TRUE;
?

Now accessing 2.php directly means that $valid is valid and you'll be
redirected to story.php.

Another option is to place all stories x.php into a story directory and
restrict access to this directory using Apache configuration directives.

-Ben

-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 3:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to keep unauthorized viewers out


I'm using a pretty simple linking system for a subscription-based 
newsletter site.

Stories and articles are in straight html files, reached by links from the 
front page. Clicking on a link passes a story number. So the second story 
on the index page would have this link: A HREF="./story.php?storynum=2"

and story.php consists of just these lines:

? include "auth.inc" ;
include "header.inc" ;
include $storynum.".htm" ;
include "footer.inc" ;
?

If someone comes in the "right way", through the index page, they will have 
to be authenticated, then the header, article and page footer are displayed.

There's nothing, however, to stop someone from typing an URL like this:
http://www.somepub.ca/2.htm and seeing the article. I assume they could 
also come in that way via a search engine.

Any suggestions on how to stop that? Resources I should look at? I do want 
to keep the stories in straight html as the editor is struggling now with 
basic layout, etc.

Regards - Miles Thompson



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] MySQL - How to transfer a query resault into a variable?

2001-01-16 Thread Benjamin Munoz


http://www.php.net/manual/en/function.mysql-fetch-object.php

Modified example from the manual above...

?php 
mysql_connect ($host, $user, $password);
$result = mysql_db_query ("database", "select * from table");
while ($row = mysql_fetch_object ($result)) {
// save database fields into variables here
$user_id = $row-user_id;
$name = $row-name;
// print them out if you want, or store them in an array to return
if this is a function
print ("a href=user_details.php?user_id=$user_id$name/abr\n");
}
mysql_free_result ($result);
?

-Ben



-Original Message-
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 5:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL - How to transfer a query resault into a variable?


Hi,

Lets say I have columns e.g.

| name | address | phone |

I want to make a list of all the names and put the result into a HTML page
where each name is a link.

When the name is clicked (the link), it will open another HTML page with
full information (name, address and phone).

I know how to send the query to list the names (and into a formatted
HTML-file), but I don't know how to put each name into a variable or a link
for the next step.

Can you point me to functions I should focus at or even a solution?

Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is - New Homepage!
--


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]