Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Having trouble with SIMPLE PHP Contact form... HELP!
Old 11-07-2009, 09:14 PM Having trouble with SIMPLE PHP Contact form... HELP!
Average Talker

Posts: 17
Name: Chris
Trades: 0
Okay, so I am helping a non-profit company with their website. As of right now I've got a simple .php file sending the email to the owner. No database.

Right now I am in the testing phase.

Well, I get the success page when I fill it out and hit submit. But no E-mail.

I uploaded it to a different server and it worked GREAT... but in all of my fields it is chopping off one character.

1). What can I change to get the non-profit server to allow me to use the simple .php script to send an Email? Never had an issue with this script before, and like I said, it WORKS on a different server.

2). What would cause a php script to chop the last character off when it sends? Ex: Instead of "Test" I got "Tes".

Here's the PHP script:

PHP Code:
<?php
// Receiving variables
@$pfw_ip$_SERVER['REMOTE_ADDR'];
@
$Send_product_literature addslashes($_POST['Send_product_literature?']);
@
$Send_company_literature addslashes($_POST['Send_company_literature?']);
@
$Have_a_salesperson_contact_me addslashes($_POST['Have_a_salesperson_contact_me?']);
@
$Name addslashes($_POST['Name']);
@
$Title addslashes($_POST['Title']);
@
$Company addslashes($_POST['Company']);
@
$Address addslashes($_POST['Address']);
@
$Phone addslashes($_POST['Phone']);
@
$Email addslashes($_POST['Email']);

// Validation
//Sending Email to form owner
$pfw_header "From: $Email\n"
  
"Reply-To: $Email\n";
$pfw_subject "Online Information Request Form";
$pfw_email_to "myemail@gmail.com";
$pfw_message "Visitor's IP: $pfw_ip\n"
"Send_product_literature: $Send_product_literature\n"
"Send_company_literature: $Send_company_literature\n"
"Have_a_salesperson_contact_me: $Have_a_salesperson_contact_me\n"
"Name: $Name\n"
"Title: $Title\n"
"Company: $Company\n"
"Address: $Address\n"
"Phone: $Phone\n"
"Email: $Email\n";
@
mail($pfw_email_to$pfw_subject ,$pfw_message ,$pfw_header ) ;

header("Location: ../success.php");

?>
Oh, and yeah, I'm kind of a newbie here. I do some non-profit work for schools and what not to help them along with what I can do to save them money.
__________________
- Chris. Dabbling learner.

Last edited by redline5th; 11-08-2009 at 01:21 AM..
redline5th is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-07-2009, 09:19 AM Re: Having trouble with SIMPLE PHP Contact form... HELP!
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
You should go to your php.ini and configure the smtp settings, google wil help you with that
elcosmo is offline
Reply With Quote
View Public Profile
 
Old 12-07-2009, 11:57 PM Re: Having trouble with SIMPLE PHP Contact form... HELP!
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Now, don't take this as authoritative, because I'm not 100% sure, but I believe the mail specs dictate 2 newlines somewhere (in case the truncation happens on only 1 line) or it could be that you need either only \r or \r\n instead of just \n (in the case where truncation happens on all lines).

These are wild guesses, but hopefully they help.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to Having trouble with SIMPLE PHP Contact form... HELP!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42288 seconds with 12 queries