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
Email Form PHP - HELP!
Old 06-09-2008, 11:15 AM Email Form PHP - HELP!
jonathanadams's Avatar
Experienced Talker

Posts: 34
Name: Jonathan Adams
Trades: 0
Hey,
I have the following code for my php form, it works.

PHP Code:
<?php

/* Subject & Email Variables */

    
$emailSubject 'Email From Website';
    
$webMaster 'EMAIL ADDRESS OMITTED';

/* Gathering Data Variables */    

    
$nameField $_POST['name'];
    
$emailField $_POST['email'];
    
$subjectField $_POST['subject'];
    
$messageField $_POST['message'];
    
    
$body = <<<EOD
Name: $nameField<br>
Email: 
$emailField <br>
Subject: 
$subjectField <br>
Message: 
$messageField
EOD;

    
$headers "From: $emailField\r\n";
    
$headers .= "Content-type: text/html\r\n";
    
$success mail($webMaster$emailSubject$body$headers);
    
/*  Results renderd as HTML */

    
$theResults = <<<EOD
Content has being sent, thank you!
EOD;

echo 
"$theResults";
    
?>
I would like to know how i can gather computer information of the people who are posting the form without them knowing for purposes of blocking users and spam.

I would like to collect:
  • ISP
  • IP Address
  • Browser
  • Computer Operating System
  • Country

Thank you for you help.
__________________

Please login or register to view this content. Registration is FREE
jonathanadams is offline
Reply With Quote
View Public Profile Visit jonathanadams's homepage!
 
 
Register now for full access!
Old 06-09-2008, 07:26 PM Re: Email Form PHP - HELP!
webElf.ca's Avatar
Junior Talker

Latest Blog Post:
HTML Character Entities
Posts: 3
Name: Jim West
Location: Owen Sound, Ontario
Trades: 0
You can grab some of that information from the $_SERVER global variable. Take a look at the manual at http://ca3.php.net/manual/en/reserve...les.server.php to see what's available.
__________________

webElf.ca - On-Demand Webmaster Solutions for your Website
webElf.ca is offline
Reply With Quote
View Public Profile Visit webElf.ca's homepage!
 
Old 06-10-2008, 03:10 PM Re: Email Form PHP - HELP!
jonathanadams's Avatar
Experienced Talker

Posts: 34
Name: Jonathan Adams
Trades: 0
i'm kind of new to PHP can anyone help me? A manual don't really help if you don't know what you are doing!
__________________

Please login or register to view this content. Registration is FREE
jonathanadams is offline
Reply With Quote
View Public Profile Visit jonathanadams's homepage!
 
Old 06-10-2008, 03:28 PM Re: Email Form PHP - HELP!
webElf.ca's Avatar
Junior Talker

Latest Blog Post:
HTML Character Entities
Posts: 3
Name: Jim West
Location: Owen Sound, Ontario
Trades: 0
You may find the following article of some help in understanding how to capture your visitor's information:

http://www.articles-hub.com/Article/87904.html
__________________

webElf.ca - On-Demand Webmaster Solutions for your Website
webElf.ca is offline
Reply With Quote
View Public Profile Visit webElf.ca's homepage!
 
Old 06-10-2008, 11:42 PM Re: Email Form PHP - HELP!
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
You can't be absolute with this stuff due to faking, but:
$_SERVER['REMOTE_ADDR'] is the user's IP
http://www.phptutorial.info/iptocountry/the_script.html IP to country
$_SERVER['HTTP_USER_AGENT'] has the browser (and usually has the country too)
For example
Quote:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
is my current UserAgent string which is FF3 on Windows Vista (NT 6.0) NT 5.0 is 2K, NT 5.1 is XP (as in 5.2) so with some parsing you can read the UA strings.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to Email Form PHP - 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.45422 seconds with 12 queries