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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:36:10+00:00 2026-06-07T21:36:10+00:00

I have very limited knowledge of PHP so I used a contact form generator,

  • 0

I have very limited knowledge of PHP so I used a contact form generator, but it does not function properly. The email does send successfully, but only the “email” and the “option” popups gets detected. Anything else returns empty.

Here is the code.

form.php

<?=$message?>

<form id="FormName" action="send.php" method="post" name="FormName">

<table width="448" border="0" cellspacing="2" cellpadding="0">

<tr><td width = "150" align="right"><label for="EmailFrom">Your E-mail</label></td>

<td><input id="EmailFrom" type="text" name="EmailFrom" size="25"></td></tr>

<tr><td width = "150" align="right" valign="top"><label for="text_field">text field</label></td>

<td valign="top"><input id="text_field" name="text_field" type="text" size="25" value="<?=$text_field?>" maxlength="255"></td></tr><tr><td width = "150" align="right" valign="top"><label for="hello_world_1">Hello world 1</label></td>

<td valign="top"><input id="hello_world_1" name="hello_world_1" type="checkbox" value="Y"></td></tr><tr><td width = "150" align="right" valign="top"><label for="hello_world_2">Hello world 2</label></td>

<td valign="top"><input id="hello_world_2" name="hello_world_2" type="checkbox" value="Y"></td></tr><tr><td width = "150" align="right" valign="top"><label for="hello_world_3">Hello World 3</label></td>

<td valign="top"><input id="hello_world_3" name="hello_world_3" type="checkbox" value="Y"></td></tr><tr><td width = "150" align="right" valign="top"><label for="text_area">text area</label></td>

<td valign="top"><textarea id="text_area" name="text_area" rows="4" cols="40"><?=$text_area?></textarea></td></tr><tr><td width = "150" align="right" valign="top"><label for="popup">popup</label></td>

<td valign="top"><select id="popup" name="popup" size="1">

<option value="Option 1"<?php if($popup == "Option 1"){echo " selected";}?>>Option 1</option>

<option value="Option 2"<?php if($popup == "Option 2"){echo " selected";}?>>Option 2</option>

<option value="Option 3"<?php if($popup == "Option 3"){echo " selected";}?>>Option 3</option>

</select></td></tr><tr><td width = "150" align="right" valign="top"><label for="date">date</label></td>

<td valign="top"><input id="date" name="<?=$date?>" type="text" size="25" value="<?=$date?>" maxlength="255"></td></tr><tr><td width = "150" align="right" valign="top"><label for="hidden">hidden</label></td>

<td valign="top"><input type="hidden" name="hidden" value="<?=$hidden?>"></td></tr><tr><td width = "150" align="right" valign="top"><label for="image">image</label></td>

<td valign="top"><input type="hidden" name="hidden" value="<?=$hidden?>"></td></tr><tr>

<td width="150"></td>

<td>

<input type="submit" name="submitButtonName" value="Send E-mail"></td>



</tr>

</table>

</form>

send.php

<?php

$EmailFrom = $_POST['EmailFrom'];

$text_field = trim($_POST['text_field']);

$hello_world_1 = trim($_POST['hello_world_1']);

$hello_world_2 = trim($_POST['hello_world_2']);

$hello_world_3 = trim($_POST['hello_world_3']);

$text_area = trim($_POST['text_area']);

$popup = trim($_POST['popup']);

$date = trim($_POST['date']);

$hidden = trim($_POST['hidden']);

$image = trim($_POST['image']);



$EmailTo = "nomail@nomail.com";

$Subject = ""; /// Add a subject



$validationOK=true;

if (trim($EmailFrom)=="") $validationOK=false;

if (!$validationOK) {

  echo "Error! E-mail was not sent. Please check you code.";

  exit;

}





$Body = "";

$Body .= "text field:\n$textfield\n\n";

$Body .= "Hello world 1:\n$helloworld1\n\n";

$Body .= "Hello world 2:\n$helloworld2\n\n";

$Body .= "Hello World 3:\n$helloworld3\n\n";

$Body .= "text area:\n$textarea\n\n";

$Body .= "popup:\n$popup\n\n";

$Body .= "date:\n$date\n\n";

$Body .= "hidden:\n$hidden\n\n";

$Body .= "image:\n$image\n\n";



if($Subject == NULL) {$Subject = "From $EmailFrom";}

$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");



if ($success){ echo "Success! Your e-mail was sent!";}

else{  echo "Error! Your e-mail was not sent!";}

?>

Why does it not function? Also, if you could recommend a working php form generator, that would be very helpful. I require both checkbox and popup/radiobutton.

  • 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-07T21:36:12+00:00Added an answer on June 7, 2026 at 9:36 pm

    Your variables are named like “$text_field” (with underscore) but when appending to $Body you do not use the underscores, e.g. “$textfield”. Thus the variable “$textfield” is not even set, meaning empty.

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

Sidebar

Related Questions

I recently pickup Java so I have very limited knowledge, but I would like
I have a very limited knowledge on AS400 and RPG. But we have a
I have limited knowledge of php and mysql, I am trying to learn it
I have very limited coding knowledge of OpenGL/Glut. I'm supposed to build house and
I have very limited knowledge of C#. My goal is to provide a C++
I'm unfamiliar with asyncore , and have very limited knowledge of asynchronous programming except
I have a questions here about MySQL replication. I have a very limited knowledge
I have very limited knowledge of using C Builder, could you give me an
I have a very limited channel within which to send messages and signatures, and
I have very little experience using Sharepoint but a good amount using Visual Studio

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.