Hello,
I'm currently making a really weird email script, there is no need for me to go into great detail, so I won't. I wish to have the contents of the email that is sent in a txt file. Is this possible?
Thanks,
Joe
Email script.
Moderator: General Moderators
weird email
I assume that you know how to get the email data into a string...
So you can use something like:
This creates a new file with the $file_name path + name and inserts the $data_string into!.
cheers!
don pool
So you can use something like:
Code: Select all
<?php
if ( !file_exists ( $file_name ) )
{
$fp = fopen( $file_name, "a" );
fputs ( $fp, $data_string );
}
fclose( $fp );
?>cheers!
don pool
hmmm...
Let me rephrase what I ment. I wish to put the contents of a text file into a variable. Is that possible?
I'm also creating a login script. When someone tries to view a page, I wish to check to see if the person is authorized, if not, then be sent directly to the login page, without seeing anything on the page that he was trying to view. This would mean that redirects can't work, because you can see the page you are trying to view for a minimum of one second. Any theories or facts?
Joe
Let me rephrase what I ment. I wish to put the contents of a text file into a variable. Is that possible?
I'm also creating a login script. When someone tries to view a page, I wish to check to see if the person is authorized, if not, then be sent directly to the login page, without seeing anything on the page that he was trying to view. This would mean that redirects can't work, because you can see the page you are trying to view for a minimum of one second. Any theories or facts?
Joe
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
...
Simply open the txt file and read the data into a string.
And then for your login. Check to see if the user is logged in before anything is sent to the page and set a varible to true if they are, then just do:
As long as you only print the data within the if statement then un-authorised users wont see anything.
And then for your login. Check to see if the user is logged in before anything is sent to the page and set a varible to true if they are, then just do:
Code: Select all
if($user_logged_in){
#
#this is my secret member area only :)
#
}else{
echo "You are being redirected";
#
#redirect code
#
}- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK