Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-14-2011, 07:39 AM   PM User | #1
shinn90
New to the CF scene

 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
shinn90 is an unknown quantity at this point
Display text content

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:

Code:
<html>
<head>
<title>IP TO URL Converter</title>
</head>

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

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

</body>
</form>

</html>
thanks

Last edited by shinn90; 07-14-2011 at 07:44 AM..
shinn90 is offline   Reply With Quote
Old 07-14-2011, 08:35 AM   PM User | #2
vikram1vicky
Regular Coder

 
Join Date: Jul 2011
Location: India
Posts: 496
Thanks: 3
Thanked 57 Times in 56 Posts
vikram1vicky is an unknown quantity at this point
Using jQuery you can do this. Following is sample code:

Code:
$(document).ready(function()
{
    $("#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

vikram1vicky is offline   Reply With Quote
Old 07-14-2011, 08:43 AM   PM User | #3
deepinkumar
Banned

 
Join Date: Jul 2011
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
deepinkumar is an unknown quantity at this point
In the PHP we can define this type,

<?php
/*
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 = '00.000.000.000';
$userip = $_SERVER['REMOTE_ADDR'];
if($userip == $allowed){
echo "This content is only viewed by the IP address you chose...";
}
?>

Last edited by WA; 07-14-2011 at 09:30 AM..
deepinkumar is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:06 PM.


Advertisement
Log in to turn off these ads.