Jump to content

Recommended Posts

I had this code done for me...for a client....but the most important part is not working...it is supposed to email the form to an email address but it doesn't...the variables for the email are at the end...any help is much appreciated...have a huge deadline

 

<?php

if(!empty($_REQUEST['attn']) && $_REQUEST['attn']=='signup')

{

$to="andy@clayarc.com";

$attn=$_REQUEST['attn'];

$ip=getenv("REMOTE_ADDR");

$custtype=$_REQUEST['custtype'];

$bizname=$_REQUEST['bizname'];

$name=$_REQUEST['name'];

$address=$_REQUEST['address'];

$city=$_REQUEST['city'];

$zip=$_REQUEST['zip'];

$email=$_REQUEST['email'];

$utility_name=$_REQUEST['utility_name'];

$utility_number=$_REQUEST['utility_number'];

$pod_number=$_REQUEST['pod_number'];

$name_key=$_REQUEST['name_key'];

$meterday=$_REQUEST['meterday'];

$phone=$_REQUEST['phone'];

$fax=$_REQUEST['fax'];

$referral=$_REQUEST['referral'];

$position=$_REQUEST['position'];

$sig=$_REQUEST['sig'];

 

 

$message = "From: $name ($email)\n

Customer Type: $custtype \n

Legal Company Name: $bizname \n

Your Name: $name \n

Street Address: $address \n

City: $city \n

Zip Code: $zip \n

Email Address: $email \n

Current Distribution Provider: $utility_name \n

Account Number: $utility_number \n

POD Number: $pod_number \n

Name Key: $name_key \n

Meter Read Date: $meterday \n

Phone Number: $phone \n

Fax Number: $fax \n

Referred By: $referral \n

Position: $position \n

E-Signature: $sig \n

Additional Info : IP = $ip \n

";

 

$from = "From: $name ($email)\r\n";

if(mail($to=jlaperch@charter.net; $subject, $message, $from))

@header("location:thanks.php");

else

@header("location:index.php");

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/135219-need-a-fix-quick/
Share on other sites

Change:

<?php
$from = "From: $name ($email)\r\n";
if(mail($to=jlaperch@charter.net; $subject, $message, $from))
@header("location:thanks.php");
else
@header("location:index.php");
}
?>

 

to:

<?php
$from = "From: $name ($email)\r\n";
if (mail($to = 'jlaperch@charter.net'; $subject, $message, $from)) {
    @header("location:thanks.php");
} else {
    @header("location:index.php");
}
?>

Link to comment
https://forums.phpfreaks.com/topic/135219-need-a-fix-quick/#findComment-704305
Share on other sites

First off provide more info and don't have the title "Need a quick fix" we are here to help, but we do not profit from it so don't expect people to help you because you need a quick fix.

 

Look at this and learn about headers for the mail function

http://uk2.php.net/manual/en/function.mail.php

 

Your code slightly improved

<?php
error_reporting(E_ALL);
if(!empty($_REQUEST['attn']) && $_REQUEST['attn']=='signup')
{
$to="andy@clayarc.com";
$attn=$_REQUEST['attn'];
$ip=getenv("REMOTE_ADDR");
$custtype=$_REQUEST['custtype'];
$bizname=$_REQUEST['bizname'];
$name=$_REQUEST['name'];
$address=$_REQUEST['address'];
$city=$_REQUEST['city'];
$zip=$_REQUEST['zip'];
$email=$_REQUEST['email'];
$utility_name=$_REQUEST['utility_name'];
$utility_number=$_REQUEST['utility_number'];
$pod_number=$_REQUEST['pod_number'];
$name_key=$_REQUEST['name_key'];
$meterday=$_REQUEST['meterday'];
$phone=$_REQUEST['phone'];
$fax=$_REQUEST['fax'];
$referral=$_REQUEST['referral'];
$position=$_REQUEST['position'];
$sig=$_REQUEST['sig'];


$message = "From: $name ($email)\n
Customer Type:   $custtype \n
Legal Company Name:   $bizname \n
Your Name:      $name \n
Street Address:   $address \n
City:   $city \n
Zip Code:   $zip \n
Email Address:   $email \n
Current Distribution Provider:   $utility_name \n
Account Number:   $utility_number \n
POD Number:   $pod_number \n
Name Key:   $name_key \n
Meter Read Date:   $meterday \n
Phone Number:   $phone \n
Fax Number:   $fax \n
Referred By:   $referral \n
Position:   $position \n
E-Signature:   $sig \n
Additional Info : IP = $ip \n
";

$from = "From: $name ($email)\r\n";

if(mail($to=jlaperch@charter.net; $subject, $message, $from))
	header("location:thanks.php");
else
	header("location:index.php");
}

?>

what are the variables up top for...of my original code...seems like that is where i need to make the change but that does not work...nor does your code

You did write this code?

If not then don't use it if you don't understand it.

Here is a tutorial using php mail as a contact form

http://djw-webdesign.awardspace.com/code.php?snippet=10

Link to comment
https://forums.phpfreaks.com/topic/135219-need-a-fix-quick/#findComment-704337
Share on other sites

There was a typo in my code :(

 

<?php
$from = "From: $name ($email)\r\n";
if (mail($to = 'jlaperch@charter.net', $subject, $message, $from)) {
    @header("location:thanks.php");
} else {
    @header("location:index.php");
}
?>

 

Also, turn error reporting on by placing the following at the top of your script:

 

<?php
// Report all PHP errors
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
?>

Link to comment
https://forums.phpfreaks.com/topic/135219-need-a-fix-quick/#findComment-704340
Share on other sites

listen i want to understand and i didn't mean to piss anyone off...if i am using the wrong forum i'm sorry...

 

how should i have written this up..

 

not trying to be a jerk

 

i actually paid someone from this forum to help me...so not looking for free work...but he is not around and i am on deadline

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/135219-need-a-fix-quick/#findComment-704343
Share on other sites

You don't need to do

<?php
// Report all PHP errors
error_reporting(E_ALL);

// Same as error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
?>

 

They are both the same things

 

you only need to use one

 

listen i want to understand and i didn't mean to piss anyone off...if i am using the wrong forum i'm sorry...

 

how should i have written this up..

 

not trying to be a jerk

 

i actually paid someone from this forum to help me...so not looking for free work...but he is not around and i am on deadline

Look at the tutorial link i posted, and learn PHP and fix the code.

I have posted some modifications to show if there are any errors but there could be a number of things wrong, otherwise post in the freelance section asking for someone to write it for you.

Link to comment
https://forums.phpfreaks.com/topic/135219-need-a-fix-quick/#findComment-704345
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.