Solved

Installing PHP4 to run the following script

Posted on 2003-11-08
3
307 Views
Last Modified: 2013-12-13
I am trying to install PHP4 on my server to run the following script so that it emails me my visitors IP address, the search term they used to visit my page and their browser type. I'm running BSD on my server and I typed in vinstall php4, what do I do next?

Here is the page that I am using. Right now it is just sending me and email that says.

Referer Page:
Referer IP address:
User Agent:


<?
//*****1a.php
//This program mails visitor id to null@void.com, then sends to download site

$to="tim@lablvr.com";
$from="tim<null@void.com>";
$dt=date("Y-m-d H:i:s");

// Mail Subject Part

$subject=$id;

// --------
// enquiry form details sent to marketing dept....!

mail($to, $subject,
"$id
Referer Page:$HTTP_REFERER
Referer IP address:$REMOTE_ADDR
User Agent:$HTTP_USER_AGENT
",

"From:$from");
// The email part ends here...!

header("Location:http://www.void.com/");
?>
--end report--
0
Comment
Question by:timshank
3 Comments
 
LVL 14

Accepted Solution

by:
ThG earned 125 total points
Comment Utility

Well, if it is sending the emails it means that it is somewhat working, isn't it? :-)

Actually your problem is related to the register_globals setting.

solution 1:
Just edit your php.ini (usually /usr/lib/php.ini, but for bsd it must be somewhere under /usr/pkg.. i'm sure you'll guess it)
If you don't have it, create one from templates and set register_globals to ON.

solution 2:
change your variables to $_SERVER['REMOTE_ADDR'] etc.
0
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
I have to say that the use of register_globals is not a good idea.

Much better to use the $_xxxx super globals.

RIchard.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now