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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:14:36+00:00 2026-05-23T15:14:36+00:00

Seriously. My hosting company says that there’s something wrong with my Php code. I’m

  • 0

Seriously. My hosting company says that there’s something wrong with my Php code. I’m not getting any errors from them, and they say it’s not my CSS. Please help.

    <?php

/* Subject and Email Variables */

    $emailSubject = 'Bookem danno!';
    $webMaster = 'info@mywebsite.com';

/* Gathering Data Variables */

    $nameField = $_POST['name'];
    $cellField = $_POST['cell'];
    $emailField = $_POST['email'];
    $dateField = $_POST['date'];
    $timeField = $_POST['time'];
    $lengthField = $_POST['length'];
    $inoutField = $_POST['inout'];
    $seenbeforeField = $_POST['seenbefore'];
    $detailsField = $_POST['details'];
    $p411Field = $_POST['p411'];
    $datecheckField = $_POST['datecheck'];
    $tobField = $_POST['tob'];
    $terField = $_POST['ter'];
    $otherField = $_POST['other'];
    $screennameField = $_POST['screenname'];
    $companyField = $_POST['company'];
    $worknoField = $_POST['workno'];
    $switchboardnoField = $_POST['switchboardno'];
    $memoField = $_POST['memo'];
    $subscribeField = $_POST['subscribe'];

    $body = <<<EOD
<br><hr><br>
Name: $name <br>
Cellphone: $cell <br>
Email: $email <br>
Date: $date <br>
Time: $time <br>
Length of appointment: $length <br>
Incall Outcall: $inout <br>
Have I seen you before: $seenbefore <br>
Details: $details <br>
P411: $p411 <br>
Datecheck: $datecheck <br>
TOB: $tob <br>
TER: $ter <br>
Other: $other <br>
Screen Name: $screenname <br>
Company: $company <br>
Direct Line: $workno <br>
Switchboard: $switchboardno <br>
Memo: $memo <br>
Subscribe Me: $subscribe <br>
EOD;

    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body, $headers);

echo "$result";


?>
  • 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-23T15:14:37+00:00Added an answer on May 23, 2026 at 3:14 pm

    Ahem. You’re not using any of the variables you instantiated. For example, initially you say this:

    $emailField = $_POST['email'];
    

    And then you say this:

    $headers = "From: $email\r\n";
    

    There is no variable called $email. There is one called $emailField, but you’re not using that. In fact, ALL of the variables from your $_POST are getting renamed with “Field” at the end, and then you’re trying to refer to them later without the Field part. Won’t work.

    Also, You’ve got a security vulnerability in that code. Look:

    $headers = "From: $email\r\n";
    

    You’re assuming that $email is a nice safe value. Suppose somebody fills in your form and tells it their email address is 0wned@example.com\r\nBcc: emai1@example.net, email2@example.org, etc..., thereby causing your email server to send out hundreds or thousands of emails.

    A spammer might do it for the sake of sending spam — without having to maintain their own email server.

    A bored and malicious person might do it just for the kick of seeing your domain blacklisted as a spammer.

    An unethical corporate rival might do it to throw a monkey wrench into your ordering procedures in the hopes of driving your out of business. I am cursed with a good imagination…

    Do yourself a favor and try this:

    $email = str_replace( "\r\n", '', $_POST['email'] );
    

    That will strip out any potential CR/LF pairs, so that nobody can inject their own headers into your email.

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

Sidebar

Related Questions

With a seriously big .NET site/solution (100's of assemblies), are there any tools available
Not that it is seriously burdensome to type :My_custom_foobar() instead of just :my_custom_foobar() but
Is there any framework for querying XML SQL Syntax, I seriously tire of iterating
Apparently, they're confusing. Is that seriously the reason? Can you think of any others?
I seriously suck at getting the quotes and quotation marks correctly. is there a
Something is seriously not adding up here.. My page just refreshes, nothing happens, it
A reliable coder friend told me that Python's current multi-threading implementation is seriously buggy
I'm dealing with an issue with my current employer that has seriously made me
Seriously Parse error: syntax error, unexpected '<' on line 22 Code snippet from line
Seriously I'm confused. I have an .XSD that is made from a class so

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.