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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:14:29+00:00 2026-06-07T12:14:29+00:00

I need to paste data received as e-mail text files into an html form

  • 0

I need to paste data received as e-mail text files into an html form that sends the data to a mysql database via a php file that filters the data into the relevant cells in the mysql table.

The data arrives and is copied into an input box like this:

First name: John
Last name: Smith
telephone: 01234 56789

What php would remove “First name:” from the string and post “john” into the first name column of the database likewise with “Last name” and “telephone”

building the html form and database is not a problem; my php though is not quite yet up to speed!

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-06-07T12:14:31+00:00Added an answer on June 7, 2026 at 12:14 pm

    As I understand you receive plain text emails with data.

    Then you want to parse it. If your ‘labels’ are automatically generated and consistent then you can parse it quite easily… say something like this:

    Say you load your email text into a variable $email_content.

    $lines = explode("\n",$email_content);
    $array_of_values = array();
    foreach ($lines as $line) {
        if (str_pos(":",$line)!==false) {
            $temp_array = explode(":",$line);
            $array_of_values[trim($temp_array[0])] = trim($temp_array[1]);
        }
    }
    

    In the end you will have an array like this:

    array(
        'First Name'=> 'John',
        'Last name' => 'Smith',
        'telephone' => '01234 56789'
    )
    

    Then you will be able to easily access whichever value you like by key and subsequently save it to database if you like.

    There are certain assumptions though – that you only have : in lines that contain label:value pairs. Also end of the line char is always /n. But this is just a pointer not a ready made solution.

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

Sidebar

Related Questions

I have several hundred GB of data that I need to paste together using
I need to Open a process (easy) and then somehow paste data from my
I need to paste a string of text to whichever application is open, and
if i have a user entering data into a rich text editor (tiny editor)
I have a task at work that involves converting legacy SGM files into XML.
I need to paste, element by element, the contents of two data frames for
I have a function called InputFilter that I use for validating/sanitizing form data and
I need to select past 30 days data and find the no: rows....i am
We need to stop copy paste of few characters like '<' or '>' or
I need to refactor a .dll for a Zinc based Flash application. After copy&paste

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.