Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Could You Tell Me How To Attach My Folder


Could you tell me how to attach my folder. It will only let me send one at a time.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Attach Imagejpeg To Email
I'm trying to add an imagejpeg result as an attachment of an email.

For creating the email I'm using phpmailer class
(http://phpmailer.sourceforge.net/)
Now I do create an image from a jpeg file for adding some text on it and
then send it to somebody:
here is the code:
$image = "/include/images/model.jpg";
$src = imagecreatefromjpeg($image);
$size = getimagesize($image);
$dst = imagecreatetruecolor($size[0],$size[1]);
$txt_color = ImageColorAllocate ($dst, 0, 0, 0);
ImageString ($dst, 5, 90, 30 ,"my name", $txt_color);
$tempimage = imagejpeg($dst);
if (!$mail->AddstringAttachment($tempimage,"model.jpg"))
echo ("<strong>failure attachment file</strong><br>");

Instead of attachment file, I get the failure attachment file message on the
screen after a lot of text (the jpeg file in text format).

Attach Image To Email
I use e-mail forms on my site frequently for user feedback, and it works great. However; now I for one of the forms I want users to upload a picture (which will send to my email ) as well. I'm still pretty new to this so I'm not quite sure how to go about it. This is what I have now: Code:

Attach File To Email In A Form
I've got a newlsetter script, and I'd like to be able to attach a word document to the email, so thatwhen I hit submit, it will mail the email out to everyone on the list with the attachment included.

I know there is a lot on how to upload files to a server, but how do i attach something to my email message and send it out?

Send Mail With Attach File
I want to create form mail which can attach file. What can I do so that it send attach to another mail.

Uploading File To Attach To Email
I need to create a page that will upload a file and attach it to an email that
is coming to me. I have everything working great except the uploading part. Is
there an easy way to do this?

How To Attach The Files In Mail Using Php Codes..
How to attach the files in mail using php codes..

Attach Excel File With Mail
Can someone please help me with attaching an excel file with mail.

Email With Attach Without Imap Functions
I need to send a mail with an attach, but my server doesn't support imap functions. Do you know any perl or other function to send it?

Upload & Attach Files To Email
If i have something like below, how can i let the users actually upload and attach files,
PHP Code:

How To Attach POST Data To CURL
I'm trying to use CURL to submit XML requests to web service API's.  I've got everything working except that I can't figure out how to actually attach my own custom XML string request to the POST.  As such, I'm getting XML responses that simply say 'Invalid Request'. Here's what my CURL function currently looks like: Code:

Attach Files By Clicking The Image
How to attach files by using the image...by clicking the image it will come a pop up message (the attachment page with browser button)...and i can attach the files..

Drag Files From One Folder To Another Folder (copy) .. Possible?
Is it possible to write codings PHP or Javascript.. GUI representation
of File handling (ie. Drag files from one folder to another folder (copy)
like our windows).. pls give me some reference codings like this..

Attach JPG File" Option In An Email Form?
How do I programm "attach JPG file" option in an E-mail form? The file may not be bigger than 2 megabytes and must be sent to the email adress wich is programmed in my existing e-mail script. In return for a good solution I will give you something nice in return.

Remove From $name (folder)/(folder)/[x]/ <-- If Exists To Just Get [x].
I'll be quite honest. I don't have the faintest idea
how to do this, while I can do other php without a problem. Once I
know how to go about it I'll be okay.
It's two things I think?
1. see if there's a trailing slash and delete it.
2. Remove the preceding path to /x, the folders and slashes, and
delete them.
and then I have x.

X by the way is the final folder in a website and this grabs it for
me.

<?
$name = $REQUEST_URI;
?>

How To Get Folder Name Out Of
An easy one for somebody, but I have not got my head round it yet. I need to get the folder name out of a URL ie:

/support/desktop/documents/general/fa95e9e698c76fdc606f3b94fe89b48b/17_Import_data_en.pdf

$folder = fa95e9e698c76fdc606f3b94fe89b48b;

PHP 5.2 Doesn't Have Ext Folder?
I just downloaded and installed php v5.2, Apache 2.2 and mysql 5.0.27. I'm having the same problems as many regarding the "undefined function" error and am trying to work through it, but I'm noticing (via many of these troubleshooting tutorials) that people are talking about an "extensions" folder and a php-recommended.ini file and the such, and I notice that I don't have either in my installation of 5.2.

Did I download the "preferred" installation package? The one I downloaded is called php-5.2.0-win32-installer.msi.

I'm coming from a php 4.4.2 apache v1.3.31 and mysql v4.0.20a - all of which was lost during a major crash so I have nothing to compare these 5.2 files against.

If I've downloaded a "non-preferred" installer, could someone tell me which one I should install to get everything working properly -- or at the least to have a complete package.

Folder Name As A GET?
I currently have a website and would like to be able to give my members
an alias to access their profile. At the moment, people have to go to
something like www.domain.com/viewmember.php?id=3456, which isn't
practical unless it's through clicking links.

I'd like to be able to give my members the ability to use something
like www.domain.com/myname, which would then forward to the correct
page. The problem I can see is that the server thinks myname is
actually a folder and returns a 404 error.

Does anyone know of a way to do this?

Check For Folder
how would i check if there's at least one folder in the current folder? the current folder is $dir/$f/

this is what i have, but i know its wrong

$fillle = "$dir/$f/";
if (file_exists($fillle)) {$Q="true";} else{$Q="false";}

Folder Retrieval
I have managed to retrieve a list of pdfs that are in a folder and displayed them with a link to a new window:

<?php
//RETRIEVES FOLDERS CONTENTS
$dir = "/var/www/html/bbcl/building/projects/pdfs";
$folder = "/bbcl/building/projects/pdfs/";
$handle = opendir($dir);
while ($file = readdir($handle)) {
if ($file != "." && $file != "..") {
echo "<a href="$folder$file" target=new>$file</a><br>";
}
}
?>
But it also display's the name of folders that live there, anyway of specifing what file extensions to appear in the list?

Rename A Folder
Is there an easy way to rename a folder? A function I am missing?

Renaming A Folder
is there any way to rename a folder using PHP?

Getting And Using Contents In A Folder
I want to make a photogallery/slideshow with PHP...

The 'gallery/slideshow' would show up inside a new window.
basically, I just want links with possibility to go:

- forward
- back
- to the very beginning
- to the very end
- away (close the window)

Can I use PHP to determine the contents of the folder with the pictures and then use variables to determine which photo to show, and what URL's should be generates for the arrows? So each folder with a series of photographs would have one PHP file and the pictures themselves in them (it's not a problem to rename them).

