Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6063029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:07:08+00:00 2026-05-23T09:07:08+00:00

I’m trying to create an RMA form and I have everything working except the

  • 0

I’m trying to create an RMA form and I have everything working except the upload + email attachment.

What I’m trying to do is have the customer upload a scanned copy of their document (in jpeg,gif,png,pdf,word etc formats) but I can’t seem to get things going. I’m up on various file upload methods, but I can’t seem to figure out where to begin.

This is my php code so far

$name=$_POST['first'] ." ".$_POST['last'];
$email=$_POST['email'];
$address=$_POST['street'] ." ". $_POST['city'] ."".$_POST['province'] ." ".$_POST['postal'];
$pod=$_POST['pod'];
$sku=$_POST['sku'];
$description=$_POST['description'];
$problem=$_POST['problem'];
$case_id=$_POST['case_id'];
$status=$_POST['status'];
$phone=$_POST['parea'] ."".$_POST['pfirst'] ."".$_POST['plast'];
$tracking=$_POST['tracking'];
$date=$_POST['date'];

$link = mysql_connect('m', 'sk', 's1'); 

if (!$link) 
{

die('Could not connect: ' . mysql_error()); 
}

mysql_select_db(s);
$status = "Pending";
$tracking = "";
$date = date('c');
$case_id = mt_rand(1252,10000);

while( $fetch = mysql_fetch_array( mysql_query("SELECT `case_id` FROM `webform` WHERE `case_id` = $case_id") ) )
{
$case_id = mt_rand(1252,10000);
}
//$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){
$error.="Invalid email address entered";
$errors=1;
}
if($errors==1) echo $error;
else{
$values = array ($name,$phone,$email,$address,$pod,$sku,$description,$problem);
$required = array($name,$phone,$email,$address,$pod,$sku,$description,$problem);

$your_email = "fahad@home.com";
$email_subject = "RMA: ".$case_id;
$email_content = "new message:\n";

foreach($values as $key => $value){
  if(in_array($value,$required)){
    if ($key != $phone && $key != $address) 
    $email_content .= $value.' '.$_POST[$value]."\n";
  }
}

if(@mail($your_email,$email_subject,$email_content,$case_id)) {
    echo 'Request Submitted!<br />';
    echo 'RMA:'. $case_id; 
} else {
    echo 'ERROR!';

}

}

$queries = array ($values, $case_id);
$piece = implode(",",$queries);
mysql_query("INSERT INTO `webform` (`case_id`, `name`, `phone`, `email`, `address`, `pod`, `sku`, `description`, `problem`, `status`, `tracking`, `date_recieved`) VALUES ('$case_id', '$name', '$phone', '$email', '$address', '$pod', '$sku','$description', '$problem', '$status', '$tracking', '$date')")

or die(mysql_error());
mysql_close($link);


?>

So basically, I’m not sure where to place the file upload section or even how to use it. I have a working html design for it that brings up the file browser and everything, I just don’t know how to link that process to the php side, and then after uploading attach that to the email.

Thank you kindly in advance for everyone’s help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:07:08+00:00Added an answer on May 23, 2026 at 9:07 am

    I wouldn’t.

    My company sends millions of emails monthly and email attachments are the biggest single problem that we have. Bottom line, you attach things and you raise the chances of being blocked or flagged for spam by a significant factor.

    Send a link instead. Use a unique hash identifier in the link that the person can click to initiate a download. It makes for a smaller email, more spam friendly delivery, easier coding for you, and happier customers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.