Re: [PHP] Getting users IP address into a variable.

2002-10-02 Thread Bill Farrell

Try:
$ip = ;
if ( $HTTP_X_FORWARDED_FOR ) {
$ip = $HTTP_X_FORWARDED_FOR;
} elseif( $HTTP_VIA ) {
$ip = $HTTP_VIA;
} elseif( $REMOTE_ADDR ) {
$ip = $REMOTE_ADDR;
} else {
die(); // or perhaps some better response
}

--- Webmaster MBTRADINGCO [EMAIL PROTECTED]
wrote:
 I'm sure there has to be a way to verify which IP
 address is accessing
 from. I need to establish a page where when I enter
 it records the IP
 address I'm logging in from, to a database.
 
 Problem is I can't seem a command in php that can
 assign that to a
 variable, as in:
 
 $ip=HTTP_GET_
 
 ANY IDEAS
 
 Thanks
 
 
 Elliot J. Balanza
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] remote desktop control

2002-10-01 Thread Bill Farrell

By the way, it works beautifully, either using the
VNCViewer or through the java applet in a web browser.
 I do a lot of remote support and it's indispensible. 
Win2K seems to have some issues (frequent disconnects)
but a refresh usually puts you right back.  But on
*nix systems, it's as stable as anything else I've
ever used on any system.  

Also, if you're running on RedHat 7.1 or later, VNC
comes with.  If you didn't install it when you
installed the rest of RedHat, the RPM is on the
install CD.
B


--- Alex Moundalexis [EMAIL PROTECTED] wrote:
 Read the documentation for VNC, and read what Ben
 wrote.
 
 VNC - http://www.uk.research.att.com/vnc/
 We have a Java viewer, which will run in any
 Java-capable browser.
 Read: no download required.
 
 Implementing in another language would be beyond the
 scope of this forum.
 
 - A
 
 On Tue, 1 Oct 2002, Rahul wrote:
 
  Hello Smith,
 
   Thanks for your reply. Do you have any idea in
 implementing same with any
  other language?
  But VNC and all needs download  process to use
 (control remote desktop).
  I'm asking abt web based(anywhere control- no need
 to download and install).
 
  if you have any idea in doing this, plz tell me.
 
  thanks a lot,
  -sadha
 
  From: Smith, Benjamin [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, October 01, 2002 12:14 PM
  Subject: RE: [PHP] remote desktop control
 
 
  Not really, no. It goes well beyond the
 capabilities of a server-side
  scripting language.
 
  There is a java implementation in VNC that allows
 this capability, though.
 
 
  Hello all,
 
 Is it possible to implement Web Based Remote
 Desktop Control using PHP or
  anyother webbased language?
  Aim is to share the remote(visitor's)
 system(desktop).
  If possible, plz let me know how to proceed.
 
 
  Advance thanks,
  -sadha
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Multivalue RDBMS's

2002-09-29 Thread Bill Farrell

Hi, all,

Just out of curiosity, are there any people out there
using PHP with UniVerse/UniData, Pick, mvBase or any
other multivalue database?  I'm getting brave with PHP
and writing some connection and Dynamic String Array
(Pick record) handling objects and wonder if anyone
has been down this road before.

I'm using VantagePoint Software's MVGateway as the
connection middleware.  So far it's starting to work
pretty good (thanks to all the tips from this list!
Y'all are a very informative bunch!).

So far, I've emulated the most important mvBASIC
functions in PHP and can now handle MV records and
record sets directly. If anyone is using an MV RDBMS
it might be useful to compare notes on what's
practical and what's not to use in forms generation
and data handling.

I'm becoming hooked on PHP...seems there isn't
anything you can't do with it.  If you can conceive
it, you can code it to work :-)

Best regards,
B


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] coding standards - control structures

2002-09-27 Thread Bill Farrell

LOL! Right!  I figure that _I'm_ the one who has to
look at my code the most.  May as well leave it where
I put it, how I put it.

Thanks for the chuckle!
B

--- Kevin Stone [EMAIL PROTECTED] wrote:
 I believe the standards are for coding PEAR modules
 so all code is presented
 in the same style.  It really has no influence on
 the language or community
 at large.  I say code the way you feel most
 comfortable with and damb to
 anyone who complains.  :)
 -Kevin
 
 - Original Message -
 From: ed [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, September 27, 2002 2:16 PM
 Subject: [PHP] coding standards - control structures
 
 
  Hey all.  I've read the pear coding standards.
  I assume that if php has any official coding
 standards
 
  then the pear standards would be them, correct?
 
  Anyways, the pear docs on coding standards show
  examples of using controls structures like
  the following:
 
  if ( !$var ) {
  do_something();
  }
  else {
  do_something_else();
  }
 
  ---
  But I really don't like putting the opening brace
  on the same line as the control statement.
 
  I really prefer doing this:
 
  if ( $var )
  {   do_something();
  }
 
 
  or
 
  if( $var )
  {   do_something();
  }
  else
  {   do_something_else();
  }
 
  ---
  Putting the opening brace one line down on the
 same
  column that the control statement starts on seems
 to
  give me a much better visual cue, especially when
  dealing with nested control statements.
 
  Is doing it my preferred way acceptable?
  Will my code be looked down on?
 
  thanks,
  --ed
 
 
  __
  Do you Yahoo!?
  New DSL Internet Access from SBC  Yahoo!
  http://sbc.yahoo.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit:
 http://www.php.net/unsub.php
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Explorer-like drill down interface

2002-09-26 Thread Bill Farrell

Y'know?  I started fiddling with the drill-down I had
made and found that the thing only worked on the
latest Mozilla.  Seems the developers made the same
mistake I did in what input type=image ... is
supposed to do.  Looks great on one browser :-)

