User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,823 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,962 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2130 | Replies: 48
Reply
Join Date: Mar 2008
Posts: 26
Reputation: Vity is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Vity Vity is offline Offline
Light Poster

Serious problem with attchments-please help

  #1  
Mar 15th, 2008
I Have visited a dozen of websites and registered with them but still none of them has helped me with my problem. I got a php script that i created that sends the results to a specific email address but the problem is that the attachments are not still working after countless attempts. THE ATTACHEDFILES DONT APPEAR IN THE MAIL.
SOME BODY PLEASE HELP ME .....................I REALLY NEED HELP AS SOON AS POSSIBLE.
HERE IS MY CODE PLEASE HELP WHERE HAVE GONE WRONG IN THE ATTACHMENTS PARTS.

  1. <?php
  2. $firstname = $_POST['FirstName'];
  3. $lastname = $_POST['LastName'];
  4. $day = $_POST['Day'];
  5. $month = $_POST['Month'];
  6. $year = $_POST['Year'];
  7. $Gender = $_POST['Gender'];
  8. $country = $_POST['country'];
  9. $Province = $_POST['Province'];
  10. $CityTown = $_POST['CityTown'];
  11. $emailaddress = $_POST['EmailAddress'];
  12.  
  13. // Add file attachment to the message
  14. $message .= "--{$mime_boundary}\n" .
  15. "Content-Type: {$fileatt_type};\n" .
  16. " name=\"{$picture_name}\"\n" .
  17. "Content-Disposition: attachment;\n" .
  18. " filename=\"{$fileatt_name}\"\n" .
  19. "Content-Transfer-Encoding: base64\n\n" .
  20. $data . "\n\n" .
  21. "--{$mime_boundary}--\n";
  22.  
  23. $lookingfor = $_POST['LookingFor'];
  24. $interestedin = $_POST['InterestedIn'];
  25. $Duration = $_POST['Duration'];
  26. $tnc_agree = $_POST['tnc_agree'];
  27.  
  28. $to = "ContiAds! <'datingavenue@contiads.co.za''mvity@yahoo.com'>";
  29. $subject = "RE: New Dating Avenue SignUp!";
  30. $body = "<html>".
  31. "<head>".
  32. "<title>Contact Request</title>".
  33. "<style type='text/css'>".
  34. "body,td,th {".
  35. "font-family: Geneva, Arial, Helvetica, sans-serif;".
  36. "font-size: 12px;".
  37. "}".
  38. ".style1 {font-size: 24px}".
  39. "</style></head>".
  40. "<body>".
  41. "<p align='center' class='style1'>ContiAds New Signup</p>".
  42. "<table width='498' border='0' align='center' cellpadding='5' cellspacing='0'>".
  43. "<tr>".
  44. "<td colspan='2' valign='top' bgcolor='#333333' height='2px'></td>".
  45. "</tr>".
  46. "<tr>".
  47. "<td width='104' valign='top'>Full Name:</td>".
  48. "<td width='374'>".$firstname." ".$lastname."</td>".
  49. "</tr>".
  50. "<tr>".
  51. "<td valign='top'>Date:</td>".
  52. "<td>".$Date."</td>".
  53. "</tr>".
  54. "<tr>".
  55. "<td valign='top'>Month:</td>".
  56. "<td>".$month."</td>".
  57. "</tr>".
  58. "<tr>".
  59. "<td valign='top'>Year:</td>".
  60. "<td>".$year."</td>".
  61. "</tr>".
  62. "<tr>".
  63. "<td valign='top'>Gender:</td>".
  64. "<td>".$Gender."</td>".
  65. "</tr>".
  66. "<tr>".
  67. "<td valign='top'>Country:</td>".
  68. "<td>".$Country."</td>".
  69. "</tr>".
  70. "<tr>".
  71. "<td valign='top'>Province:</td>".
  72. "<td>".$Province."</td>".
  73. "</tr>".
  74. "<tr>".
  75. "<td valign='top'>Email Address:</td>".
  76. "<td>".$EmailAddress."</td>".
  77. "</tr>".
  78. "<tr>".
  79. "<td valign='top'>Looking For:</td>".
  80. "<td>".$lookingfor."</td>".
  81. "</tr>".
  82. "<tr>".
  83. "<td valign='top'>Interested In:</td>".
  84. "<td>".$InterestedIn."</td>".
  85. "</tr>".
  86. "<tr>".
  87. "<td valign='top'>Duration:</td>".
  88. "<td>".$Duration."</td>".
  89. "</tr>".
  90. "<tr>".
  91. "<td colspan='2' valign='top' bgcolor='#333333' height='2px'></td>".
  92. "</tr>".
  93. "</table>".
  94. "</body>".
  95. "</html>";
  96.  
  97. //Always set content-type when sending HTML email
  98. $headers = "MIME-Version: 1.0" . "\r\n";
  99. $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
  100. $headers .= 'From: ' . $email . "\r\n";
  101. //$headers .= 'Cc: [email]myboss@example.com[/email]' . "\r\n";
  102.  
  103. if (mail($to, $subject, $body, $headers)) {
  104. ?>
  105. <script language="javascript" type="text/javascript">
  106. location.replace("Sign%20Up%20Success.htm");
  107. </script>
  108. <?php
  109. } else {
  110. ?>
  111. <script language="javascript" type="text/javascript">
  112. location.replace("Sign%20Up%20Failure.htm");
  113. </script>
  114. <?php
  115. }
  116.  
  117. ?>
