Solved

Installing PHP4 to run the following script

Posted on 2003-11-08
3
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Richard Quadling
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

623 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