I wound up with another alternative:  a folder view
with wayback's to ascend in the tree.  The code that
works better on all browsers can be seen on
http://www.jwfarrell.com/listtree.php.  I'll make the
code and support files available to anyone who wants a
copy.  Apologies for the pretty (but ineffectual)
version 1.

:-)
Bill


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Session

2002-09-26 Thread Bill Farrell

Hi all,

Is there a really thorough tutorial on the use of
session variables?  Seems like there are a zillion
options to choose from, lots of interdependent
settings, etc, and I'm a bit confused on how to make
it work.

I try not to use session objects too much in any
language as it makes the code somewhat less portable,
but I did want to experiment with PHP's notion before
launching off on another suite of apps.  I'm starting
with a simple fake hit counter that checks session to
see if the counter was already dinged.  It works if I
turn on enable_transient_sid, but setting that drives
ht://dig nuts by appending ?PHPSESSIDyaddayadda to the
URL.  Really makes a mess of the database :-)~~.

Obviously, I'm missing something pretty fundamental. 
Any suggested reading would be appreciated (yes, I did
read the PHP manual :-).

Thanks in advance,
B


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Explorer-like drill down interface

2002-09-25 Thread Bill Farrell
 ==  )
) {
echo td align=\left\ valign=\top\img
src=\/graphics/icons/tree_f.gif\/td\n;
} else {
echo td align=\left\ valign=\top\img
src=\/graphics/icons/tree_e.gif\/td\n;
}
echo td align=\left\ valign=\top\input
style=\border: none;background: transparent;\
value=\$CurrentFolder/$Subdir\ name=\Folder\
type=\image\
src=\/graphics/icons/folder_blue.png\/td\n;
echo td align=\left\
valign=\top\$CurrentFolder/$Subdir/td\n;
echo /tr\n;

}

foreach ( $SimpleFiles as $SimpleFile ) {
echo tr\n;

if ( $SimpleFile == $LastFile ) {
echo td align=\left\ valign=\top\img
src=\/graphics/icons/tree_f.gif\/td\n;
} else {
echo td align=\left\ valign=\top\img
src=\/graphics/icons/tree_e.gif\/td\n;
}

// find the right icon for the file type
unset( $Icon );
$SplitName = explode( '.', $SimpleFile );
$NameParts = count( $SplitName );
if ( $NameParts == 1 ) {
$Icon = generic.gif;
} else {
$NameParts--;
$Extension = $SplitName[ $NameParts ];
if ( is_file( $MimeTypeFolder/$Extension ) ) {
list( $MimeType, $TheRest ) = file(
$MimeTypeFolder/$Extension );
$MimeType = rtrim( $MimeType );
if ( is_file( $IconsFolder/mime_$MimeType.gif ) )
{
$Icon = mime_$MimeType.gif;
}
}
}

if ( !isset( $Icon ) ) { $Icon = generic.gif; }

echo td align=\left\ valign=\top\img
src=\/graphics/icons/$Icon\ height=\16\/td\n;
echo td align=\left\ valign=\top\a
href=\$CurrentFolder/$SimpleFile\$CurrentFolder/$SimpleFile/a/td\n;

echo td align=\right\ valign=\top\ .
filesize( $DocRoot/$CurrentFolder/$SimpleFile ) .
/td;
echo /tr\n;
}