Should be simple enough, but I'm just starting out with PHP, and I'd like to have something working as soon as possible... the website I'm working on is about to launch soon (my first 'commercial' web project :) ), and this is about the only thing left that I still have to sort out how to do...

Size Of Folder
how i get the size in k of a certain folder on mysite, i know i've done this before but can't think of what to look under at php.net.

Current Folder
Does anyone know easy way to find out the current folder where the script is? I tried to this but it doesn´t work in my Linux web-server, but it works in NT-desktop.

$dir1 = getenv(PATH_INFO);
$last = strrpos($dir1, "/");
$dir2 = substr ($dir1,0, $last);
$name = strrpos($dir2, "/");
$folder = substr($dir2,$name+1,20);

Folder Permission
I have a problem when i create a folder using the following php code:

<?php mkdir ("foltest/bleh", 0777); ?>

The problem is that the folder "bleh" doesn't have the 777 permission like I wish it did, but it has 755 instead. Is there something wrong with my code, or could this be caused by my host?

Folder Browser
I'm looking for some sort of php folder browser - basically if i have the following folders;

index
index/welcome
help
help/email
help/web
docs

in one pull down will display the folders index, help, and docs - where as menu 2 will display the folders that lie in index, help or docs.

The Root Folder
I've a web site in the address http://mySite.com
in the root, I've a file index.html

