Re: [PHP] updating a frame from within php...

2004-08-11 Thread Scot L. Harris
On Wed, 2004-08-11 at 00:13, Matthew Sims wrote:
  hi...
 
  this probably doens't belong here.. but i'll try!
 
  i have a two frame window. when the user logs into the 'main' window, i
  want
  to be able to 'update' the 'main' window and then hte 'nav' window. some
  underlying vars are getting set, and i need to be be able to refresh
  elements/links in the 'nav' window with the new values...
 
  searching through google, hasn't really shed any insight/light on the best
  approach for this..
 
  any ideas/pointers/comments/thoughts...
 
  thanks
 
  -bruce
 
 I think javascript would be your cup of tea...getting the browser to
 reload a frame.
 
 Google is your friend:
 http://www.google.com/search?q=javascript%20reload%20framehl=enlr=ie=UTF-8sa=Ntab=gw
 

Have been trying to find a way to do this myself.  One idea I had to do
this from within PHP was to define the nav frame as a function which
would be called based on the actions in the main window.  The nav frame
function would use the target elements to send their output to the
correct frame.  

Have not tried this yet so I am not sure that would work.  Have not been
able to think of any other way to do it from PHP.


-- 
Scot L. Harris [EMAIL PROTECTED]

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



Re: [PHP] Access CLIENTNAME

2004-08-09 Thread Scot L. Harris
On Mon, 2004-08-09 at 03:16, Lester Caine wrote:
 At the risk of getting my head bitten off I ask this again, as I am not 
 getting any help anywhere.
 
 I'm running a PHP system that relies on knowing the location of the 
 terminal to handle a lot of '911' (999) type things. I know that 
 REMOTE_ADDR can not be relied on, but with fixed IP addresses on a local 
 network it works fine. However I now have a customer who has a Terminal 
 Server thin client network, and REMOTE_ADDR only reports the server 
 address. In order to restore the facilities I need to gain access to the 
 CLIENTNAME environmental variable from the browser and return it to PHP.
 
 I've already got the simple bodge - they type it on on login - which is 
 simply a joke when coming to use the system. I have a TS logon batch 
 file which copies the CLIENTNAME variable to a file from which it could 
 be accessed. BUT I have yet to find any way to pass the information.
 
 Can anybody kick me in the right direction, or do I have to stick with a 
 drop down list in the logon box and expect everybody to know where they 
 are?
 
 Surely VOIP is going to run into this problem soon isn't it? (Not that I 
 can see how TS can actually handle the microphone and camera anyway ;) )
 
 -- 
 Lester Caine
 -
 L.S.Caine Electronic Services

This won't work?

function get_ip() {
   if (isSet($_SERVER)) {
   if (isSet($_SERVER[HTTP_X_FORWARDED_FOR])) {
   $realip = $_SERVER[HTTP_X_FORWARDED_FOR];
   } elseif (isSet($_SERVER[HTTP_CLIENT_IP])) {
   $realip = $_SERVER[HTTP_CLIENT_IP];
   } else {
   $realip = $_SERVER[REMOTE_ADDR];
   }
   } else {
   if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
   $realip = getenv( 'HTTP_X_FORWARDED_FOR' );
   } elseif ( getenv( 'HTTP_CLIENT_IP' ) ) {
   $realip = getenv( 'HTTP_CLIENT_IP' );
   } else {
   $realip = getenv( 'REMOTE_ADDR' );
   }
   }
   return $realip;
}

-- 
Scot L. Harris [EMAIL PROTECTED]

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



Re: [PHP] Nested If...Else...

2004-07-24 Thread Scot L. Harris
On Sat, 2004-07-24 at 12:05, Robb Kerr wrote:
 What's wrong with this syntax. I just can't see my mistake.
 
 if ($vBkgrndImage == AnswerPage) {
   if ($vAnswerID_RS_PageContent != $row_RS_PageContent['CorrectAnswer']) {
 $vBkgrndImage = Bkgrnd-Body-Incorrect.jpg;
   } else {
 $vBkgrndImage = Bkgrnd-Body-Correct.jpg;
   }
 }
 
 Thanx

Single quotes around CorrectAnswer?

What is the error you are getting?

