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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:02:51+00:00 2026-05-24T03:02:51+00:00

so im learning php (begginer if you cant tell) and, im currently pushin/pulling data

  • 0

so im learning php (begginer if you cant tell) and, im currently pushin/pulling data from the db to a page so that it can then populate other parts of the page and when “send” is hit, it puts it all together and sends right…

my question is,

i know to set for example:

$to = 'email@gmail.com'; 
$subject = 'test from my email php script'; 
$email = $_POST['email']; 
$name = $_POST['fname']; 
$lastname = $_POST['lname']; 
$mssg = $_POST['mssg'];

but how does php or the mail app on the server know which field goes where since these are
self made variables???

so for example if i say:

mail($to, $subject, $name, $lastname, $mssg);

how does it know to put say “subject” in the emails subject area and not all together in the mesage field etc?

i have a few pages open but none explain the WHY or better et, the HOW

thanks in advance.

  • 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-24T03:02:52+00:00Added an answer on May 24, 2026 at 3:02 am

    The mail() function expects your arguments to it to be in a certain order, so that it knows which values are for what. Then it builds the proper email headers based on what you gave it, and passes it to the email server to send off.

    p.s. – your example is wrong. mail() would return an error because of that. Take a look at the manual entry for mail() to see what it expects and where http://www.php.net/manual/en/function.mail.php

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

Sidebar

Related Questions

I'm currently learning PHP and MySQL and I have been working from a basic
I'm currently learning PHP and MySQL. I'm just wrote a class that handles all
When learning new languages such as C++ from PHP, does reading other language snippets
I'm still learning PHP Regex so I'm hoping someone can help me with what
When I was learning PHP, I read somewhere that you should always use the
Here is my following tutorial code from Learning PHP MYSQL and Javascript by OReilly.
I am learning PHP (no programming experience) from a book. The examples in the
Hi i am new to php, I currently learning php using eclipse. I know
I jut recently started learning PHP from a book called PHP/MySQL Programming for the
Just learning PHP and I'm having some trouble understanding mysql_query. My understanding is that

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.