Results 1 to 3 of 3

Thread: how to call PHP script from HTML

  1. #1
    Regular Member catngo's Avatar
    Join Date
    Dec 2000
    Location
    Oklahoma City
    Posts
    213

    how to call PHP script from HTML

    this is my php script that will display client IP address:

    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <BODY>
    <?php
    $userip = $REMOTE_ADDR;
    echo $userip
    ?>
    </BODY>
    </HTMP>

    and the filename of this is ip.php

    if i call this script alone, it will show my ip address. (my IIS 5.0 is PHP enable). now, i want to embed this script into my html file.

    example: to call an image in an HTML i use <IMG src="image.jpg">
    in this case, i want PHP script instead of image.


    thanks
    cat

  2. #2
    Regular Member
    Join Date
    Aug 1999
    Posts
    341
    Just give the file a .php extension. Example: index.php

  3. #3
    Code:
    <html>
      <body>
        <?php
          $userip = $REMOTE_ADDR;
        ?>
        IP address:  <?php PRINT("$userip"); ?>.
      </body>
    </html>

    At least I think that's what you want to do.
    --4oh4

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •