Source language: Translate to:

Getting External IP from computer

Questions and information about creating Internet aware NeoBook applications. Including PHP, HTML, FTP, HTTP, Email, etc.

Moderator: Neosoft Support

Getting External IP from computer

Postby NyperCro » Mon Jun 30, 2014 12:07 pm

Hi Neobookers

How to get users External IP using any acceptable code in Neobook ?
I need to get IP from users who using my software to disable multy accounts to be created
Thank you
NyperCro
 
Posts: 21
Joined: Thu Dec 15, 2011 12:53 am

Re: Getting External IP from computer

Postby dec » Mon Jun 30, 2014 12:57 pm

Hello,

May you want to use a service like WhatIsMyIp.com provide? Or some similar service of course.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Getting External IP from computer

Postby virger » Mon Jun 30, 2014 5:01 pm

I would try this, create a button with this action ..
I hope you serve

Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5,80
ObjectType=3
Name=BtIp
X=11
Y=16
W=270
H=33
Anchor=0
Text=GetMy IP: [Ret1]
Align=1
ImageStyle=0
ObjAction=InternetPost "http://checkip.dyndns.org/" "" "[Ret]" "Async"¶StrParse "[Ret]" ":" "[Ret]" "[x]"¶strparse "[Ret2]" "<" "[Ret]" "[x]"¶¶..SEND EMAIL [Ret1]
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2


Desde COSTA RICA
Sigue Holanda
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 523
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Getting External IP from computer

Postby dec » Tue Jul 01, 2014 7:19 am

Hello,

One more thing: if you have your own server, probably you can run PHP scripts, and then, try to get the client IP address using PHP. You can prepare such PHP script in order to return just the IP address, then you only need to call to the "InternetGet" action and retrieve the server response.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Getting External IP from computer

Postby mishem » Tue Jul 01, 2014 7:27 am

mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Re: Getting External IP from computer

Postby dec » Tue Jul 01, 2014 7:36 am

Hello,

mishem wrote:http://checkip.dyndns.org/


This is the server used by virger in their above code. However, this kind of service (depending on the HTTP request number or any other arbitrary limitations) are not free, because have a cost, and therefore may you cannot rely on these "free servers" for your applications, above all if these are commercial applications.

So the best option (IMHO) is to use some service provider like WhatIsMyIp.com (wich offers various price plans to suite your needs) or use your own web server, which you are paying anyway. Of course you are free to use "free servers", but, then no complaint about possible issues. And then try to explain that to your customers.

Another possible solution in this particular case can be to use the computer MAC address instead of the IP. Then the npMacAddresses action from my npUtil plugin can help. Maybe a combination of the user PC information can do the trick and therefore the IP address become not necessary, which can be good, since to obtain the IP address the user need an internet connection, which maybe is not what we wanted.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Getting External IP from computer

Postby virger » Tue Jul 01, 2014 9:53 am

Looking at old programs I found this, it might help.

1) In Button:
InternetPost "http://www.MyServer.com/neobook.php?ori=1357" "" "[RetIp]" ""
2) The "php" in MyServer:
Code: Select all
<?php
// creado el      16:17 p.m. 11/04/2012
// modificado el   10:09 a.m. 01/07/2014
// MyEmail@hotmail.com
// AlguienEntro

$ori       = @$_REQUEST['ori'];
// si lo necesito      $usa    = @$_SERVER['PHP_AUTH_USER'];
$ip         = $_SERVER['REMOTE_ADDR'];

// para guardar inf en mi servidor:      $fp = fopen('quienentro.txt', 'a+');
//                              fwrite($fp, $ip."\t".date("d.m.Y, g:i a")."...".$ori."---".$usa."\n");
//                              fclose($fp);

//////////////////////////////////////
// mandar a mi email
$to         = "MyEmail@hotmail.com";
$subject    = "ENTRO: $ip";
$msg       = "Entro $ori Por 'IP': $ip.\t".date('d.m.Y, g:i a');
           // si estoy usandolo agrego:  ." USA ($usa)";
$headers    = "From: TheWatcher@hotmail.com";

//$headers    = "From: MyEmail@hotmail.com" . "\r\n" .  "CC: OtroEmail@hotmail.com";
/*$msg = $msg .'
                     ESTE SEPARADOR (\n) NO FUNCIONA DEBE SER CON
                     VERDADERO SALTO DE LINEA
                     COMO TAS';
$msg .= "
                     --- HOLA LOLA ---"; */
                     
$sn         = mail($to,$subject,$msg,$headers);

// si quiero condirmacion uso esta linea
// if ($sn) { echo "Enviado $ori---$usa" ;};
?>


COSTA RICA
MAKING HISTORY
PURA VIDA
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 523
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central


Return to NeoBook and the Internet

Who is online

Users browsing this forum: No registered users and 1 guest