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 8300371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:32:34+00:00 2026-06-08T16:32:34+00:00

I am having an issue when sending e-mail using php code. I have a

  • 0

I am having an issue when sending e-mail using php code. I have a form which sends an attachment to a folder and the name of the attachment to the database, in order to then send the link of the file inside the message.

The problem is that the file and all the rest go the way it should but I can’t seem to create the link.

Here is the code:

$email = $_REQUEST['email'] ;
$to = $_REQUEST['to'] ;
$subject = $_REQUEST['subject'] ;
$message = ''.$_REQUEST['message'].'<a href="http://lamyse.net/images/'.$file_name.'"> download</a>';



$sql="SELECT file  FROM login_admin WHERE user_name='dori'";
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result)) {


$file_name = $row['file'];}
    
  
mail($to, $subject, $message, "From:" . $email);
 
$photo =$_FILES['file']['name'];

$target = "images/";
$target = $target . basename( $_FILES['file']['name']);

Thanks!

  • 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-06-08T16:32:35+00:00Added an answer on June 8, 2026 at 4:32 pm

    You don’t get $file_name until a few lines after you try to use it. Quick fix would be to move

    $message = ''.$_REQUEST['message'].'<a href="http://lamyse.net/images/'.$file_name.'"> download</a>'; 
    

    below your while loop.

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

Sidebar

Related Questions

I'm having issues sending emails using the php mail() function. I know the php
Experts, I'm having issue when sending emails out. Currently, I have a feedback form
I'm having an issue with sending an order e-mail from Drupal (Ubercart). I actually
Having some trouble sending properly formatted HTML e-mail from a PHP script. I am
I am having an issue with ajax sending values to my PHP script for
I'm having a problem.. Actually I do have an issue when sending a value
Im having issue with mail sending In web.config file <mailSettings> <smtp from=xxxx@companyname.com> <network host=mail.authsmtp.com
I have the following application which replicates an issue I'm having in a larger
I am having an issue with sockets where the data I'm sending is getting
Hi guys I am having issue I have this query: SELECT * FROM useraccount

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.