FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > PHP, Perl, Python and/or MySQL
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 07-23-1999, 01:01 AM   Postid: 42953
Mario
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jul 1999
Posts: 13
Why won't it work?!

I'm sorry, I feel real silly. I simply forgot a semi-colin on the line before. Luckily I spared you all from that LONG, excruciating message.

I only wish there were a 24 hour PHP support line somewhere!
[This message has been edited by Mario (edited 07-23-99)]
Mario is offline   Reply With Quote
Old 07-23-1999, 02:40 PM   Postid: 42954
Mario
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jul 1999
Posts: 13
So that this topic is not completely WASTED. I do have a valid question now. I am using the mail(function) with my site to do various things after someone registers. However, in the mail function is there a way to just reference a text file for the message instead of typing in the message directly into the mailfunction? Anyone catch my drift?

I'm sure it can be done, anyone know the code?

Thanks.
Mario is offline   Reply With Quote
Old 07-23-1999, 05:26 PM   Postid: 42955
Justin
Visitor
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
The mail() function's job is to send email - that's it. You give it an address, subject, body, and optionally some extra headers, and it sends email

However, you can easily open a text file and read it in, mailing out the text. The easiest way to do this is to use the file() function:


$text = join (file ("/path/to/file.txt&quot, ""
mail ("me@mydomain.com", "Contents of file.txt", $text);

File() returns an array (split by line terminators) of the text in the file, and also works for remote URL's. Since it keeps the line terminators in tact, you can simply join it into a string and mail that out.

Hope you find this helpful

------------------
Justin Nelson
FutureQuest Support
Justin is offline   Reply With Quote
Old 07-23-1999, 11:34 PM   Postid: 42956
Mario
Visitor

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jul 1999
Posts: 13
It was extremely helpful Justin, thank you. Now I'm looking to open up a file and WRITE a string to that [flat] file. So I searched PHP.NET and I thought maybe fputs or fwrite() would do the trick, but I don't think they do. (I've tried). Can anyone point me in the right direction to do this?
------------------
Mario is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 10:38 AM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.