Last edited by peter_budo : Mar 30th, 2008 at 4:38 am. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 153
Reputation: Suomedia is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
Suomedia Suomedia is offline Offline
Junior Poster

Re: Serious problem with attchments-please help

  #2  
Mar 15th, 2008
I dont see anywhere in your script where the values for the following variables are set:

$mime_boundary
$fileatt_type
$picture_name
$fileatt_name


It wont work if the values are empty.


Matti Ressler
Suomedia
Reply With Quote  
Join Date: Mar 2008
Posts: 26
Reputation: Vity is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Vity Vity is offline Offline
Light Poster

Re: Serious problem with attchments-please help

  #3  
Mar 15th, 2008
Hi there

COULD YOU PLEASE HELP ME ON HOW YOU GO ABOUT DOING THAT AND FIXING THE PROBLEM BECAUSE AT THE PRESENT MOMENT I AM LOST AND VERY VERY CONFUSED!

Regards
Reply With Quote  
Join Date: Mar 2008
Posts: 153
Reputation: Suomedia is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
Suomedia Suomedia is offline Offline
Junior Poster

Re: Serious problem with attchments-please help

  #4  
Mar 15th, 2008
Perhaps if you attach your form we can do something.


Matti Ressler
Suomedia
Reply With Quote  
Join Date: Mar 2008
Posts: 26
Reputation: Vity is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Vity Vity is offline Offline
Light Poster

Re: Serious problem with attchments-please help

  #5  
Mar 15th, 2008
Should it be a screen shot or web file.......? You could see it on www.contiads.co.za/Entertainment main/ dating avenue / dating avenue sign up

its one of the forms of three i have the same problem with on the site.
Reply With Quote  
Join Date: Mar 2008
Posts: 153
Reputation: Suomedia is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
Suomedia Suomedia is offline Offline
Junior Poster

Re: Serious problem with attchments-please help

  #6  
Mar 15th, 2008
You can attach a file using the paper clip icon you can see when replying to a post.


Matti Ressler
Suomedia
Reply With Quote  
Join Date: Mar 2008
Posts: 26
Reputation: Vity is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Vity Vity is offline Offline
Light Poster

Re: Serious problem with attchments-please help

  #7  
Mar 16th, 2008
I attached the screen shot to word document hope you able use it.
I don't know if this will also be helpful to you but here is the url address:

http://www.contiads.co.za/Ezone/Dati...0sign%20up.htm

regards
Attached Files
File Type: doc Doc1.doc (134.0 KB, 3 views)
Reply With Quote  
Join Date: Mar 2008
Posts: 26
Reputation: Vity is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Vity Vity is offline Offline
Light Poster

Re: Serious problem with attchments-please help

  #8  
Mar 20th, 2008
Somebody please help me please please, i'm under a whole load stress and pressure do to this thing....... please help with this attachment problems
Reply With Quote  
Join Date: Mar 2008
Posts: 153
Reputation: Suomedia is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 19
Suomedia Suomedia is offline Offline
Junior Poster

Re: Serious problem with attchments-please help

  #9  
Mar 20th, 2008
Its impossible without seeing your form - the link in your 3rd post is dead. The actual files would be much better.


Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Reply With Quote  
Join Date: Mar 2008
Posts: 26
Reputation: Vity is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Vity Vity is offline Offline
Light Poster

Re: Serious problem with attchments-please help

  #10  
Mar 20th, 2008
Please try the one on the 7th post...... Or http://www.contiads.co.za/Ezone/Dati...Osign%Up.htm....... But the one on the 7th post is more trustworthy.

Regards
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 8:39 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC