Solved

Installing PHP4 to run the following script

Posted on 2003-11-08
3
315 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

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…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

734 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