Php Html Examples Authentication Over HTTP Basic authentication prompt Checking the values returned from the authentication prompt Get Users from users table Enforcing Basic authentication HTTP Authentication example HTTP Authentication example forcing a new name/password Hardcoding the username and password into a script If user logged in Only One Username and Password Is Valid Usernames and Passwords Are Checked Against Data in a Database Usernames and Passwords Are Checked Against Data in a File Using HTTP authentication with a PHP script Use database to store user name and password The Username and Password Are Retrieved for Both Apache and IIS Simple credentials checkingUser management with database Common File Format Content Types get_html_translation_table() translates text to its HTML equivalent. get html translation tableget_html_translation_tableget_meta_tags() function searches an HTML file for what are known as META tags. Changing the page type to CSV Changing the page type to XML Setting a Cookie Using the header() Function Logged In with cookie Forcing File "Save As" Downloads Good and bad Location headers If a User Is Not Logged in, the Login Form Is Loaded Mime types Using header() to Send Raw Headers Setting character encoding Sending an XML response Sending Content Types Other Than HTML Reading Queued Headers Redirect header Redirecting with query string variables headers_sent( ) function returns true if your HTTP headers have been sent or false otherwise. You can switch modes if you want Php and HTML Code Cohabitation fgetssUse Php class to control the HTML page font Define function to change HTML text font Escape HTML char HTML tag strip strip_tagsCreating an HTML table from array elements Output a HTML table Use for each to loop through an array and create a table Separate the city and state name in the array so we can total by state Display of HTML using PHP code Dynamic Generation of IMG Tags from an Array Dynamic HTML tags Dynamic PHP page creation Dynamic date insertion ExampleOutput Control Output image tag Output image tag with global path value The Header Checking for magic quotes Generating XML from an array htmlentities() function converts all characters into their equivalent HTML entities. htmlentities.php Encoding HTML entities in a string Escaping HTML htmlspecialchars() function converts a select few characters in the context of HTML into their equivalent HTML entities. htmlspecialchars.php Escaping HTML entities UTF-8 HTML encoding string html_entity_decode ( string html [, int options [, string charset]] ) converts an &-escaped string into its original format Building a query string with http_build_query() HTTP_REFERER and HTTP_USER_AGENT Fetching a URL with HTTP_Request Browser Detection Browser content Determining client operating system and browser Get Browser and Platform Welcome Page with HTTP_USER_AGENT Reporting the User Agent and Referrer Parse http link from string Listing Some Server Variables string rawurldecode ( string str ) converts a %-escaped string into its original format, reversing the operation of rawurlencode( ) . string rawurlencode ( string str ) converts non-alphabetic symbols into numerical equivalents preceded by a percent sign Get the IP address of the current user The Table and HTMLTable Classes The Table Class Replacing FONT Tags with CSS Beautifying HTML Using Tidy Extracting URLs Using Tidy Retrieving an Entrance Node in Tidy Reducing Bandwidth Usage Using Tidy Passing Tidy Options at Runtime Using tidy_clean_repair() Retrieving a Document from Tidy Generating a Web-Safe Color Palette $_FILE Elements Keys Created for a File When Uploaded

Php Code : Get The IP Address Of The Current User

Get the IP address of the current user in php

 
<?php 
 
$curip = $_SERVER['REMOTE_ADDR']; 

$myarray = array (); 

if (!in_array ($curip, $myarray)){ 
    echo $curip . " is in array"; 
} else { 
    echo $curip . " is not in the database."; 
} 
?>