I've some subfiolders insid root/sub1/sub2

I like to add an html file (or php) index.html that call the index.html of
the root (in order to protect)
Now I've created 2 different index.html because I use relative path to
design the root (../index.html and ../../index.html)

I like to have the same file in all folders,but I don't know how to call the
root folder.

Folder Permissions
My trouble might be simple, but I'm quite new to php, and, perhaps I'm even
more simple.
It's that I had to chmod 777 two folders to get my scripts do what I wanted
them to do, and I don't like it.
I have a script running on my ISP's unix-apache -server. It is to read
string from a form, and create a text-file in a subfolder 'txt' from it.
The essential parts of the script is here:

$fnam=$HTTP_POST_VARS[filename];
$handle =fopen("txt/".$fnam, "w");
$teksti=$HTTP_POST_VARS[tekstikentta];
touch('txt/'.$fnam);
fwrite($handle,$teksti);
fclose($handle);

Can't be simpler.
This script didn't work until I did a chmod777 for both folders, the one
where this script is, and the 't' subfolder. Is there a way to get around
this?

Folder Loop
i have a folder called "profile_images" how do I loop through the images in this folder, and echo each filename guys?

Getting Contents Of Folder
I've made half of the code for a little "hosting" site for a few of the members of my site. Their files are uploaded to /login/<username>/

I'm now stuck as to how to show the contents of the folder in a page. I think the use of fopen() is needed, however the php website is a little confusing.

Getting The Size Of A Folder
All Ive been trying to do is make a short php script (embedded in the html, no separate file) that simply displays how much space, in megabytes, the contents of a certain folder is taking and use an echo command to display it. I've tried the filesize command and it always gives me 4,096 regardless of the contents. I assume this is because PHP is taking the size of the actual folder. I've tried disk_total_space but this displays a number that is completely off.

How Do I Add A New File To A Folder?
Say I want to add a file named 123.php to the folder /xxxx/ How would I do that using php and a form? Is there a function or a tutorial?

Delete Folder FTP
I am trying to delete a folder and all of its contents (folders, files) through ftp. I am trying to modify a script for deleting it locally. I don't get any errors with this, but nothing happens. Can someone point me in the right direction? Code:

Deleting Folder
is there anyway of deleteing a folder and deleting all of its contents with it?
i know that with rm_dir needs to folder to be emptied

How Much Space A Folder Is Taken Up
How is everyone? Well I was just wondering if somebody got teach me how to make a PHP Script which tells you how much space a folder is taken up? Example: I have a folder called ./files, I want a script which will tell me howmuch space its taken up .

Check If A Folder Contains Anything
what do I use to check if a directory contains anything.

