Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

help with contact form

Featured Replies

i have a contact form that sends me info, but doesnt display it in the email, can anyone help? here is the code..

 

form

 

<form name="form1" method="post" action="send_membership.php">
<table width="300" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="100">Subject</td>
<td width="200"><input name="subject" disabled="disabled" type="text" id="subject" value="Membership" size="30"></td>
</tr>
<tr>
<td>First Name</td>
<td><input name="firstname" type="text" id="firstname" size="30"></td>
</tr>
<tr>
<td>Last Name</td>
<td><input name="name" type="text" id="lastname" size="30"></td>
</tr>
<tr>
<td>Email</td>
<td><input name="customer_mail" type="text" id="customer_mail" size="30"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
</form>

 

php

 

<?php header("Refresh: 5;url=http://www.mydomain.com/"); ?>

<?php

// Contact subject
$subject ="$subject"; 

// Details
$message="$firstname";

// Mail of sender
$mail_from="$customer_mail"; 

// From 
$header="from: $firstname <$mail_from>";

// Enter your email address
$to ='willows1990@gmail.com';
$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email 
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information, please <a href='index.php'>click here</a> to go back";
}
else {
echo "ERROR";
}
?>

 

 

 

 

I just want it to display like this in the email

 

membership

first name

last name

email

Edited by Renaissance-Design

theres nothing getting the posted values on the PHP file

 

php file should be something like this

 

<?php header("Refresh: 5;url=http://www.mydomain.com/"); ?>

<?php


$firstname = $_POST['firstname']; //this gets the posted values and puts them into a variable 
$name = $_POST['name'];
$customer_mail = $_POST['customer_mail'];
$subject = $_POST['subject'];

$message="Name: $firstname $name<br />
Email: $customer_mail
Membership: $subject";

$header="from: $firstname <$customer_mail>";

// Enter your email address
$to ='willows1990@gmail.com';
$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email 
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information, please <a href='index.php'>click here</a> to go back";
}
else {
echo "ERROR";
}
?>

 

the inputs should be sanitised to prevent hacking and a captcha or something along those lines would be helpful to avoid spamming

Edited by Renaissance-Design

  • Author

theres nothing getting the posted values on the PHP file

 

php file should be something like this

 

<?php header("Refresh: 5;url=http://www.mydomain.com/"); ?>

<?php


$firstname = $_POST['firstname']; //this gets the posted values and puts them into a variable 
$name = $_POST['name'];
$customer_mail = $_POST['customer_mail'];
$subject = $_POST['subject'];

$message="Name: $firstname $name<br />
Email: $customer_mail
Membership: $subject";

$header="from: $firstname <$customer_mail>";

// Enter your email address
$to ='willows1990@gmail.com';
$send_contact=mail($to,$subject,$message,$header);

// Check, if message sent to your email 
// display message "We've recived your information"
if($send_contact){
echo "We've recived your contact information, please <a href='index.php'>click here</a> to go back";
}
else {
echo "ERROR";
}
?>

 

the inputs should be sanitised to prevent hacking and a captcha or something along those lines would be helpful to avoid spamming

 

 

 

sorry for late reply, havent been in the office, this worked great thank you very much

Edited by Renaissance-Design

  • Author

Could you do me a favour and delete this thread as it shows up in the Google Listings when searching for the [redacted], thank you

Edited by Renaissance-Design

Nope. What I can do is remove all mention though. In future, anonymize your posts.

 

We kinda like leaving problems and solutions visible in case they can help someone else.

Edited by Renaissance-Design

  • Author

Nope. What I can do is remove all mention though. In future, anonymize your posts.

 

We kinda like leaving problems and solutions visible in case they can help someone else.

 

 

Thanks for your help Renaissance

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.