Jump to content


Photo

ip address


  • Please log in to reply
6 replies to this topic

#1 vetev

vetev
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 28 April 2006 - 07:09 PM

does anyone know the code to display a users ip address on my webpage.
It must be just the ip (numbers) very simple as i plan inserting code into photoshop anyways.

I would like as basic as possible that a .html page can read.
As when i save my work it will be .html

thanks, sorry for posting under php but you have good knowlage

#2 bbaker

bbaker
  • Members
  • PipPipPip
  • Advanced Member
  • 127 posts
  • LocationNY

Posted 28 April 2006 - 07:20 PM

<?php
echo $_SERVER['REMOTE_ADDR'];
?>

#3 vetev

vetev
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 28 April 2006 - 07:30 PM

Hi i can never get this code to work just shows blank html page.

how do i install tis and what do i name the page to test.html show white block, i must have html page

#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 28 April 2006 - 07:43 PM

You must save the file with a PHP extension unless your PHP installation is configured to parse html pages.

Info: PHP Manual


#5 bbaker

bbaker
  • Members
  • PipPipPip
  • Advanced Member
  • 127 posts
  • LocationNY

Posted 28 April 2006 - 07:48 PM

the server may not allow php to be shown on pages with the .html extension. Is this site on an Apache server?

if so, you can add this to a .htaccess file to get your html pages to be read as php

AddType application/x-httpd-php .html .php .htm

#6 vetev

vetev
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 28 April 2006 - 08:27 PM

this is location of my webpage .php on apache

my site is vetev.com yes it is apache, i run php-nuke from the site fine why wont it allow php page when it allows hundreds of nuke file which are .php

#7 bbaker

bbaker
  • Members
  • PipPipPip
  • Advanced Member
  • 127 posts
  • LocationNY

Posted 28 April 2006 - 08:34 PM

the server might not allow PHP on pages with the .html extension

if you change your page to a .php extension is should work fine. if you can't change it to .php & you MUST have it as .html, then use:

AddType application/x-httpd-php .html .php .htm

This will force the server to read .html pages as .php pages & your PHP code will work.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users