File attachement

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
madu
Forum Commoner
Posts: 32
Joined: Sat Dec 25, 2010 3:19 am
Location: india

File attachement

Post by madu »

Hi friends,
now i am doing mail sending with attachment.i got
code for mail send with attachment but when i a integrate this with my
module i got some problem.here the following file is separate code for
sending mail with attachment,
http://pastie.org/1536601

the above code works.Now My module containing two files,
//mailj.php
http://pastie.org/1536609

//send.php
http://pastie.org/1536622

But mail not sent.there are two warning coming ,

Warning: key() [function.key]: Passed variable is not an array or
object in /home/lumiinc1/public_html/group/sent1.php on line 23

Warning: file_get_contents() [function.file-get-contents]: Filename
cannot be empty in /home/lumiinc1/public_html/group/sent1.php on line
30

i want to sent mail with attachment.please help me.please
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: File attachement

Post by Jade »

Your first warning means your SQL query returning no results here:

Code: Select all

$sql = "select field_email1_email from content_type_job where nid = $v";

$r = mysql_query($sql) or die("Error in query execution");

$t =mysql_fetch_assoc($r);
Second is I've never seen anyone use a form $_GET action to upload a file -- I'm not sure if it's even possible to upload a file that way. I bet the data is being truncated somewhere along the way. Change you form to use a method of POST then change your $_GET variables to $_POST.
Post Reply