Link to home
Start Free TrialLog in
Avatar of paddy086
paddy086Flag for Ireland

asked on

Php print out ip address make ip address flash or blink

Hi  i have a php script that prints out you users ip address but i am trying to make it flash/blink

php ip address
<?php print $ipadress = $_SERVER['REMOTE_ADDR']; ?>

Open in new window


script that makes text flash but i cant get it to flash the ip address out
<html>
<head>
<title>Blinking sample</title>
<script type="text/javascript">
<!--
function blink() {
  if (!document.all) { return; }
  for (i = 0; i < document.all.length; i++) {
    obj = document.all(i);
    if (obj.className == "blink") {
      if (obj.style.visibility == "visible") {
        obj.style.visibility = "hidden";
      } else {
        obj.style.visibility = "visible";
      }
    }
  }
  setTimeout("blink()", 800);
}
// -->
</script>
</head>
<body onload="blink()">
<h1 class="blink">Blinking sample</h1>
<p>This is normal text</p>
<p class="blink">This is blinking text</p>
<?php print $ipadress = $_SERVER['REMOTE_ADDR']; ?>
</body>
</html>

Open in new window



Thanks for any help given
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Do this maybe?

CyanBlue
<p class="blink">This is blinking text</p>
<p class="blink"><?php print $ipadress = $_SERVER['REMOTE_ADDR']; ?></p>

Open in new window

Uhm .... obj = document.all(i); Are you kidding?

document.all has been obsolete for 10 years.

just create two classes:

.hilite {visibility: visible;}
.off {visibility:visible;}

The way you appear to be attempting this is just about the least efficient way possible.

target specific ids with document.getElementById();

Cd&
Avatar of paddy086

ASKER

Hay CyanBlue    I have tried that way but it doesn’t work thanks do.

COBOLdinosaur  Have not got a clue what you mean I just Google java script to make text flash I was winging it by just putting my php print out into the location the text was meant to go
Could you show me what to do in a script please

Thanks
SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks COBOLdinosaur for your help i gave it a shot did not work out for me.

rinfo your java script worked for what i was trying to achieve thanks