Solved

Installing PHP4 to run the following script

Posted on 2003-11-08
3
308 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
ID: 9710616

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
ID: 9882061
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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 and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

863 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

27 Experts available now in Live!

Get 1:1 Help Now