Solved

Installing PHP4 to run the following script

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xampp tool 12 48
str_replace not working in php script 4 25
How can I make this form submit to itself? 10 25
Creating Functions in phpMyAdmin 8 10
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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 …
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…
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…

813 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

18 Experts available now in Live!

Get 1:1 Help Now