Guessing that if it passes the syntax checks I expect your problem is it
is always evaluating to one of the options and not the other.  
-- 
Scot L. Harris
[EMAIL PROTECTED]

Let not the sands of time get in your lunch. 

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



Re: [PHP] Problem with strcasecmp() function

2004-07-03 Thread Scot L. Harris
On Sat, 2004-07-03 at 16:57, Rosen wrote:
 Hi,
 I have the following problem with strcasecmp() function.
 It should be compare strings case insensitive. When I use it on my local
 computer, - it works correctly.
 But when I upload file on some internet server - the function doesn't work .
 
 I use the function with cyrillic charset.
 
 Can someone help me ?
 Thanks in advanse !

What version of PHP are you using locally?

What version of PHP are you using on some internet server?

I suspect there is a difference.

-- 
Scot L. Harris
[EMAIL PROTECTED]

*** System shutdown message from root ***

System going down in 60 seconds 

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



Re: [PHP] Problem with strcasecmp() function

2004-07-03 Thread Scot L. Harris
On Sat, 2004-07-03 at 17:08, Rosen wrote:
 Both versions are  Version 4.3.7 of PHP.
 

Then more information is needed to figure out the problem.  

Sample code plus any error messages or results would help.

-- 
Scot L. Harris
[EMAIL PROTECTED]

Plaese porrf raed.
-- Prof. Michael O'Longhlin, S.U.N.Y. Purchase 

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



Re: [PHP] Crontab PHP Script

2004-06-26 Thread Scot L. Harris
On Sat, 2004-06-26 at 19:34, Ryan Schefke wrote:
 Hi,
 
  
 
 Can someone please give me some guidance.  I'd like to run a php script
 every minute (in reality every night, but just testing).  I've done some
 reading and found that a crontab is the best way to go (I think).  I'm using
 Plesk 7 on a Linux box and I have root access.
 

You need to add #!/usr/bin/php
At the start of your script so it knows how to run it.  You will also
need to set the permission bits to allow execution 
chmod 700

Change the path to where you have the cli version of php on your system.


-- 
Scot L. Harris [EMAIL PROTECTED]

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



Re: [PHP] Refresh Page

2004-06-05 Thread Scot L. Harris
On Sat, 2004-06-05 at 10:20, Mike Mapsnac wrote:
 I want to refresh page every 10 seconds, without clicking on Refresh 
 button.
 Any ideas how this can be done?
 
 Thanks

I think you want to include something like this in your pages header
section:

META HTTP-EQUIV=REFRESH CONTENT=10

-- 
Scot L. Harris
[EMAIL PROTECTED]

It is so soon that I am done for, I wonder what I was begun for.
-- Epitaph, Cheltenham Churchyard 

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



Re: [PHP] Prevent IE6 from blocking cookies

2004-06-05 Thread Scot L. Harris
On Sat, 2004-06-05 at 11:55, Robert Winter wrote:
 Do I a prevent Internet Explorer 6 from blocking cookies (session cookies,
 etc)? Do I have to setup something in the  META HEADERS?
 
 Thanks
 Robert

I don't think you can override that from a web page.  If the user is
blocking cookies then the best you can do is show an alternate page
telling the user they need to enable cookies to work with your web
site.  

Face it, if web sites could override such settings there would be a lot
more malicious web sites out there.

-- 
Scot L. Harris [EMAIL PROTECTED]

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



[PHP] moderators?

2004-06-05 Thread Scot L. Harris
Not sure this has been discussed previously or if this is new.

It appears that when you send a message to the list there are two
messages sent back to the sender.

One appears to be a user that no longer exists.  That user is

[EMAIL PROTECTED]

The other one also appears to be an Unknown user:

[EMAIL PROTECTED]

If there is a moderator can these two accounts be removed from the list?



-- 
Scot L. Harris
[EMAIL PROTECTED]

Disobedience:  The silver lining to the cloud of servitude.
-- Ambrose Bierce 

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



RE: [PHP] php installation verification

2004-06-02 Thread Scot L. Harris
On Wed, 2004-06-02 at 16:47, Nguyen, Long P (Mission Systems) wrote:
 OK - I tried that and what came up on the browser was the content of the test.php 
 file.
 

 Open a file. Put this code in there:
 
 ?
 phpinfo();
 ?
 

