View Full Version : Display text content

07-14-2011, 08:39 AM
here is my website : http://ip2url.tk/

i want to display the text content of a .txt file under the ip addresses table after i clicked send.

something like this:

<title>IP TO URL Converter</title>

<h1>IP TO URL Converter</h1>
Please specify a log file:<br>
<input type="file" name="datafile" size="40">
<input type="submit" value="Send">
IP addresses:<br>

<form method="post" action="">
<textarea name="comments" cols="40" rows="5">
<button type="button">Convert</button>
<form method="post" action="">
<textarea name="comments" cols="40" rows="5">
<script type="text/javascript">
var address = java.net.InetAddress.getLocalHost();
document.write("Your IP is: " + address);




07-14-2011, 09:35 AM
Using jQuery you can do this. Following is sample code:

$("#display_Container").load('Yourfile.txt'); // "display_Container" will be ID of display element

For this you need a copy of jQuery file that you can download from jquery.com


07-14-2011, 09:43 AM
In the PHP we can define this type,

this Snippet allows you to display content "ONLY" to a visitor from
a specific IP addresses in a page.
Change the $allowed "value" to the IP address you want.
$allowed = '';
$userip = $_SERVER['REMOTE_ADDR'];
if($userip == $allowed){
echo "This content is only viewed by the IP address you chose...";