Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

help on PHP


ghost's Avatar
0 0

I just started a PHP book and it gives me this as an example but when i try it out it just says the same thing instead of my IP and other stuff

<!DOCTYPE html PUBLIC "-//W3C//DTDXHTML
1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/
xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml : lang="en" lang="en"> <head> <meta http-equiv="content-type" content= "text/html; charset=iso-8859-1" /> <title>predefined variables</title> </head> <body> <?PHP # Script 1.6 - predifined PHP.php

// Create a shorthand version of the variable names. $file=$_SERVER['PHP_SELF']; $user=$_SERVER['HTTP_USR_AGENT']; $address=$_SERVER['REMOTE_ADDR'];

 //print the name of this script.
echo &quot;&lt;p&gt;You are running the file &lt;b&gt;$file
&lt;/b&gt;.&lt;/p&gt;/n&quot;;

// Print the user&#39;s information.
echo &quot;&lt;p&gt;You are viewing this page using:&lt;br /&gt;&lt;b&gt;&lt;br /&gt; 
from the IP address:&lt;br /.&lt;b&gt;$address&lt;br /&gt;&lt;/p&gt;/n;

?> </body> </html>


ghost's Avatar
0 0

php is a server side script. you cant run it off your computer unless you have the stuff to run php. you need a server that allows the php to run


ghost's Avatar
0 0

oh ok thanks i would have sat here for hours trying to figure it out


ghost's Avatar
0 0

yeah- just install it on your computer. (you should know that to test exploits.)