For example how do I check if there is anything in this? (Which in english is something like news/download/may2007/document1.doc

UPLOADS_PATH.'/news/download/'.$oDownload->download_path.'/'.$oDownload->download

Copy Folder?
I want to copy a folder, subfolder, files, and subfiles.  I don't care about attributes. I thought about making the folder a zip, and then using extract but that was confusing and took too long on the server.

so what do I do?  Is there a script that will parse the dir and COPY all the files?

Folder Permission 777
I need to upload pictures for a photo gallery but in order to work the upload, the folder's permissions must be 777. ( or am I wrong?). chmod 777 as read thousand times is not secure so what can I do?

Check if the folder and change the permissions before and after the upload? Is this secure?

INCLUDE'ing To A Different Folder..?
I've got a file structure

-www (containing normal site files)
-www/inc (containing includes like db.php, session.php etc)
-www/accounts (containing an area for customer login)

I'm working on www/accounts/signup.php and am trying to use the following code:

<?php
include "/inc/session.php";
?>
...so that certain session elements can be set. however, I'm getting an error

Warning: include(/inc/session.php) [function.include]: failed to open stream: No such file or directory in E:XAMPPxampphtdocsmysiteaccountssignup.php on line 3 (I'm using Xampp as a testing server as well as my live server)

 - I've tried various combo's of paths to the sessions file, but the server is not allowing a proper include to it.

Upload Folder
I have this code:

$uploaddir = dirname($_SERVER['SCRIPT_FILENAME']) ."/Images/";

and it uploads the image to /admin/images/ as the page i'm running it from is in the admin directory.

I've tried just using the http:// and it doesn't like it. Could someone please tell me how i can make it upload the image to /images/ instead of within the admin folder.

Getting All The Sub Directories In A Folder.
I want to return all the subfolders in a given folder any idea? I thought glob can only do files.

How To Protect A File Or Folder?
I want to protect my URL
How to realize the following function?
Users click on the URL, a login htm page appears. Users enter username, password and click on the submit button. PHP file consults mySQL to get username, password and registration date. If user account is valid, user may download this software.

How To Delete An Undeletable Folder!
I run PHP5 and was testing a script to allow users sampling a demo script
But to keep security high asides the usuals I create a new folder and a new set of scripts per each required demo with a folder extension created by a rand function. So first the folder is created and a set of tpl are copied in the new folder and written on.

To make a story short:
While testing on the production server I found some bugs and fixed them but the first trial attempt created a folder with a set of files that weight exactly as the tpl copied from and do have a correct PHP extension but refuses to be deleted or renamed or schmod etc... via FTP

Now that I am bugless I can indeed do whatever with then newly created folders and files but still cannot delete my first test.

When I try to del it it goes away but if I refresh it’s back there!

How To Get The Files Names From The Folder Using PHP ..
How to get the files names from the folder using PHP .. is there any
specific command. If yes let me know that..

Folder/File Perms...
I made a PHP script that creates a new folder (say "Folder 1") and then copies a file from the parent folder (call the file "index.php") into the new folder; so we get Folder 1/index.php

Now, how can I set the ownership of this file and folder, automatically via the PHP script, to me (the server user), not httpd?

Restrict PHP Usage From A Folder
Here's the context: We have a server and have been hosting our own websites for a while. But now, a customer wants to have FTP access in order to manage his static, non-PHP website. I found a solution that seems to work and would like to know if it is safe enough to be used.

I added:
<Location />
ForceType text/html
</Location>

To hpptd.conf file in the vhost entry of my customer's website. It seems to work fine, as all .php files are not parsed by php anymore.

It is not easy nor possible to change the global configs of the httpd.conf and not possible also to install a separate apache server.

So, do you believe that this is an appropriate solution?

Paging Of Folder Files
i have a form which has a select button when user clicks it a popup opens which shows all images in abc folder
 
when user clicks on any image the window closes and the name of that image is entered in the text box in parent form, now its working fine uptill here but if user refresh the popup window then it disconnects from parent window so my code that fills the textbox in the parent form and closes the popup window does not work anymore im using it like parent.document.form.texthox.value=abc since popup window is refreshed it does not work as child any more and this code does not work.

Files And Folder Copying
I am trying to write a function to copy an existing folder and folder
structure but am already stuck.

What I want to do is the following:

Copy a default folder (default_folder) and all sub folders within it (down
to a possible 4 levels)
eg default folder
->subfolder1
->subfolder2
->sub subfolder1
->sub sub folder 2

I have a form where the user can enter the name of the new folder and an
option to confirm if they want to copy the files also located within the
default folder.
If the checkbox is not checked then copy just the folder structure only

Can this be acheived in one function or will it be based on 2 where a set of
empty folders are created and where the folders and files are copied over

PHP 4.3.8 On WinXP - No Sapi Folder??
I am so confused right now. I installed 4.3.8 on my computer and am reading
the install notes for apache. It refers to all these dlls and the sapi, but
under c:php, I don't see any of that stuff! What is going on here?


Copyright © 2005-08 www.BigResource.com, All rights reserved