Re: login page timeout | | i dont have any code on my pages. i have created a site within a site. so when someone goes to my site and logs in the get to another site within my site , if that makes sense. it takes alot of time to build like that, if you can suggest an easier way ( like the what you wrote "code you add to pages that are protected" i will gladly try it
thanks johnny
here is the code i use <?php
// Receiving variables
@$name = addslashes($_POST['name']);
@$email_address = addslashes($_POST['email_address']);
@$browse_Name = $_FILES['browse']['name'];
@$browse_Size = $_FILES['browse']['size'];
@$browse_Temp = $_FILES['browse']['tmp_name'];
@$browse_Mime_Type = $_FILES['browse']['type'];
function RecursiveMkdir($path)
{
if (!file_exists($path))
{
RecursiveMkdir(dirname($path));
mkdir($path, 0777);
}
}
// Validation
if( $browse_Size == 0)
{
header("Location: errorpage.html");
exit;
}
if( $browse_Size >50000000)
{
//delete file
unlink($browse_Temp);
header("Location: errorpage.html");
exit;
}
$uploadFile = "upload/".$browse_Name ;
if (!is_dir(dirname($uploadFile)))
{
@RecursiveMkdir(dirname($uploadFile));
}
else
{
@chmod(dirname($uploadFile), 0777);
}
@move_uploaded_file( $browse_Temp , $uploadFile);
chmod($uploadFile, 0644);
$browse_URL = "http://www.xxxxxxxx.co.uk/upload/".$browse_Name ;
//Sending Email to form owner
$pfw_header = "From: $email_address\n"
. "Reply-To: $email_address\n";
$pfw_subject = "A New File Has been Uploaded !";
$pfw_email_to = "xxxxx@xxxxx.co.uk";
$pfw_message = "Name: $name\n"
. "Email_address: $email_address\n"
. "File Link: $browse_URL\n"
. "\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: thankyou_page.html");
?>
Please do the following:
1. The button , for which you have chosen type button simply "button", must be turned into a "submit" button. it's not important that you have named it "Upload now". The name can remain, but it must be a submit button.
2. You have created an "upload" folder. That's ok, the files will be uploaded there. BUT the form page, as well as this script that i'm sending you, must be published in "public_html", not in "public_html/upload"
3. The "action" fiels of your form must be set to "upload.php", This is how it invokes the script.
4. Please note that if the filenames are one word filenames, then the link that you receive in your email will be correct, and you will be able to open the file in IE by simply clicking on the link. If the file name has blanks in it, then the filename on the server is correct, but the link in the email only arrives to the blank space. In this case you should copy all the link and paste it in your browser to open the link. Of course, in all cases, you can also download the file using FTP
5. To work, the script needs your email address in your Vodahost account, not an external one. So, open the script in Notepad. Change the email address to be your email address on your Vodahost account. Go to Save As. Choose File Type "All Files". Save it as "upload.php". Upload it on your server, in your public_html directory.
Test the form and let me know.
I also sent the same message in your email
__________________ |