?
/table

input type=hidden name=CurrentFolder value=?php
echo $CurrentFolder; ?

/fieldset
/form

?php
//include( $DocRoot/searchbody.php );
?
?php
include($DocRoot/style/bodytemplate_bottom.php);?


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] getting ip address of the user.

2002-09-24 Thread Bill Farrell

Hi, Y'all,
Here's another suggestion FWIW.  I prep a few
variables in the htmlhead.php routine, $RemoteHost
being one of them.  Having some simple names for
associated values is kinda handy.  One of the biggest
strengths of PHP is that there's more than one way to
go about solving problems.  Here goes:

?php
/* Identify the request, request headers, and the
requestor */
$HTTP_Headers = getallheaders();
$Method = getenv( REQUEST_METHOD );
$Referer = getenv( HTTP_REFERER );
$RemoteHost = getenv( REMOTE_HOST );

if ( $HTTP_X_FORWARDED_FOR ) {
$RemoteAddr = $HTTP_X_FORWARDED_FOR;
} elseif ( $HTTP_VIA) {
   $RemoteAddr = $HTTP_VIA;
} elseif ( $REMOTE_ADDR ) {
   $RemoteAddr = $REMOTE_ADDR;
}

?


--- Jesse Cablek [EMAIL PROTECTED] wrote:
 Anil Garg mailto:[EMAIL PROTECTED] scribbled;
  
  Can i get the ip-address of the machines who
 accessed my website??
  Plz give the pointer that on what lines shall i
 start for doing so.
  
 
 print $_SERVER['REMOTE_ADDR'];
 
 -jesse
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] getting ip address of the user.

2002-09-24 Thread Bill Farrell
( $SendTo ) ) { break; }
}
}

?
h2WhoAmI Utility/h2

p
This utility can help you identify your browser and
your
Internet provider.  It uses all of the worldwide NIC
authorities to obtain only public information.
emNo/em
information obtained by this page is ever
retained...it
is simply a diagnostic to help web programmers
understand
how web servers respond to information provided by
their
browsers.  It is provided in an effort to help web
programmers
isolate browser differences so that their programming
will
be more sure to work on more platforms.
/p

h3The Basics/h3

ul
?php

if ( $host != $ip ) {
print liYour host name is $host/li\n;
}

print liYour IP Address is $ip/li\n;
print liYour web service provider was found in
$RespondingAuthority/li\n;
print liYour browser is reported as $Agent/li\n;

if ( isset( $SendTo ) ) {
list( $EmailAddress, $Provider ) = explode( @,
$SendTo );
print liYour service provider is
$Provider/li\n;
}
print /ul\n;

print h3The Entire Response from
$RespondingAuthority/h3\n;
print pre\n;
foreach ( $WholeResponse as $Line ) {
print $Line\n;
}
print /pre\n;

print h3Your browser sent the following
headers/h3\n;
print ul\n;
foreach( $HeaderLog as $Line ) {
print li$Line/li\n;
}
?

/ul

hr
a href=/sourcesafe/ title=Show me the code for
this pageShow me the code/a
for this page.

?php
include( style/bodytemplate_bottom.php );
?


=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] URL Rewriting

2002-09-23 Thread Bill Farrell

Greetings, all,

I've been using PHP for a couple of years now and only
recently (since upgrading to RH7.3) began to
experience an odd problem.  When navigating around my
site or when I run HT://Dig across it the links are
suddenly being rewritten back as
http://my.dom.com/some_page?PHPSESSID=the_id_string. 
I haven't
changed my coding between releases so evidently
whatever I've been doing with session variables all
along is suddenly behaving differently between
releases.

Having the session ID suddenly exposed in the URL
looks odd and prevents HT://Dig from indexing
properly.  What have I done to make this suddenly show
up and how can I get rid of it?

Thanks much in advance and best regards to all!
Bill

=
Bill Farrell
Multivalue and *nix Support Specialist

Phone: (828) 667-2245
Fax:   (928) 563-5189
Web:   http://www.jwfarrell.com

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php