Try:

?php
phpinfo();
?

-- 
Scot L. Harris
[EMAIL PROTECTED]

IF I HAD A MINE SHAFT, I don't think I would just abandon it.  There's
got to be a better way.
-- Jack Handley, The New Mexican, 1988. 

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



Re: [PHP] Identifying spam text

2004-05-28 Thread Scot L. Harris
On Fri, 2004-05-28 at 03:31, Merlin wrote:
 Hi there,
 
 I am running a community site in php, where members can be contacted through a 
 web form. Yesterday a guy contacted about 50 of those members with a spam text.
 
 Now I am trying to find a way to identify spam text via php. This looks like a 
 common task to me, so I hope that I have not to invent the wheel twice. Maybe 
 someone knows a good script to do this?
 
 Basicly it looks like that the text has to be checked against certain key words 
 and if they reach a certain amount of hits it is spam text.
 Has anybody a good idea on how to start on this?
 
 Thank you for any hint,
 
 Merlin

In your place I would utilize spamassassin to filter those outgoing
messages.  I use it on incoming email as filter with my email program. 
I pass each message to it and the return code tells me if it is spam or
not.  I then funnel messages marked as spam to a separate folder.

In your case you would take each outgoing message and run it through
spamassassin, evaluate the score assigned, and either pass it on or
redirect it for alternate processing.

Also by using spamassassin you can take advantage of its baysian
analysis.  You can train it so it recognizes the kind of traffic you
expect to see as ham and spam.  


-- 
Scot L. Harris [EMAIL PROTECTED]

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



[PHP] list explode and undefined references

2004-05-24 Thread Scot L. Harris
I came across an interesting problem today which I have found a work
around but was wondering if anyone on the list had a better way to solve
this problem.

Been writing some php scripts on a Linux system using PHP 4.2.2.  Basic
script works just fine there and does what is needed.

Moved this script over to a system running PHP 4.3.6 (and subsequently
to one running PHP 4.3.4) and found the script dumping a tremendous
number of warning messages.

Tracked this down to my use of arrays and the list and explode
functions.

working example code follows:

?php

$arrayvalues = array(alpha = 1, beta = 2, gamma = 3);

$data = array(alpha=first, junk, beta=last);  

$numvalues = count($data);

for($i=0;$i  $numvalues;$i++)
{
@list($parameter, $value) = explode(=,$data[$i]);

if(isset($arrayvalues[$parameter]))
{
switch($arrayvalues[$parameter])
{
case $arrayvalues[alpha]:
// something useful
echotest 1\n;
break;
case $arrayvalues[beta]:
// do something else
echotest 2\n;
break;
case $arrayvalues[gamma]:
// do more stuff
echotest 3\n;
break;
default:
// should never get here
echotest 4\n;
break;
}
}
}

?

The code above works as needed.  The problems I had to sort out however
was how to suppress error messages from the list() function since in one
case there is no second parameter to store in the list variables.  The
behavior between php 4.2.2 and php 4.3.x was different in this, 4.2.2
does not issue any warnings on that statement (without the @).

Similarly I had to add a test [the if(isset())] before letting the
switch statement evaluate the array value.  Without that check there is
an error issued and the default statement in the switch is executed. 
Which is kind of what I expected (except for the error).  Again 4.2.2
does not issue any kind of warnings or errors on this.

The errors being reported under PHP 4.3.x are:

if the @ is removed:

PHP Notice:  Undefined offset:  1 in /home/scot/work/testing/testone.php
on line 11

offset 1 has a value but in the one instance there is no offset 1
created by the explode function.

and if the isset test is removed: 

PHP Notice:  Undefined index:  junk in
/home/scot/work/testing/testone.php on line 15

There is no junk index into the arrayvalues array. 

I understand why these warnings are being issued, in both cases I
attempted to reference an element that does not exist or has not been
declared previously.

I was wondering if there is a better way to handle the error message
from the list() function other than just ignoring it.  Or going
overboard and creating my own error handling functions.





-- 
Scot L. Harris [EMAIL PROTECTED]


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