[PHP] RE: Browser Detection without use of browsecap.ini file

2002-03-22 Thread Tim Ward

$HTTP_ENV_VARS["HTTP_USER_AGENT"] contains this info if it's been sent

Tim Ward
Internet Chess www.chessish.com  

--
From:  R'twick Niceorgaw [SMTP:[EMAIL PROTECTED]]
Sent:  21 March 2002 17:06
To:  [EMAIL PROTECTED]
Subject:  Browser Detection without use of browsecap.ini file

Hi all,
is there any way, I can detect the browser without using
browsecap.ini file
? I'm simply interested to know if the user using netscape 4.x or
earlier.

I  tried get_browser() function but it returns blank! after checking
my
server's configuration i found browsecap file setting in
uninitialized. I'm
not sure if my hosting company will setit up properly for me, but
already
contacted them and waiting to hear a response form them..

Any help will be much appreciated.

R'twick



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




[PHP] Net status and free memory on freebsd

2002-03-22 Thread Charles Williams

Hey all,

I'm working on porting a php app to freebsd.  However, there is a problem.
;)

in linux you can parse /proc/net/dev for all network statistics and make a
call to free for available memory.  How could you do the same thing in
freebsd?

I have looked at "netstat -b -p ip -I ed0" but that outputs a huge page and
you have to grep for a line just to get close.  This means for each bit of
info you have to make multiple calls or store the entire return which is a
pain in the but.

I can't believe that freebsd wouldn't offer a better solution to this.  what
were they thinking?

any help greatly appreciated,

chuck



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




[PHP] Regular Expression Problem

2002-03-22 Thread Sharat Hegde

Hello,

In PHP3, I am using code which using the regular expression capability of 
PHP. The code matches all occurences of string prefixed by __ (2 
underscores) and having alphanumeric characters as well as _ (1 underscore) 
within it.

The code is as follows:

while (eregi("__([a-z0-9_]+)__", $ExpandedString, $Matches)) {

}

In PHP 4, the regular expression "__([a-z0-9_]+)__" does not seem to work. I 
tried "__([[:alnum:]_]+)__" also but that too did not work.

Looks like the problem is with combining two ranges and a literal within the 
regular expression

Any solution would be appreciated?

With Regards,
Sharat




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




[PHP] PHP and xEmacs

2002-03-22 Thread Gunter Ohrner

Hi!

Anyone in here who managed to get xEmacs working with psgml-html and 
php-mode combined? If yes, which php-mode did you use and what did you do?

I use psgml-html and Turadg Aleahmad's php-mode 1.0.2 (I just tried it with 
Fred Yankowski, too, getting excactly the same results) and tried to 
combine both using mmm-mode 0.4.7.

So far it does work, however I cannot indent the embedded php-code at all...
:-( Pressing TAB in a line just causes its indentation to get lost, that
is, the line starts at column 1, no matter if it's in a statemant block or
somewhere else.

Is there any solution to that problem or is there any preferable way to edit
embedded PHP code with xEmacs? I'd really like to use psgml-html for the 
non-PHP-parts of the file as I really got used to it.

Greetinx,

  Gunter Ohrner

-- 
The Supreme Life President of Hell wrote: "What business are we in???" He 
thought for a bit, and then carefully wrote, underneath: "We are in the 
damnation business!!!"-- (Terry Pratchett, Eric)
-+-+-+-+-+- PDEPP Webserver:  http://pdepp.SourceForge.net/ -+-+-+-+-+-


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




[PHP] Is the $this variable affectation authorized (clean enough)?

2002-03-22 Thread Jean-Pierre Arneodo

Hi,
is the $this variable affectation authorized
(clean enough)?
It's works in 4.1.x, but next php versions...

class X {
function polymorph($class){
// Backup vars here
$this=new $class();
// Restore vars here
}
}

What is the usage?
- A (MySQL) table
- A class to manage the table
- A class by record type

$x=new X();
$x->read_record(12);
switch($x->type){// Got by read_record
case 'X1':
case 'X2':
$x->polymorph($x->type);
break;
default:
exit(1);
}
$x->specific_method();// From X1 or X2 class



___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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




Re: [PHP] Append to the beginning of a file...

2002-03-22 Thread Chris Hewitt

Mauricio,

If you are on a *nix computer, you could append to the end of the file, 
close it and then do a "tail -n1" which will give you just the last line 
in the file.

HTH.
Regards

Chris

Mauricio Sthandier wrote:

>I guess I should do that.
>I need the plain file because is just a log of users registering in a Club,
>in a csv format.
>Using a database is just too much and not intended for this page... even
>when I would prefer using mysql. At least, I can handle that rather than the
>fopen and fwrite !.
>I could append but then I need to read the first 8 chars of the last line I
>appended... neither something I know how to do.
>If they were fixed I could... maybe I can fill it with blank chars the line
>until a given size ?
>
>Thanxs everyone for your replies.
>
>"Miguel Cruz" <[EMAIL PROTECTED]> escribi en el mensaje
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>>On Thu, 21 Mar 2002, Mauricio Sthandier wrote:
>>
>>>I guess thist must be really silly... but how can I append text to the
>>>beginning of a file ???
>>>I've been trying since a while... but all I get is overwriting !.
>>>
>>Open a temporary file, write your new data to it, copy the old file on to
>>the end of it, remove the old file, rename the temporary file with the old
>>file's name.
>>
>>Obviously this is not very efficient. Explore whether you really need to
>>prepend. Perhaps you can append and then read the file backwards a la tac?
>>Or perhaps a database is more useful. Or multiple files.
>>
>>miguel
>>
>
>
>




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




Re: [PHP] $HTTP_COOKIE_VARS

2002-03-22 Thread Jason Wong

On Friday 22 March 2002 05:27, Max Mouse wrote:
> I've tried using $HTTP_COOKIE_VARS to get information about the cookie has
> been passed to the current script but I always get a cookie size of 1
> containing no information. I have also tried using $_COOKIE but with no
> success. I'm running apache1.2.23 and php 4.1.2. Suggestions?

With 4.1.2,  $_COOKIE is the one to use. Do you have some code we could look 
at?


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
/earth: file system full.
*/

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




[PHP] mail() error checking function

2002-03-22 Thread Marc Bleuler

Hello all,

I have the bellow script which will be called from the following URL
"http://172.24.110.113/sendmail.php?[EMAIL PROTECTED]&body=this is a
test message". The "to" and "body" field in the URL are variable. The
problem I have, there is no error checking in this script, it replays always
with "Email has been sent..." even if the the user not exists. It would be
nice to have some error checking regarding the SMTP server response like 200
= message sent or 550 = unknown user, Is there a way to check this with
PHP? (Î'm sure there is...)
It would be nice if you cold provide some Code exsample because my
programming experiance is not very high.



--
";

$to = preg_replace("/^0041/", "0", $to);

$recipient = $to;
$subject = "OneBox, SMS to Email service";
$message .= " \n";
$message .= $body;
$message .= " \n";
$message .= " \n";
$message .= " \n";
$message .=
"--;
$message .= "body footer\n";
$message .=
"--;
$message .= " \n";
#$extra = "From: [EMAIL PROTECTED]";
#$extra = "From: SMS to E-Mail Service
<[EMAIL PROTECTED]>\r\nReturn-Pa;
$extra .= "From: SMS to E-Mail <[EMAIL PROTECTED]>\n";
$extra .= "X-Sender: <[EMAIL PROTECTED]>\n";
$extra .= "X-Mailer: PHP\n";
$extra .= "X-Priority: 3\n";
$extra .= "Return-Path: <[EMAIL PROTECTED]>\n";

mail ($recipient, $subject, $message, $extra);

echo "Email has been sent...";
echo "";
?>

--


Thanks for your support
Marc



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




[PHP] Forms

2002-03-22 Thread Ron

This is the first time that I have tried to conquer a form in PHP(which I
obviously am not doing) so that I can have a total PHP script page and move
away from HTML.

Here is my code as followed by my book (PHP Black Book) some variables have
been changed

 "radio",
  "question" => "What section is this Trouble Ticket being opened for?",
  "list" => $group);




function form($page, $question)
  {
  $text = "";
  while(list($group, $v) = each($question))
{

if(strlen($text)) {$text .= "";}
$function = "form_" . $v["type"];
$text .= $function($name. $v);
}
  return(""
  . $text
  . ""
  . "");
}

function form_radio($group, $parameters)
  {
  $output = "";
  while(list($k, $v) = each($parameters["list"]))
{
if(strlen($output))
  {
  $output .= "";
  }
$output .= "http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] A Newbie needs help with his first Class

2002-03-22 Thread Don

Hi,

I'm trying to write my first class.  Here is the code contained in a file called 
"globals.php":

$root_path = "/";
} else {
   $this->$root_path = $DOCUMENT_ROOT;
}
$this->$relative_path = $this->$root_path . $start_dir;
  }
}

$global = new Globals("/staging_area/phase-2/");
?>


Within my html page, I am tesing the class by trying the following:
root_path . "";
echo $global->relative_path . "";
?>

However, nothing is being written to my browser.  Is there a problem with the code?

Thanks,.
Don



Re: [PHP] Database Development Price Inquiry?

2002-03-22 Thread Miles Thompson

It depends on the project. I generally charge $50/hr and bill on a two week 
cycle.

Customers invariably want estimates, and I provide them, then warn when the 
requests for "extra functionality" start eating up the estimate. Generally 
they spring for the extra $$.

Worst customers? The ones who don't know what they want, or give the 
vaguest direction, and then you iterate from there. Those bills are usually 
astronomical, in the sense that what they ended up with could have been 
reached with a little more work and commitment at their end.

Regards - Miles Thompson


At 10:24 PM 3/21/2002 -0800, Robin Chen wrote:
>We calculate the charge by $75-$150 per hour depending on complexity of the
>project, then quote customer the final price.  On small projects, < $5000, its
>usually half before project, and half after project.  For project > $5000,
>it's usually 30% up front, 30% when we have major features completed, 30% when
>delivered, last 10% when finalized.  On even large projects $15k+, we usually
>go by phases.
>
>Robin
>
>"[-^-!-%-" wrote:
>
> > Hello everyone,
> >
> > I'm in the process of revising my db development prices, and was wondering
> > what the best practices were. I want to keep my prices low, but I often
> > feel like I'm not charging close to what I should be charging.
> >
> > 1) What is the going rate for Database Development (MySQL+PHP
> > or any other combo)?
> >
> > 2) What (or how) do you charge for MySQL+PHP database applications?
> > 3) What do you factor into your pricing?
> >
> > We currently package our prices by the project. Example, we
> > would charge one flat fee for an online database application.
> > This would include everything from start to finish. Sometimes
> > this works out, but other times it gets painful and tedious. I often feel
> > like I'm not charging as much as I should be.
> >
> > 4) What is the best practice for db development pricing?
> > Flat fee or hourly based? Do you charge based on the number of hours spent
> > (anticipated) or by the project complexity and/or size?
> >
> > 5) Do you charge in stages or upon completion? For example, do you charge
> > after the planning phase, development phase, etc. Or, after the project
> > is complete?
> >
> > I'm especially interested in hearing from the West Coast (USA) developers.
> > Any feedback would be greatly appreciated.
> >
> > Thanks.
> >
> > -john
> >
> > --
> > 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




[PHP] Re: Seek server hardware recommendation

2002-03-22 Thread Ron

All you really need is something quite basic

A Pentium II 450 would work with about 256mb RAM recommend 384 or 512. The
Hard drive size is really up to you and the amount of info you are going to
store on your site. You sound like you could easily get away with a 10GB HD.
Is this going to be for your office, home(internet site (hobby)).




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




[PHP] comparisons

2002-03-22 Thread Warwick Berg

Hi

Just learning php from the bottom. Can someone help with syntax please?

Want to know about using ifs :

If the string value "john" is present in the variable "jeff" then do, etc,
etc. How do we see if a value is present in a string?

Thanks
Warwick




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




[PHP] OpenDir

2002-03-22 Thread José León Serna

Hello:
I would like to use opendir to open a network resource
\\myserver\myresource , I use IIS, I think I have to give the user of IIS
permissions to log on that machine, but do you know how could I do it?.

Regards


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




RE: [PHP] Forms

2002-03-22 Thread Rick Emery

First:  I've not seen a print statement in that format before.
Second:  the following line has parameters misspelled twice.  Your function
is called with "parameters", not "paramaters"
  if(isset($paramater["default"]) and $v == $paramater["default"])

-Original Message-
From: Ron [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Forms


This is the first time that I have tried to conquer a form in PHP(which I
obviously am not doing) so that I can have a total PHP script page and move
away from HTML.

Here is my code as followed by my book (PHP Black Book) some variables have
been changed

 "radio",
  "question" => "What section is this Trouble Ticket being opened for?",
  "list" => $group);




function form($page, $question)
  {
  $text = "";
  while(list($group, $v) = each($question))
{

if(strlen($text)) {$text .= "";}
$function = "form_" . $v["type"];
$text .= $function($name. $v);
}
  return(""
  . $text
  . ""
  . "");
}

function form_radio($group, $parameters)
  {
  $output = "";
  while(list($k, $v) = each($parameters["list"]))
{
if(strlen($output))
  {
  $output .= "";
  }
$output .= "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




RE: [PHP] Forms

2002-03-22 Thread Rick Emery

One more suggestion:  prior to exiting the form_radio() function, print
$output to determine if it's the contents you expect

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:16 AM
To: 'Ron'; [EMAIL PROTECTED]
Subject: RE: [PHP] Forms


First:  I've not seen a print statement in that format before.
Second:  the following line has parameters misspelled twice.  Your function
is called with "parameters", not "paramaters"
  if(isset($paramater["default"]) and $v == $paramater["default"])

-Original Message-
From: Ron [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Forms


This is the first time that I have tried to conquer a form in PHP(which I
obviously am not doing) so that I can have a total PHP script page and move
away from HTML.

Here is my code as followed by my book (PHP Black Book) some variables have
been changed

 "radio",
  "question" => "What section is this Trouble Ticket being opened for?",
  "list" => $group);




function form($page, $question)
  {
  $text = "";
  while(list($group, $v) = each($question))
{

if(strlen($text)) {$text .= "";}
$function = "form_" . $v["type"];
$text .= $function($name. $v);
}
  return(""
  . $text
  . ""
  . "");
}

function form_radio($group, $parameters)
  {
  $output = "";
  while(list($k, $v) = each($parameters["list"]))
{
if(strlen($output))
  {
  $output .= "";
  }
$output .= "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




Re: [PHP] Forms

2002-03-22 Thread Dimitris Kossikidis

You 've missed this ")" .

Change it to print( form("tt.php", form_radio("group","parameters") ) );




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




RE: [PHP] comparisons

2002-03-22 Thread Rick Emery

if (ereg("john",$jeff) ) { }

or:

if( strstr( $jeff, "john") ) { }

or:

if( strpos( $jeff, "john") ) { }


-Original Message-
From: Warwick Berg [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 6:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] comparisons


Hi

Just learning php from the bottom. Can someone help with syntax please?

Want to know about using ifs :

If the string value "john" is present in the variable "jeff" then do, etc,
etc. How do we see if a value is present in a string?

Thanks
Warwick




-- 
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




RE: [PHP] A Newbie needs help with his first Class

2002-03-22 Thread Stampe, Lars

Hi,

Try and rename the function in your class to something else that the class
name, and let me know what happens!

Lars

-Original Message-
From: Don [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2002 13:01
To: php
Subject: [PHP] A Newbie needs help with his first Class


Hi,

I'm trying to write my first class.  Here is the code contained in a file
called "globals.php":

$root_path = "/";
} else {
   $this->$root_path = $DOCUMENT_ROOT;
}
$this->$relative_path = $this->$root_path . $start_dir;
  }
}

$global = new Globals("/staging_area/phase-2/");
?>


Within my html page, I am tesing the class by trying the following:
root_path . "";
echo $global->relative_path . "";
?>

However, nothing is being written to my browser.  Is there a problem with
the code?

Thanks,.
Don

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




RE: [PHP] comparisons

2002-03-22 Thread Rick Emery

we aims to please...

-Original Message-
From: J W W L (Warwick) Berg [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:45 AM
To: 'Rick Emery'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] comparisons


Hey thanks Rick

Appreciate it.

Regards..
Warwick Berg


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent: Friday, 22 March 2002 11:42
To: 'Warwick Berg'; [EMAIL PROTECTED]
Subject: RE: [PHP] comparisons


if (ereg("john",$jeff) ) { }

or:

if( strstr( $jeff, "john") ) { }

or:

if( strpos( $jeff, "john") ) { }


-Original Message-
From: Warwick Berg [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 6:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] comparisons


Hi

Just learning php from the bottom. Can someone help with syntax please?

Want to know about using ifs :

If the string value "john" is present in the variable "jeff" then do,
etc, etc. How do we see if a value is present in a string?

Thanks
Warwick




-- 
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




Re: [PHP] comparisons

2002-03-22 Thread Andrey Hristov


> if (ereg("john",$jeff) ) { }
> 
ok
> or:
> 
> if( strstr( $jeff, "john") ) { }
> 
ok
> or:
> 
> if( strpos( $jeff, "john") ) { }
error

if  (strpos($jeff, "john") !== FALSE)

Best regards,
Andrey Hristov



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




RE: [PHP] A Newbie needs help with his first Class

2002-03-22 Thread Stampe, Lars

And then replace

$global = new Globals("/staging_area/phase-2/");

with

$global = new Globals;
$global->someting else("/staging_area/phase-2/");

Lars

-Original Message-
From: Stampe, Lars [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2002 13:46
To: 'Don'; php
Subject: RE: [PHP] A Newbie needs help with his first Class


Hi,

Try and rename the function in your class to something else that the class
name, and let me know what happens!

Lars

-Original Message-
From: Don [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2002 13:01
To: php
Subject: [PHP] A Newbie needs help with his first Class


Hi,

I'm trying to write my first class.  Here is the code contained in a file
called "globals.php":

$root_path = "/";
} else {
   $this->$root_path = $DOCUMENT_ROOT;
}
$this->$relative_path = $this->$root_path . $start_dir;
  }
}

$global = new Globals("/staging_area/phase-2/");
?>


Within my html page, I am tesing the class by trying the following:
root_path . "";
echo $global->relative_path . "";
?>

However, nothing is being written to my browser.  Is there a problem with
the code?

Thanks,.
Don

-- 
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] RE: [PHP-DB] Forms

2002-03-22 Thread Rick Emery

First:  cross-posting to multiple lists...not nice.  Most PHP folks are on
both lists.
Second: your first sentence seems to indicate that unknowledgeable people
inhabit the PHP list, vice the PHP-DB list.  H 
Third: what error do you get when you get the parsing error?

-Original Message-
From: Ron [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Forms


I know this is suppose to be databases, but the most knowledgeable people
seem to be in here.

This is the first time that I have tried to conquer a form in PHP(which I
obviously am not doing) so that I can have a total PHP script page and move
away from HTML.

Here is my code as followed by my book (PHP Black Book) some variables have
been changed

 "radio",
  "question" => "What section is this Trouble Ticket being opened for?",
  "list" => $group);




function form($page, $question)
  {
  $text = "";
  while(list($group, $v) = each($question))
{

if(strlen($text)) {$text .= "";}
$function = "form_" . $v["type"];
$text .= $function($name. $v);
}
  return(""
  . $text
  . ""
  . "");
}

function form_radio($group, $parameters)
  {
  $output = "";
  while(list($k, $v) = each($parameters["list"]))
{
if(strlen($output))
  {
  $output .= "";
  }
$output .= "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




RE: [PHP] A Newbie needs help with his first Class

2002-03-22 Thread Hunter, Ray


Don't declare the new object in the file.

I would declare the new object in the script that you are running in the
browser.

Example...

root_path . ""; 
echo $global->relative_path . ""; 

?>


Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


> -Original Message-
> From: Stampe, Lars [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, March 22, 2002 6:46 AM
> To: 'Don'; php
> Subject: RE: [PHP] A Newbie needs help with his first Class
> 
> 
> Hi,
> 
> Try and rename the function in your class to something else 
> that the class name, and let me know what happens!
> 
> Lars
> 
> -Original Message-
> From: Don [mailto:[EMAIL PROTECTED]]
> Sent: 22 March 2002 13:01
> To: php
> Subject: [PHP] A Newbie needs help with his first Class
> 
> 
> Hi,
> 
> I'm trying to write my first class.  Here is the code 
> contained in a file called "globals.php":
> 
>  class Globals
> {
>   var $gDISPLAY  = 1;/* Display graphic - no rollover */
>   var $gROLLOVER = 2; /* Display graphic with rollover */
>   var $root_path;/* Path to document root directory */
>   var $relative_path;/* Path from document root 
> to relative root
> directory */
> 
>   function Globals($start_dir)
>   {
> if ( strlen($DOCUMENT_ROOT) == 0) {
>$this->$root_path = "/";
> } else {
>$this->$root_path = $DOCUMENT_ROOT;
> }
> $this->$relative_path = $this->$root_path . $start_dir;
>   }
> }
> 
> $global = new Globals("/staging_area/phase-2/");
> ?>
> 
> 
> Within my html page, I am tesing the class by trying the 
> following:  $global->root_path . ""; echo $global->relative_path . ""; ?>
> 
> However, nothing is being written to my browser.  Is there a 
> problem with the code?
> 
> Thanks,.
> Don
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



RE: [PHP] A Newbie needs help with his first Class

2002-03-22 Thread Rick Emery

Don's original declaration is correct.  It refers to a constructor.  Without
a parameter, the new() will fail.

-Original Message-
From: Stampe, Lars [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:53 AM
To: 'Don'; php
Subject: RE: [PHP] A Newbie needs help with his first Class


And then replace

$global = new Globals("/staging_area/phase-2/");

with

$global = new Globals;
$global->someting else("/staging_area/phase-2/");

Lars

-Original Message-
From: Stampe, Lars [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2002 13:46
To: 'Don'; php
Subject: RE: [PHP] A Newbie needs help with his first Class


Hi,

Try and rename the function in your class to something else that the class
name, and let me know what happens!

Lars

-Original Message-
From: Don [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2002 13:01
To: php
Subject: [PHP] A Newbie needs help with his first Class


Hi,

I'm trying to write my first class.  Here is the code contained in a file
called "globals.php":

$root_path = "/";
} else {
   $this->$root_path = $DOCUMENT_ROOT;
}
$this->$relative_path = $this->$root_path . $start_dir;
  }
}

$global = new Globals("/staging_area/phase-2/");
?>


Within my html page, I am tesing the class by trying the following:
root_path . "";
echo $global->relative_path . "";
?>

However, nothing is being written to my browser.  Is there a problem with
the code?

Thanks,.
Don

-- 
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




RE: [PHP] comparisons

2002-03-22 Thread Rick Emery

Andrey, you are incorrect.

>From the manual on strpos():
int strpos (string haystack, string needle [, int offset])
If needle is not found, returns FALSE. 

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 7:47 AM
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] comparisons



> if (ereg("john",$jeff) ) { }
> 
ok
> or:
> 
> if( strstr( $jeff, "john") ) { }
> 
ok
> or:
> 
> if( strpos( $jeff, "john") ) { }
error

if  (strpos($jeff, "john") !== FALSE)

Best regards,
Andrey Hristov


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




RE: [PHP] Problem with strtotime() and 2002-03-31

2002-03-22 Thread Ford, Mike [LSS]

> -Original Message-
> From: John Clarke [mailto:[EMAIL PROTECTED]]
> Sent: 20 March 2002 00:40
> 
> I have used the following script successfully for a year now, 
> but have just
> found a problem with the date 2002-03-31.
> 
> Any ideas why this would be happening?
> 
> function addDays($date,$nofdays) {
>   $dd=strtotime($date);
>   $dd2=$dd + (3600*24*$nofdays);
>   return date("Y-m-d", $dd2);
> }
> $nd=addDays("2002-03-31","2");
> echo $nd

This will be, indeed, an issue with the daylight-saving time transition which, at 
least hereabouts, occurs on 31-March/2002.

But, since you're using strtotime anyway, why don't you just use its relative offset 
capabilities to do your conversion:

  function addDays($date,$nofdays) {
$dd2 = strtotime("+$nofdays days", $date);
return date("Y-m-d", $dd2);
  }

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] A Newbie needs help with his first Class

2002-03-22 Thread Hunter, Ray

The way that Warwick has it set up is fine as long as you create the new in
the script that is being called by the browsers so that you can access the
class variables...I do not see the need to change the function name unless
it conflicts with any predefined variables.



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


> -Original Message-
> From: Rick Emery [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, March 22, 2002 6:57 AM
> To: 'Stampe, Lars'; 'Don'; php
> Subject: RE: [PHP] A Newbie needs help with his first Class
> 
> 
> Don's original declaration is correct.  It refers to a 
> constructor.  Without a parameter, the new() will fail.
> 
> -Original Message-
> From: Stampe, Lars [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 7:53 AM
> To: 'Don'; php
> Subject: RE: [PHP] A Newbie needs help with his first Class
> 
> 
> And then replace
> 
> $global = new Globals("/staging_area/phase-2/");
> 
> with
> 
> $global = new Globals;
> $global->someting else("/staging_area/phase-2/");
> 
> Lars
> 
> -Original Message-
> From: Stampe, Lars [mailto:[EMAIL PROTECTED]]
> Sent: 22 March 2002 13:46
> To: 'Don'; php
> Subject: RE: [PHP] A Newbie needs help with his first Class
> 
> 
> Hi,
> 
> Try and rename the function in your class to something else 
> that the class name, and let me know what happens!
> 
> Lars
> 
> -Original Message-
> From: Don [mailto:[EMAIL PROTECTED]]
> Sent: 22 March 2002 13:01
> To: php
> Subject: [PHP] A Newbie needs help with his first Class
> 
> 
> Hi,
> 
> I'm trying to write my first class.  Here is the code 
> contained in a file called "globals.php":
> 
>  class Globals
> {
>   var $gDISPLAY  = 1;/* Display graphic - no rollover */
>   var $gROLLOVER = 2; /* Display graphic with rollover */
>   var $root_path;/* Path to document root directory */
>   var $relative_path;/* Path from document root 
> to relative root
> directory */
> 
>   function Globals($start_dir)
>   {
> if ( strlen($DOCUMENT_ROOT) == 0) {
>$this->$root_path = "/";
> } else {
>$this->$root_path = $DOCUMENT_ROOT;
> }
> $this->$relative_path = $this->$root_path . $start_dir;
>   }
> }
> 
> $global = new Globals("/staging_area/phase-2/");
> ?>
> 
> 
> Within my html page, I am tesing the class by trying the 
> following:  $global->root_path . ""; echo $global->relative_path . ""; ?>
> 
> However, nothing is being written to my browser.  Is there a 
> problem with the code?
> 
> Thanks,.
> Don
> 
> -- 
> 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
> 



Re: [PHP] comparisons

2002-03-22 Thread Andrey Hristov

>From the docs :
Note: It is easy to mistake the return values for "character found at position 0" and 
"character not found".  Here's how to detect
the difference:

// in PHP 4.0b3 and newer:
$pos = strpos($mystring, "b");
if ($pos === false) { // note: three equal signs
// not found...
}

// in versions older than 4.0b3:
$pos = strpos($mystring, "b");
if (!is_integer($pos)) {
// not found...
}

Andrey

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'Andrey Hristov'" <[EMAIL PROTECTED]>; "Rick Emery" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 3:58 PM
Subject: RE: [PHP] comparisons


> Andrey, you are incorrect.
>
> From the manual on strpos():
> int strpos (string haystack, string needle [, int offset])
> If needle is not found, returns FALSE.
>
> -Original Message-
> From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 7:47 AM
> To: Rick Emery
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] comparisons
>
>
>
> > if (ereg("john",$jeff) ) { }
> >
> ok
> > or:
> >
> > if( strstr( $jeff, "john") ) { }
> >
> ok
> > or:
> >
> > if( strpos( $jeff, "john") ) { }
> error
>
> if  (strpos($jeff, "john") !== FALSE)
>
> Best regards,
> Andrey Hristov
>
>
> --
> 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




RE: [PHP] comparisons

2002-03-22 Thread Rick Emery

ahhhinteresting.

thank you for the clarification

I stand humbled, head bowed...

rick

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 8:03 AM
To: Rick Emery
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] comparisons


>From the docs :
Note: It is easy to mistake the return values for "character found at
position 0" and "character not found".  Here's how to detect
the difference:

// in PHP 4.0b3 and newer:
$pos = strpos($mystring, "b");
if ($pos === false) { // note: three equal signs
// not found...
}

// in versions older than 4.0b3:
$pos = strpos($mystring, "b");
if (!is_integer($pos)) {
// not found...
}

Andrey

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'Andrey Hristov'" <[EMAIL PROTECTED]>; "Rick Emery"
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 3:58 PM
Subject: RE: [PHP] comparisons


> Andrey, you are incorrect.
>
> From the manual on strpos():
> int strpos (string haystack, string needle [, int offset])
> If needle is not found, returns FALSE.
>
> -Original Message-
> From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 7:47 AM
> To: Rick Emery
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] comparisons
>
>
>
> > if (ereg("john",$jeff) ) { }
> >
> ok
> > or:
> >
> > if( strstr( $jeff, "john") ) { }
> >
> ok
> > or:
> >
> > if( strpos( $jeff, "john") ) { }
> error
>
> if  (strpos($jeff, "john") !== FALSE)
>
> Best regards,
> Andrey Hristov
>
>
> --
> 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] Re: comparisons

2002-03-22 Thread Jason Sheets

Hi Warwick

I'd suggest looking at the PHP manual, it is available at
http://www.php.net.

You can look for string functions in the manual.

If you were looking for a case insensitive comparision you could use
stristr, if you are looking for a case senstivie comparision you could use
strstr.



If you are trying to see if the variable is John then you could do this



There are other ways to do this, this is just an example I created.

Jason
- Original Message -
From: "Warwick Berg" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 5:55 AM
Subject: comparisons


> Hi
>
> Just learning php from the bottom. Can someone help with syntax please?
>
> Want to know about using ifs :
>
> If the string value "john" is present in the variable "jeff" then do, etc,
> etc. How do we see if a value is present in a string?
>
> Thanks
> Warwick
>
>
>


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




[PHP] converting a password database from perl to php

2002-03-22 Thread R'twick Niceorgaw

Hi all,
I'm converting a site written in perl to php. It has a member section which
is password protected. All the meber passwords are stored in a flat file
with Perl's MD5 encryption algorithm. I'm planning to use MYSQL database to
store the member info on the new site. However, I have to import the
existing member information including their passwords to the new system. I
was checking the md5() and crypt() functions of PHP but theydon't generate
the same encrypted password as Perl md5(). Is there any way I can migrate
these passwords to php without asking each user to update their password on
the new system ?

Regards
R'twick



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




[PHP] copying and pasting bullets from Word to php/mysql

2002-03-22 Thread Mallen Baker

Hi - this is my first shift from happy and constructive lurking to a question. 

I am putting together a php/mysql set-up for "jobs" pages for a not-for-profit 
organisation. To make it easy for the hr manager, I want the form that enters the job 
details into the database to be able to have content copied and pasted into it from 
word documents.

Using nl2br() is fine, but my big problem is bullet points. Many of the job specs use 
bullet points, and although I can replace the non-standard bullet character with a 
"" I can't work out how to put in a piece of code that will put in the other tags 
to make it legal code. Getting a "" in front of the very first bullet is easy 
enough, but not getting  at the end, nor indeed spotting if there are two 
separate bullet lists and adapting the code accordingly.

Any thoughts? - 

Many thanks - Mallen



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk


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




RE: [PHP] Regular Expression Problem

2002-03-22 Thread Rick Emery

__([a-z0-9][a-z0-9_]+)__

-Original Message-
From: Sharat Hegde [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 4:22 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Regular Expression Problem


Hello,

In PHP3, I am using code which using the regular expression capability of 
PHP. The code matches all occurences of string prefixed by __ (2 
underscores) and having alphanumeric characters as well as _ (1 underscore) 
within it.

The code is as follows:

while (eregi("__([a-z0-9_]+)__", $ExpandedString, $Matches)) {

}

In PHP 4, the regular expression "__([a-z0-9_]+)__" does not seem to work. I

tried "__([[:alnum:]_]+)__" also but that too did not work.

Looks like the problem is with combining two ranges and a literal within the

regular expression

Any solution would be appreciated?

With Regards,
Sharat




_
Chat with friends online, try MSN Messenger: http://messenger.msn.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




[PHP] Netware version/port

2002-03-22 Thread PVL

I have heard rumours that a NW port of PHP is coming. Anyone else heard
this? Any time frame?

tia



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




[PHP] Re: bigendian vs littleendian

2002-03-22 Thread Mika Tuupola

On Thu, 21 Mar 2002, Mika Tuupola wrote:

>   How can I make 
> 
>   $double = pack("d",   $val);
> 
>   to produce same value when run on bigendian host as what
>   it would result when running in a littleendian host?


Answering to myself here,  strrev()  is your friend ;)

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/


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




[PHP] Re: A Newbie needs help with his first Class

2002-03-22 Thread Julio Nobrega Trabalhando

  $DOCUMENT_ROOT inside a function, scope problems. Pass it as an argument
or global, or use $_SERVER['DOCUMENT_ROOT'];

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


"Don" <[EMAIL PROTECTED]> wrote in message
000f01c1d1a1$9105c9a0$[EMAIL PROTECTED]">news:000f01c1d1a1$9105c9a0$[EMAIL PROTECTED]...
Hi,

I'm trying to write my first class.  Here is the code contained in a file
called "globals.php":

$root_path = "/";
} else {
   $this->$root_path = $DOCUMENT_ROOT;
}
$this->$relative_path = $this->$root_path . $start_dir;
  }
}

$global = new Globals("/staging_area/phase-2/");
?>


Within my html page, I am tesing the class by trying the following:
root_path . "";
echo $global->relative_path . "";
?>

However, nothing is being written to my browser.  Is there a problem with
the code?

Thanks,.
Don



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




[PHP] Tool to remove comments??

2002-03-22 Thread Oliver Heinisch

Hi Folks,
does anybody know a tool for removing comments out of PHP scripts?

I mean // this is a comment
and /* this is also a comment */

it should also handle  something like
echo'http://somewher.somecom/somepage'; // this goes to somewhere
and multiline comment like
/*
..blah
*/
maybe anybody has an awk script, that he/she will share with me.
TIA Oliver


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




[PHP] Strange problem passing variables

2002-03-22 Thread Jean-Arthur Silve

Hi,

A friend of me use PHP4.1.2 on Linux+Apache

Here is the problem :

He pass a parameter using GET method :

http://www.domain.com/test.php?TESTV=1234


test.php is :

";
echo $HTTP_GET_VARS["TESTV"]."";
phpinfos();
?>


But in the script all variables are empty ($TESTV and $HTTP_GET_VARS["TESTV"]).

phpinfos() shows QUERY_STRING environment variable is empty...

any idea ??

Thank you !







EuroVox
4, place Félix Eboue
75583 Paris Cedex 12
Tel : 01 44 67 05 05
Fax : 01 44 67 05 19
Web : http://www.eurovox.fr



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




RE: [PHP] Strange problem passing variables

2002-03-22 Thread Hunter, Ray

Try using $_GET['varnamehere']

Ray Hunter

-Original Message-
From: Jean-Arthur Silve [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 22, 2002 8:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Strange problem passing variables

Hi,

A friend of me use PHP4.1.2 on Linux+Apache

Here is the problem :

He pass a parameter using GET method :

http://www.domain.com/test.php?TESTV=1234


test.php is :

";
echo $HTTP_GET_VARS["TESTV"]."";
phpinfos();
?>


But in the script all variables are empty ($TESTV and
$HTTP_GET_VARS["TESTV"]).

phpinfos() shows QUERY_STRING environment variable is empty...

any idea ??

Thank you !







EuroVox
4, place Félix Eboue
75583 Paris Cedex 12
Tel : 01 44 67 05 05
Fax : 01 44 67 05 19
Web : http://www.eurovox.fr



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



[PHP] Displaying data from db

2002-03-22 Thread Vlad Kulchitski


Hi,

I have several questions.

First what would be the best solution to take the records from the
database and display like 10 results per page? 

Another question, the same records from the database, but say I want to
sort them by name. Like I have a menu: a,b,c,d,e,f,g,h.. etc.
And if I click 'a' I only get records with name starting with A. Is this
possible?

I am not necessarily asking for a complete code to reuse, just the
logic, how it would work.

Thanks in advance,
Vlad


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




RE: [PHP] Displaying data from db

2002-03-22 Thread Rick Emery

>  First what would be the best solution to take the records from the
>  database and display like 10 results per page? 

Check the list archives and php.net.  There are many examples of this
functionality

>  Another question, the same records from the database, but say I want to
>  sort them by name. Like I have a menu: a,b,c,d,e,f,g,h.. etc.
>  And if I click 'a' I only get records with name starting with A. Is this
>  possible?

yes, it's possible.  Use a drop-down list, radio buttons, or hyper-links
mysql:  SELECT * FROM mytable WHERE mydata LIKE "$alpha%"

this assumes $alpha contains the single character you are searching for


-Original Message-
From: Vlad Kulchitski [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 9:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Displaying data from db



Hi,

I have several questions.

First what would be the best solution to take the records from the
database and display like 10 results per page? 

Another question, the same records from the database, but say I want to
sort them by name. Like I have a menu: a,b,c,d,e,f,g,h.. etc.
And if I click 'a' I only get records with name starting with A. Is this
possible?

I am not necessarily asking for a complete code to reuse, just the
logic, how it would work.

Thanks in advance,
Vlad


-- 
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




Re: [PHP] Session Varaible Problem

2002-03-22 Thread Randy Phillips


> 
> Are you calling session_start() on the subsequent pages you want to be
> part of the session?


No I was not. That was the problem. Thanks Rasmus.

-- 
Rp


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




[PHP] Weird fsockopen behavior

2002-03-22 Thread Boaz Yahav

Hi

I'm using 

$fp=fsockopen($URL,80, &$errno, &$errstr,10); 
set_socket_blocking($fp,false);

to get the HTML from a remote site and monitor how long it took me to DL
the HTML.

The next lines are like this :

if ($fp) {
$SendGetStart = getmicrotime();
fwrite($fp,"GET / HTTP/1.1\r\n");
fwrite($fp,"Accept: */*\r\n");
fwrite($fp,"Accept-Language: en-us\r\n");
fwrite($fp,"Proxy-Connection: Keep-Alive\r\n");
fwrite($fp,"User-Agent: Mozilla/4.0 (compatible; MSIE 5.5;
Windows NT 5.0; COM+ 1.0.2204)\r\n");
fwrite($fp,"Host:$Host\r\n\r\n");

..

While(!feof($fp)) {...


The weird thing is that it seems the EOF comes in great delay. When I
print the HTML I get from the remote site, the while loop continues for
about 10-15 seconds after the last  tag arrived. This is for any
site I check so it's not something specific to the web server I'm
testing. 

Anyone has any idea why?

Thanks

berber

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




[PHP] CICS call?

2002-03-22 Thread Batch

Hey all,

I was just curious if anyone knows how or even if PHP4 can make a CICS call
to a mainframe system.  I need to grab some data from a mainframe realtime.


Thanks in advance.

Batch



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




RE: [PHP] Weird fsockopen behavior - SOLUTION

2002-03-22 Thread Boaz Yahav

I feel pretty sheepish but it always happens to me. I found this note in
the manual and it seems to solve the problem.
So if anyone has this problem.

berber



User Contributed Notes
fsockopen   
[EMAIL PROTECTED]
08-Jan-2002 06:30 
 
This is a "gotcha" that "got me" and discusses the
careful use of HTTP/1.1 over HTTP/1.0
 
I had a script that suffered dreadful performance and return Hex values
amongst the correct data. This was eventually traced to my inclusion of
HTTP/1.1 in the line which read:

-- CODE (watch wrap) --
  $request = "GET $document" . "?" .
"$query" . " HTTP/1.1\r\n";
  $request .= "Host: $myServer\r\n\r\n";
-- CODE --

By sending a HTTP/1.1 request it declares that it is willing to 'speak'
HTTP/1.1, of course, but there are some aspects of HTTP/1.1 that make it
necessary to handle the socket differently from HTTP/1.0. 

In the RFC 2616, Section 3.6 defines:

[...]
All HTTP/1.1 applications MUST be able to receive and decode the
"chunked" transfer-coding,
[...]

This was the cause of the extraneous HEX values being displayed.

Regards the loss of performance, this is also due to using HTTP/1.1,
which
defaults to having keepalive on until you tell it to close the
connection,
or it times out. Therefore the socket was being kept open by the script.

Simply changing the line in the script to HTTP/1.0 completely fixed the
problem.

Speaking with one of the members in PHP-dev his words were:

[Comment from Hartmut Holzgraefe]
"I stumbled over the same 'chunked' problem not to long ago as a rule
of thumb: never use HTTP/1.1 unless you really know that you have to,
claiming to be a HTTP/1.0 client is no problem."

I have posted this as it was something I found very difficult to debug
as
there is actually nothing wrong with the script. This sort of problem
often requires an in depth knowledge of an area that most developers
would
not have or consider. I would doubt that many, in any, who are reading
this have ever read the HTTP RFC 2616 (I doubt also that it is a
rivetting
read :))  I hope this helps any future developers who are considering
the
use of high level socket connections with HTTP/1.1.
 
 

-Original Message-
From: Boaz Yahav 
Sent: Friday, March 22, 2002 5:49 PM
To: PHP General (E-mail)
Subject: [PHP] Weird fsockopen behavior


Hi

I'm using 

$fp=fsockopen($URL,80, &$errno, &$errstr,10); 
set_socket_blocking($fp,false);

to get the HTML from a remote site and monitor how long it took me to DL
the HTML.

The next lines are like this :

if ($fp) {
$SendGetStart = getmicrotime();
fwrite($fp,"GET / HTTP/1.1\r\n");
fwrite($fp,"Accept: */*\r\n");
fwrite($fp,"Accept-Language: en-us\r\n");
fwrite($fp,"Proxy-Connection: Keep-Alive\r\n");
fwrite($fp,"User-Agent: Mozilla/4.0 (compatible; MSIE 5.5;
Windows NT 5.0; COM+ 1.0.2204)\r\n");
fwrite($fp,"Host:$Host\r\n\r\n");

..

While(!feof($fp)) {...


The weird thing is that it seems the EOF comes in great delay. When I
print the HTML I get from the remote site, the while loop continues for
about 10-15 seconds after the last  tag arrived. This is for any
site I check so it's not something specific to the web server I'm
testing. 

Anyone has any idea why?

Thanks

berber

-- 
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




Re: [PHP] Trap CR or "Enter" possible?

2002-03-22 Thread Erik Price


On Friday, March 22, 2002, at 12:11  AM, Jason Wong wrote:

> But, what are the undesirable effects of just pressing enter? I know 
> that in
> IE pressing enter to submit a form is not the same as clicking on the 
> submit
> button. If that is what you are referring to then it's very easy to code
> around that and thus would not require javascript.

I have noticed that pressing enter in IE does achieve the same effect as 
pressing the "submit" button for my forms.  But I have also heard that 
it's not really "the same", especially if there are more than one 
"submit"-style inputs for the given form.  What does Enter "really" do 
in IE?

Side note to the original poster: in the script that is the target of 
the form you are writing, you may be able to test for the presence of 
the "submit" variable -- if this value is not present, then the user has 
not clicked the Submit button.  I know that the "value" of a submit 
input is usually just used to label the button in some way (such as 
value="Click Here for Free Porn!"), but you can actually test for this 
value if you have given the Submit input a name.  I may be wrong about 
this, though.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] converting a password database from perl to php

2002-03-22 Thread Rasmus Lerdorf

Show us an example Perl one.  Chances are you can get the PHP crypt()
function to do the right thing by feeding it the correct SALT.

-Rasmus

On Fri, 22 Mar 2002, R'twick Niceorgaw wrote:

> Hi all,
> I'm converting a site written in perl to php. It has a member section which
> is password protected. All the meber passwords are stored in a flat file
> with Perl's MD5 encryption algorithm. I'm planning to use MYSQL database to
> store the member info on the new site. However, I have to import the
> existing member information including their passwords to the new system. I
> was checking the md5() and crypt() functions of PHP but theydon't generate
> the same encrypted password as Perl md5(). Is there any way I can migrate
> these passwords to php without asking each user to update their password on
> the new system ?
>
> Regards
> R'twick
>
>
>
> --
> 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] Weird error...

2002-03-22 Thread Phil Schwarzmann

What does this error mean??
 
Fatal error: Allowed memory size of 8388608 bytes exhausted at
zend_language_scanner.c:4248 (tried to allocate 9 bytes) in
/blah/blah/afteradmin2.php on line 37
 
here is line #37...
$usertemp = mysql_result($result_all, $i, "username");
 
 

THANKS!!!



Re: [PHP] converting a password database from perl to php

2002-03-22 Thread R'twick Niceorgaw

Hi Rasmus,
Here's what  used in the perl script.
--
use Digest::MD5;
use Digest::MD5 qw( md5_hex );
my $encrypt_password;
my $digestObject = Digest::MD5->new();
$digestObject->add("$password");
$encrypt_password = $digestObject->digest();

Here's a sample result form it.

text password : f0rget123
encrypted password: òOú«#7Fá73¯

Under PHP I'm getting a much bigger string with MD5() for the same clear
password string.

Thank you for helping me out with this.

Regards
R'twick

- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "R'twick Niceorgaw" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 11:07 AM
Subject: Re: [PHP] converting a password database from perl to php


> Show us an example Perl one.  Chances are you can get the PHP crypt()
> function to do the right thing by feeding it the correct SALT.
>
> -Rasmus
>
> On Fri, 22 Mar 2002, R'twick Niceorgaw wrote:
>
> > Hi all,
> > I'm converting a site written in perl to php. It has a member section
which
> > is password protected. All the meber passwords are stored in a flat file
> > with Perl's MD5 encryption algorithm. I'm planning to use MYSQL database
to
> > store the member info on the new site. However, I have to import the
> > existing member information including their passwords to the new system.
I
> > was checking the md5() and crypt() functions of PHP but theydon't
generate
> > the same encrypted password as Perl md5(). Is there any way I can
migrate
> > these passwords to php without asking each user to update their password
on
> > the new system ?
> >
> > Regards
> > R'twick
> >
> >
> >
> > --
> > 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




Re: [PHP] converting a password database from perl to php

2002-03-22 Thread Rasmus Lerdorf

> text password : f0rget123
> encrypted password: òOú«#7Fá73¯

Uh, that's not md5 at all.  By definition md5 is 32 characters.

-Rasmus


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




[PHP] Phptriad

2002-03-22 Thread Karina Trincado


Hi,

I´m new to php. I have installed phptriad in Windows2000 using also IIS5 as an 
alternative web server.

I have tried to test some http authentication scritps but they don´t seem to work. 
(Using apache I got an internal error and using IIS, i sucessfully show the 
authentication dialog box, but later the server gets blocked)

I have some questions:

- does the phptriad install php as an apache module or as a cgi? How could I know the 
difference?

- Using php as a cgi what kind of http authentication i should use? I have read that 
the http authentication could only be used when PHP is installed as a module. Also I 
have read that the IIS has a limitation with this.

What would you recommend me? Any answer would be greatly appreciated.

Kary



-
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®


[PHP] calculation based on checkbox

2002-03-22 Thread jas

 10) { # if the users ad has more than 10 words in it than
$quarters = the extra words times .20
 $subtractor = $num - 10;
 $quarters = $subtractor * .20;
}
$subtotal = $price + $quarters; # price plus the number of words over 10
$total = $papers * $subtotal; # new price multiplied by number of papers
$total = $total * $weeks; # new new price multiplied by number of weeks
$total = sprintf ("%01.2f", $total);
?>
Here is part of my function thus far, and the output is a simple $$ based on
the number of words, I just need to add an IF statement to determine whether
or not I will need to subtract a certain amount if a checkbox is checked. I
am assuming that the IF statement would be something like...
IF $variable = 1; {
 $variable - $total = $total2
)
Else do the rest of the code...
I am still a newbie to php so any help would be great.
Thanks in advance,
Jas




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




[PHP] Re: RC4Crypt encryption opinions

2002-03-22 Thread Steve Clay

Maxwell,

I tried it out.  The sample test crashed the PHP 4.0.5 CGI binary everytime on my winNT
system.  No script has ever /crashed/ the executable before, just might be worth note.

Steve

Friday, March 22, 2002, 12:45:11 AM, . wrote:
> I'm looking for opinions on RC4Crypt
-- 
[EMAIL PROTECTED] ** http://mrclay.org


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




RE: [PHP] calculation based on checkbox

2002-03-22 Thread SHEETS,JASON (Non-HP-Boise,ex1)

If your checkbox name was cbox setup as  you could check for it like this




You could also just check to make sure that the box variable is set rather
than comparing its value



Jason
-Original Message-
From: jas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 10:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] calculation based on checkbox


 10) { # if the users ad has more than 10 words in it than
$quarters = the extra words times .20
 $subtractor = $num - 10;
 $quarters = $subtractor * .20;
}
$subtotal = $price + $quarters; # price plus the number of words over 10
$total = $papers * $subtotal; # new price multiplied by number of papers
$total = $total * $weeks; # new new price multiplied by number of weeks
$total = sprintf ("%01.2f", $total);
?>
Here is part of my function thus far, and the output is a simple $$ based on
the number of words, I just need to add an IF statement to determine whether
or not I will need to subtract a certain amount if a checkbox is checked. I
am assuming that the IF statement would be something like...
IF $variable = 1; {
 $variable - $total = $total2
)
Else do the rest of the code...
I am still a newbie to php so any help would be great.
Thanks in advance,
Jas




-- 
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] Maillist

2002-03-22 Thread Ashley M. Kirchner


I need to send out several hundred, to several thousand emails out of our
database.  Now, before everyone starts telling me to use an actual MLM for
this, let me explain what I need to do.

I need to send a unique ID with each message, in the form of a URL.  We
want to make unsubscribing as easy as possible for our clients, so what I plan
on doing is sending out a URL in the body of the message that contains a unique
ID.  When they click on that URL, it hits another script on our website which
than takes that ID, searches for it in the database and flags that record (and
returns a 'Thank you' page.)

So, somehow, I need to generate a unique ID for each message send, stick
that ID into the database with the corresponding email address that it was just
sent to and thenwait.

What's the best way to approach this? Should I generate IDs outside of the
script, and then query the database for both the email and the ID and construct
the message that way?  Or should I dynamically generate an ID during the
mailing process and shove it in the DB as the message goes out?

Suggestions, criticism, comments...welcome.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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




RE: [PHP] Weird error...

2002-03-22 Thread Kevin Stone

I notice you're incrementing the row offset.  You shouldn't use
mysql_result() to extract multiple fields like that.  It will be much
faster using mysql_fetch_array() once and then extracting any data you
need from the resulting associative array as many times as you need.
Mysql_result() is intended to be used when you need to extract the data
in one field in one column.
I can only think it has something to do with your $results_all.  Perhaps
there is a max size that it will accept?  Doesn't make sense though.  I
tried this and it worked fine:

";
}
?>

For extracting multiple sets of data you should be using one of the
mysql_fetch_XXX() functions instead.  Example..

$row = mysql_fetch_array($result);
echo $row[event_location]. "";

-Kevin

-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 22, 2002 9:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Weird error...

What does this error mean??
 
Fatal error: Allowed memory size of 8388608 bytes exhausted at
zend_language_scanner.c:4248 (tried to allocate 9 bytes) in
/blah/blah/afteradmin2.php on line 37
 
here is line #37...
$usertemp = mysql_result($result_all, $i, "username");
 
 

THANKS!!!



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




Re: [PHP] Trap CR or "Enter" possible?

2002-03-22 Thread Erik Price


On Friday, March 22, 2002, at 12:29  PM, Jason Wong wrote:

>> Side note to the original poster: in the script that is the target of
>> the form you are writing, you may be able to test for the presence of
>> the "submit" variable -- if this value is not present, then the user 
>> has
>> not clicked the Submit button.  I know that the "value" of a submit
>> input is usually just used to label the button in some way (such as
>> value="Click Here for Free Porn!"), but you can actually test for this
>> value if you have given the Submit input a name.  I may be wrong about
>> this, though.
>
> Thus if you relied upon testing for the value of the submit button to
> determine whether the form had been submitted (as opposed to being 
> viewed for
> the first time) then you're going to get unexpected results.

Right, but I was trying to come up with a way for the original poster to 
test to see if the user had simply hit "enter" or if they had actually 
hit the "submit" button (not as a test to see if the form was being 
viewed for the first time).  IIRC he was having problems determining 
whether or not the user had hit "enter" or hit the submit button.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] Weird error...

2002-03-22 Thread Kevin Stone

DOH!!!  I didn't mean to email the first part of my response below.  I
wrote it and then realized that I was mistaken.  I thought I'd erased
it.  It is perfectly valid to do what you want with mysql_result();  :)
-Kevin

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 22, 2002 10:38 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Weird error...

--
I notice you're incrementing the row offset.  You shouldn't use
mysql_result() to extract multiple fields like that.  It will be much
faster using mysql_fetch_array() once and then extracting any data you
need from the resulting associative array as many times as you need.
Mysql_result() is intended to be used when you need to extract the data
in one field in one column.


I can only think it has something to do with your $results_all.  Perhaps
there is a max size that it will accept?  Doesn't make sense though.  I
tried this and it worked fine:

";
}
?>

For extracting multiple sets of data you should be using one of the
mysql_fetch_XXX() functions instead.  Example..

$row = mysql_fetch_array($result);
echo $row[event_location]. "";

-Kevin

-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 22, 2002 9:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Weird error...

What does this error mean??
 
Fatal error: Allowed memory size of 8388608 bytes exhausted at
zend_language_scanner.c:4248 (tried to allocate 9 bytes) in
/blah/blah/afteradmin2.php on line 37
 
here is line #37...
$usertemp = mysql_result($result_all, $i, "username");
 
 

THANKS!!!



-- 
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




Re: [PHP] converting a password database from perl to php

2002-03-22 Thread R'twick Niceorgaw

I'm sorry, I somehow missed few characters while copying form unix machine.
The actual encrypted string is òOú«#µ7zFá73Y¯ (in hex it is 06 f2 4f fa ab
23 b5 7f 37 9e 46 e1 37 33 9f af)

I have no idea about perl and so now I'm confused as in hte perl script I
see it's using a digest::md5() object to encrypt the password and so thought
it should be same md5() as in php.

If you can guide me to some place where i can look for further info will be
of much help to me.

Thanks for your time
Regards
R'twick
- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "R'twick Niceorgaw" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 11:46 AM
Subject: Re: [PHP] converting a password database from perl to php


> text password : f0rget123
> encrypted password: òOú«#7Fá73¯

Uh, that's not md5 at all.  By definition md5 is 32 characters.

-Rasmus


--
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] Desperate!!!!!!! Resource id #24 - error???????????

2002-03-22 Thread brendan conroy

Hi guys,
Thanks for reading this. I desperatley need help with this error. I 
just finished a huge project thats taken me months, my code works, but the 
code its attached to has an error. The project is due Monday and naturally 
enough the guy who wrote the code with the error is gone on holiday for the 
weekend- typical.

Does anyone know what the hell Resource id's are, and why they are showing 
up in my array instead of good ol fashioned numbers?

My array goes (correct)into a function looking like this :

Array ( [0] => Array ( [0] => -1 [1] => 1 [2] => 1 [3] => 1 ) [1] => Array ( 
[0] => -2 [1] => 2 [2] => 2 [3] => 10 [4] => 2 ) [2] => Array ( [0] => -3 
[1] => 3 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] => -4 [1] => 4 [2] 
=> 4 [3] => 4 ) [1] => Array ( [0] => -5 [1] => 5 [2] => 5 [3] => 5 ) [2] => 
Array ( [0] => -6 [1] => 6 [2] => 6 [3] => 6 ) )

and comes out looking like this:

Array ( [0] => Array ( [0] => Resource id #5 [1] => Resource id #8 [2] => 1 
[3] => 1 ) [1] => Array ( [0] => Resource id #16 [1] => Resource id #17 [2] 
=> 2 [3] => 10 [4] => 2 [5] => ) [2] => Array ( [0] => Resource id #24 [1] 
=> Resource id #25 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] => 
Resource id #35 [1] => Resource id #36 [2] => 4 [3] => 4 ) [1] => Array ( 
[0] => Resource id #44 [1] => Resource id #45 [2] => 5 [3] => 5 ) [2] => 
Array ( [0] => Resource id #53 [1] => Resource id #54 [2] => 6 [3] => 6 ) )

The Resource id #'s only go into the first two places in the end(third) 
arrays.


I'd really appreciate help with this


Thanks a million



_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] how to get server os?

2002-03-22 Thread Prachait Saxena

Hello Friends

Can any one tell me how can i get the server operating system, on which my
php script is running ?
and envermental variable or any other idea ...

Bye, and  Have a nice day.

Prachait Saxena
---
Phone :-  +91 - 712 - 544476
Email   :-  [EMAIL PROTECTED] (Official)
   [EMAIL PROTECTED](Official)
   [EMAIL PROTECTED] (Personal)
ICQ :-  71855637
MSN   :-  prachait
Yahoo Messenger :- getprachait

 If you do for other's !
 Other's will do for you !!



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




Re: [PHP] Trap CR or "Enter" possible?

2002-03-22 Thread Don Read


On 22-Mar-2002 Erik Price wrote:
> 
> On Friday, March 22, 2002, at 12:29  PM, Jason Wong wrote:
> 
>>> Side note to the original poster: in the script that is the target of
>>> the form you are writing, you may be able to test for the presence of
>>> the "submit" variable -- if this value is not present, then the user 
>>> has
>>> not clicked the Submit button.  I know that the "value" of a submit
>>> input is usually just used to label the button in some way (such as
>>> value="Click Here for Free Porn!"), but you can actually test for this
>>> value if you have given the Submit input a name.  I may be wrong about
>>> this, though.
>>
>> Thus if you relied upon testing for the value of the submit button to
>> determine whether the form had been submitted (as opposed to being 
>> viewed for
>> the first time) then you're going to get unexpected results.
> 
> Right, but I was trying to come up with a way for the original poster to 
> test to see if the user had simply hit "enter" or if they had actually 
> hit the "submit" button (not as a test to see if the form was being 
> viewed for the first time).  IIRC he was having problems determining 
> whether or not the user had hit "enter" or hit the submit button.
> 

If you use an image for your submit button, then you can test for
$submit_x and $submit_y.

-- 
Don Read   [EMAIL PROTECTED]
-- It is necessary for me to learn from others' mistakes. I 
   will not live long enough to make them all by myself.

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




[PHP] Re: how to get server os?

2002-03-22 Thread Philip Hallstrom

Create a script that looks like this:



and then look at the output of that for your operating system... odds are
you'll find a $_SERVER variable that gives you what you want.

On Fri, 22 Mar 2002, Prachait Saxena wrote:

> Hello Friends
>
> Can any one tell me how can i get the server operating system, on which my
> php script is running ?
> and envermental variable or any other idea ...
>
> Bye, and  Have a nice day.
>
> Prachait Saxena
> ---
> Phone :-  +91 - 712 - 544476
> Email   :-  [EMAIL PROTECTED] (Official)
>[EMAIL PROTECTED](Official)
>[EMAIL PROTECTED] (Personal)
> ICQ :-  71855637
> MSN   :-  prachait
> Yahoo Messenger :- getprachait
>
>  If you do for other's !
>  Other's will do for you !!
>
>
>
> --
> 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




Re: [PHP] how to get server os?

2002-03-22 Thread Jason Wong

On Saturday 23 March 2002 02:22, Prachait Saxena wrote:
> Hello Friends
>
> Can any one tell me how can i get the server operating system, on which my
> php script is running ?
> and envermental variable or any other idea ...

php_uname()


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Never call a man a fool.  Borrow from him.
*/

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




Re: [PHP] Desperate!!!!!!! Resource id #24 - error???????????

2002-03-22 Thread Jason Wong

On Saturday 23 March 2002 01:53, brendan conroy wrote:
> Hi guys,
> Thanks for reading this. I desperatley need help with this error. I
> just finished a huge project thats taken me months, my code works, but the
> code its attached to has an error. The project is due Monday and naturally
> enough the guy who wrote the code with the error is gone on holiday for the
> weekend- typical.

Let's see the code that "its attached to".


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Slang is language that takes off its coat, spits on its hands, and goes to 
work.
*/

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




[PHP] cron with php as apache module

2002-03-22 Thread Paul Roberts

I want to run a php script via a crontab, (i can set up the crontab etc).

this is a Linux server and php is installed as an apache module, is there any way to 
run the php script via cron.

 the build details are 

  Configure Command './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql' 
'--enable-track-vars' '--enable-versioning' '--enable-bcmath' 



Paul Roberts
[EMAIL PROTECTED]




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




RE: [PHP] cron with php as apache module

2002-03-22 Thread Rick Emery


yes, you can run PHP as a stand-alone interpreter

-Original Message-
From: Paul Roberts [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] cron with php as apache module


I want to run a php script via a crontab, (i can set up the crontab etc).

this is a Linux server and php is installed as an apache module, is there
any way to run the php script via cron.

 the build details are 

  Configure Command './configure' '--with-apxs=/usr/sbin/apxs'
'--with-mysql' '--enable-track-vars' '--enable-versioning' '--enable-bcmath'




Paul Roberts
[EMAIL PROTECTED]




-- 
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




RE: [PHP] cron with php as apache module

2002-03-22 Thread Darren Gamble

Good day,

Most Linux packages also install the php binary as part of the distribution
(I know Redhat does).

Look in /usr/local/bin (or other common places) to see if the executable
"php" has been installed.

If it is, you're set.  Just run the script as if it were a .cgi .
Instructions are on php's site.

On a sour note, FreeBSD's package does not include the executable.. >=(


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: Paul Roberts [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 12:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] cron with php as apache module


I want to run a php script via a crontab, (i can set up the crontab etc).

this is a Linux server and php is installed as an apache module, is there
any way to run the php script via cron.

 the build details are 

  Configure Command './configure' '--with-apxs=/usr/sbin/apxs'
'--with-mysql' '--enable-track-vars' '--enable-versioning' '--enable-bcmath'




Paul Roberts
[EMAIL PROTECTED]




--
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




Re: [PHP] Desperate!!!!!!! Resource id #24 - error???????????

2002-03-22 Thread Jason Wong

Thank you for (mis)placing your faith in me. But if you want a better quality 
of help you should write to the list and not to any one individual.



On Saturday 23 March 2002 02:44, brendan conroy wrote:
> OK here goes, Im pretty sure the error is in the monic function, thanks for
> your time on this
>
>  function grobmonic($g)
> {
>
>   for($c=0;$c   {
>   $g[$c]=monic($g[$c]);
>   }
> return $g;
> }
> ?>
>
>
>  function monic($p)
> {
>   print_r($p);
>   if(gmp_cmp($p[0][0],$p[0][1])!=0)
>   {
>   $temp[0]=$p[0][1];
> $temp[1]=$p[0][0];
>   $p=prodmono($temp,$p);
>   }
> return $p;
> }
> ?>
>
>
>
>
>  function prodmono($p1,$p2)
> {
>
>   for($a=0;$a {
>
>   $num=gmp_mul($p1[0],$p2[$a][0]);
>
> $den=gmp_mul($p1[1],$p2[$a][1]);
>   $g=gmp_gcd($num,$den);
>   if(gmp_cmp($g,1)!=0)
>   {
>   $num=gmp_divexact($num,$g);
>   $den=gmp_divexact($den,$g);
>   }
>   $res[$a][0]=$num;
> $res[$a][1]=$den;
>   $k=$i=$j=2;
>   while($i   {
>   if($p1[$i]<$p2[$a][$j])
>   {
>   $res[$a][$k]=$p1[$i];
>   $res[$a][$k+1]=$p1[$i+1];
>   $i=$i+2;
>   }
>   elseif($p1[$i]>$p2[$a][$j])
>   {
> $res[$a][$k]=$p2[$a][$j];
> $res[$a][$k+1]=$p2[$a][$j+1];
> $j=$j+2;
> }
>   else
>   {
> $res[$a][$k]=$p1[$i];
> $res[$a][$k+1]=$p1[$i+1]+$p2[$a][$j+1];
> $i=$i+2;
>   $j=$j+2;
> }
>   $k=$k+2;
>   }
>   while($i   {
>   $res[$a][$k]=$p1[$i];
> $res[$a][$k+1]=$p1[$i+1];
> $i=$i+2;
>   $k=$k+2;
> }
> while($j {
> $res[$a][$k]=$p2[$a][$j];
> $res[$a][$k+1]=$p2[$a][$j+1];
> $j=$j+2;
> $k=$k+2;
> }
>   }
>   return $res;
>   }
> ?>
>
>
>
>
> From: Jason Wong <[EMAIL PROTECTED]>
>
> >To: [EMAIL PROTECTED]
> >Subject: Re: [PHP]  Desperate!!!   Resource id #24 -
> >error???
> >Date: Sat, 23 Mar 2002 02:18:58 +0800
> >
> >On Saturday 23 March 2002 01:53, brendan conroy wrote:
> > > Hi guys,
> > > Thanks for reading this. I desperatley need help with this
> >
> >error. I
> >
> > > just finished a huge project thats taken me months, my code works, but
> >
> >the
> >
> > > code its attached to has an error. The project is due Monday and
> >
> >naturally
> >
> > > enough the guy who wrote the code with the error is gone on holiday for
> >
> >the
> >
> > > weekend- typical.
> >
> >Let's see the code that "its attached to".
> >
> >
> >--
> >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> >
> >/*
> >Slang is language that takes off its coat, spits on its hands, and goes to
> >work.
> >*/
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
> _
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx

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




RE: [PHP] cron with php as apache module

2002-03-22 Thread Hunter, Ray

Yeah, 

Compile php first as CLI, move the contents of the bin directory to where
you want them, and then compile php again for the apache module.

In the bin directory you will have a php executable file which you can use
for your cli apps.

In your php files that you want to run as crons then add this before the

/* EOF */



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


> -Original Message-
> From: Paul Roberts [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, March 22, 2002 12:00 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] cron with php as apache module
> 
> 
> I want to run a php script via a crontab, (i can set up the 
> crontab etc).
> 
> this is a Linux server and php is installed as an apache 
> module, is there any way to run the php script via cron.
> 
>  the build details are 
> 
>   Configure Command './configure' 
> '--with-apxs=/usr/sbin/apxs' '--with-mysql' 
> '--enable-track-vars' '--enable-versioning' '--enable-bcmath' 
> 
> 
> 
> Paul Roberts
> [EMAIL PROTECTED]
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



RE: [PHP] Forcing little endian with pack("d");

2002-03-22 Thread Mike Eynon



I have looked through the pack code in php-4.1.2.  There appear to be no
other options other than what is documented on the php.net pack function
page.  There appears to be no way of specifying endian-ness for floats or
doubles using pack.  They are copied to the output stream using a simple
memcpy.

I would need more details on what you are doing to be sure, but, is the
format something you can worry about on the unpacking side?  Usually, it is
best to marshall the data in the native format of the machine doing the
marshalling, and then convert the data (if needed) on the machine you are
un-marshalling on.  This usually makes debugging a whole heck of a lot
easier.  All you will have to do is store the endian-ness of the machine you
are packing on with the data being packed.  Of course, this only works if
you are not unpacking with PHP...

The code in pack.c for the pack function is pretty dang simple.  It wouldn't
take more than an hour or so to cut and paste a few sections of code to add
the options you need.  Could be good to have in future versions of php.

Good Luck.

// Mike Eynon
// www.MikeEynon.com
// 1366 Bulb Ave.
// Santa Cruz, CA  95062
// 831.588.2388

-Original Message-
From: Mika Tuupola [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 3:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Forcing little endian with pack("d");



http://www.php.net/manual/en/function.pack.php

The manual page describes format string "d" as:

d double (machine dependent size and representation).

Is there an easy way of forcing the binary to be representated
little endian even with hosts which are big endian (undocumented
format string for example?).


--
Mika Tuupola  http://www.appelsiini.net/~tuupola/


--
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] Rollover not functioning

2002-03-22 Thread Joshua E Minnie

Does anyone have any idea why adding PHP into an HTML page would cause a
rollover (not even within the PHP script) to not function?

The thing is, I have done the same thing on various other pages, but this is
the only page that does it.  I tried removing the PHP script from the page,
and the rollover works, but when I add the code back in, it doesn't.  And if
anyone has any ideas as how to minimize the code, they would be appreciated
as well.  Here is the code that was inserted within a cell in a table ..the
rollover is in another cell:



Error: could not open $filename for
reading\n";
exit;
  }
  $form = fread($fp, filesize($filename));
  fclose($fp);
  $form = str_replace("{name}", $HTTP_POST_VARS["name"], $form);
  $form = str_replace("{email}", $HTTP_POST_VARS["email"], $form);
  echo $form;
}
elseif(empty($HTTP_POST_VARS["name"]) || empty($HTTP_POST_VARS["email"]) ||
empty($HTTP_POST_VARS["comments"])) {
  echo "You must fill out all
information\n";
  @ $fp = fopen($filename, "r");
  if(!$fp) {
echo "Error: could not open $filename for
reading\n";
exit;
  }
  $form = fread($fp, filesize($filename));
  fclose($fp);
  $form = str_replace("{name}", $HTTP_POST_VARS["name"], $form);
  $form = str_replace("{email}", $HTTP_POST_VARS["email"], $form);
  echo $form;
}
else {
  $submit = 0;
  $name = $HTTP_POST_VARS["name"];
  $body = strip_tags(trim(stripslashes($HTTP_POST_VARS["comments"])));
  $body .= "\n\nSent: ".date("F j, Y  g:i a")."\nSender: $name";
  $to = "[EMAIL PROTECTED]";
  $subject = "Wild Zone web contact";
  $headers = "From: ".$HTTP_POST_VARS["email"]."\n";
  mail($to,$subject,$body,$headers);
  @ $fp = fopen($filename, "r");
  if(!$fp) {
echo "Error: could not open $filename for
reading\n";
exit;
  }
  $form = fread($fp, filesize($filename));
  fclose($fp);
  $form = str_replace("{name}", "", $form);
  $form = str_replace("{email}", "", $form);
  echo "Your information has been
successfully transmitted\n";
  echo $form;
}
?>
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

"Don't work for recognition, but always do work worthy of recognition."



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




Re: [PHP] cron with php as apache module

2002-03-22 Thread Analysis & Solutions

Even if you can't get, or don't want to bother getting, PHP as a
standalone CGI type program, you can still execute via crontab.  Make a
web page that you want to have run, then put something along the lines
of:

   lynx http://localhost/scriptname.php

as the command in the crontab file.  Do note, you'll likely need to take
steps to protect the script from being run by people you don't want
touching it.  You could use SSL, cookies and REMOTE_ADDR, among other
things to accomplish that.

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




RE: [PHP] Forcing little endian with pack("d");

2002-03-22 Thread Mika Tuupola

On Fri, 22 Mar 2002, Mike Eynon wrote:

> I have looked through the pack code in php-4.1.2.  There appear to be no
> other options other than what is documented on the php.net pack function
> page.  There appears to be no way of specifying endian-ness for floats or
> doubles using pack.  They are copied to the output stream using a simple
> memcpy.

The solution was much simpler than I though. Reversing
the output with strrev() seems to do the job:

$double = pack("d",   $val);

if ($bigendian) {
$double = strrev($double);
}   

Now the value of $double is the same in big and smallendian
machines. So I suppose strrev() is binary safe.

> I would need more details on what you are doing to be sure, but, is the
> format something you can worry about on the unpacking side? 

I am writing a binary file (BIFF) whose specs state that the data
needs to be written littleendian.

> The code in pack.c for the pack function is pretty dang simple.  It wouldn't
> take more than an hour or so to cut and paste a few sections of code to add
> the options you need.  Could be good to have in future versions of php.

+1 for adding that to future versions. Don't talk C myself 
though ;)

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/


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




[PHP] FAQ

2002-03-22 Thread James Taylor

Has anyone given any thought to possibly maintaining a FAQ containing the 
answers to the most commonly asked PHP questions on this list? I notice 
duplicates roll through every couple of days, and it would probably be a 
really nice PHP resource.

Or, does one already exist? Ha.

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




Re: [PHP] FAQ

2002-03-22 Thread Rasmus Lerdorf

That's a FAQ

(did you try the obvious?  http://php.net/faq)

On Fri, 22 Mar 2002, James Taylor wrote:

> Has anyone given any thought to possibly maintaining a FAQ containing the
> answers to the most commonly asked PHP questions on this list? I notice
> duplicates roll through every couple of days, and it would probably be a
> really nice PHP resource.
>
> Or, does one already exist? Ha.
>
> --
> 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] store locator/zip code question...

2002-03-22 Thread Kelly Meeks

Hi folks,

I've got a client that wants to show users dealers of their products based on mileage 
from their location.

I've seen this done, and I assume it's based on either a database relating the zip 
info to miles, or to some kind of hash on the zipcode itself.

Anyone have any experience with this?

TIA,

Kelly

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




Re: [PHP] FAQ

2002-03-22 Thread James Taylor

You are correct sir.  The purpose of the FAQ would be so that, like I said, 
similar questions that pop up say, once a week, could be answered in the FAQ 
instead of on the list - That way I won't get 300 messages a day :)

On Friday 22 March 2002 11:36 am, you wrote:
> Despite what Rasmus just said, I think that you are saying a PHP Mailing
> List faq based on the q's that the mailing list gets, not the general PHP
> faq.
>
> Scott
>
> -Original Message-
> From: James Taylor [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 2:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] FAQ
>
>
> Has anyone given any thought to possibly maintaining a FAQ containing the
> answers to the most commonly asked PHP questions on this list? I notice
> duplicates roll through every couple of days, and it would probably be a
> really nice PHP resource.
>
> Or, does one already exist? Ha.

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




RE: [PHP] Maillist

2002-03-22 Thread Rick Emery

I think PHP's uniqid() will suit your purposes.  Look in the Miscellaneous
Functions section of the manual.

-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 11:38 AM
To: PHP-General List
Subject: [PHP] Maillist



I need to send out several hundred, to several thousand emails out of
our
database.  Now, before everyone starts telling me to use an actual MLM for
this, let me explain what I need to do.

I need to send a unique ID with each message, in the form of a URL.  We
want to make unsubscribing as easy as possible for our clients, so what I
plan
on doing is sending out a URL in the body of the message that contains a
unique
ID.  When they click on that URL, it hits another script on our website
which
than takes that ID, searches for it in the database and flags that record
(and
returns a 'Thank you' page.)

So, somehow, I need to generate a unique ID for each message send, stick
that ID into the database with the corresponding email address that it was
just
sent to and thenwait.

What's the best way to approach this? Should I generate IDs outside of
the
script, and then query the database for both the email and the ID and
construct
the message that way?  Or should I dynamically generate an ID during the
mailing process and shove it in the DB as the message goes out?

Suggestions, criticism, comments...welcome.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




-- 
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




RE: [PHP] FAQ

2002-03-22 Thread Matt Schroebel

I've been working on that at http://www.php-faq.com/ Want to help?

> -Original Message-
> From: James Taylor [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, March 22, 2002 2:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] FAQ
> 
> Has anyone given any thought to possibly maintaining a FAQ 
> containing the answers to the most commonly asked PHP questions on this 
> list? I notice 
> duplicates roll through every couple of days, and it would 
> probably be a 
> really nice PHP resource.
> 
> Or, does one already exist? Ha.

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




RE: [PHP] FAQ

2002-03-22 Thread Brian Drexler

Yes, an FAQ would be nice...so would a Manual...Oh wait, there is one, but
people just happen to overlook it most of the time :-)  I apologize for the
sarcasm, but it is Friday!

Brian

-Original Message-
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 2:50 PM
To: [EMAIL PROTECTED]
Cc: PHP List
Subject: Re: [PHP] FAQ


You are correct sir.  The purpose of the FAQ would be so that, like I said,
similar questions that pop up say, once a week, could be answered in the FAQ
instead of on the list - That way I won't get 300 messages a day :)

On Friday 22 March 2002 11:36 am, you wrote:
> Despite what Rasmus just said, I think that you are saying a PHP Mailing
> List faq based on the q's that the mailing list gets, not the general PHP
> faq.
>
> Scott
>
> -Original Message-
> From: James Taylor [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 2:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] FAQ
>
>
> Has anyone given any thought to possibly maintaining a FAQ containing the
> answers to the most commonly asked PHP questions on this list? I notice
> duplicates roll through every couple of days, and it would probably be a
> really nice PHP resource.
>
> Or, does one already exist? Ha.

--
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




RE: [PHP] FAQ

2002-03-22 Thread Robert V. Zwink

This one has been around for awhile, though I don't think its "official".

php.faqts.com

Robert Zwink
http://www.zwink.net/daid.php

-Original Message-
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 2:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] FAQ


Has anyone given any thought to possibly maintaining a FAQ containing the 
answers to the most commonly asked PHP questions on this list? I notice 
duplicates roll through every couple of days, and it would probably be a 
really nice PHP resource.

Or, does one already exist? Ha.

-- 
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




Re: [PHP] FAQ

2002-03-22 Thread John Fishworld

Yep good idea !
Oh and by the books - a couple of opinions wouldn't be bad either !

regards
john

> I've been working on that at http://www.php-faq.com/ Want to help?
>
> > -Original Message-
> > From: James Taylor [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, March 22, 2002 2:30 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] FAQ
> >
> > Has anyone given any thought to possibly maintaining a FAQ
> > containing the answers to the most commonly asked PHP questions on this
> > list? I notice
> > duplicates roll through every couple of days, and it would
> > probably be a
> > really nice PHP resource.
> >
> > Or, does one already exist? Ha.
>
> --
> 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




Re: [PHP] FAQ

2002-03-22 Thread Rasmus Lerdorf

I just don't see what the difference is.  This is a PHP mailing list which
supposedly gets questions about PHP.  Why would the PHP FAQ not be the
right place for this?

-Rasmus

On Fri, 22 Mar 2002, James Taylor wrote:

> You are correct sir.  The purpose of the FAQ would be so that, like I said,
> similar questions that pop up say, once a week, could be answered in the FAQ
> instead of on the list - That way I won't get 300 messages a day :)
>
> On Friday 22 March 2002 11:36 am, you wrote:
> > Despite what Rasmus just said, I think that you are saying a PHP Mailing
> > List faq based on the q's that the mailing list gets, not the general PHP
> > faq.
> >
> > Scott
> >
> > -Original Message-
> > From: James Taylor [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, March 22, 2002 2:30 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] FAQ
> >
> >
> > Has anyone given any thought to possibly maintaining a FAQ containing the
> > answers to the most commonly asked PHP questions on this list? I notice
> > duplicates roll through every couple of days, and it would probably be a
> > really nice PHP resource.
> >
> > Or, does one already exist? Ha.
>
> --
> 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




Re: [PHP] cron with php as apache module

2002-03-22 Thread Paul Roberts

ok
for lynx, at the command prompt i get
bash: lynx: command not found

I've also looked in all the obvious places for php but can't find it.

the server is a cobalt raq 3 and i have a virtual host account so i can't recompile 
php.

maybe I'll rewrite it in Perl.

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Analysis & Solutions" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 7:26 PM
Subject: Re: [PHP] cron with php as apache module


> Even if you can't get, or don't want to bother getting, PHP as a
> standalone CGI type program, you can still execute via crontab.  Make a
> web page that you want to have run, then put something along the lines
> of:
> 
>lynx http://localhost/scriptname.php
> 
> as the command in the crontab file.  Do note, you'll likely need to take
> steps to protect the script from being run by people you don't want
> touching it.  You could use SSL, cookies and REMOTE_ADDR, among other
> things to accomplish that.
> 
> --Dan
> 
> -- 
> PHP scripts that make your job easier
>   http://www.analysisandsolutions.com/code/
>  SQL Solution  |  Layout Solution  |  Form Solution
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
> 
> -- 
> 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




Re: [PHP] IMAGE Manipulation

2002-03-22 Thread James Taylor

Hey, I'm not sure if anyone ever answered your question, but here's a little 
function I wrote for something similar to what you want to do and it doesn't 
require GD be installed.  You need to modify the top portion, I just threw 
that in there to show you how it would work.  $pic is the name of the image 
you want to display.  $largestside is the largest width/height you'll want to 
be shown - So if the max height or width is supposed to only be 200, you'd 
set it to that, then it scales the other side so that it displays with the 
correct dimensions.  This doesn't ACTUALLY resize the file, it just takes the 
image and then in HTML it sets the height and width.  If you need to actually 
resize the file you will need GD to be installed.  Hope this helps in some 
way!




function resize($v_pic) {

   $largestside = 120;
   $size = GetImageSize ("$v_pic");

   $width = $size[0];
   $height = $size[1];

   if ($width == $height) {
  $dimensions[0] = $largestside;
  $dimensions[1] = $largestside;
   } elseif ($width > $height) {
  $divisor = $width / $largestside;
  $height = $height / $divisor;
  $dimensions[1] = intval ($height);
  $dimensions[0] = $largestside;
   } elseif ($width < $height) {
  $divisor = $height / 120;
  $width = $width / $divisor;
  $dimensions[0] = intval ($width);
  $dimensions[1] = 120;
   }

   return $dimensions;
}

On Saturday 16 March 2002 04:56 am, you wrote:
> Hi,
>
> I'm trying to resize images from a big image to smaller image in
> dimension and also file size so that when a user upload an image into
> server, when a browser display the picture it desn't have to be as big.
> I hope my question make sense.
>
> I just don't know where to start.
>
> may be somebody could help me, please.
>
> thank you for reviewing my email.
>
> regards,
> Dani

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




[PHP] Sooo close - please help

2002-03-22 Thread brendan conroy

Hi guys,
   Thanks for reading this. I desperatley need help with this
error. I just finished a huge project thats taken me months, my code works, 
but the code it uses has an error. The project is due Monday and naturally 
enough the guy who wrote the code with the error is gone on holiday for the 
weekend- typical. To be so close to having it finished is sort of 
sickening..

Does anyone know what the hell Resource id's are, and why they are showing
up in my array instead of good ol fashioned numbers?

My array goes (correct)into a function looking like this :

Array ( [0] => Array ( [0] => -1 [1] => 1 [2] => 1 [3] => 1 ) [1] =>Array ( 
[0] => -2 [1] => 2 [2] => 2 [3] => 10 [4] => 2 ) [2] => Array ( [0] => -3[1] 
=> 3 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] => -4 [1] => 4 [2]=> 4 
[3] => 4 ) [1] => Array ( [0] => -5 [1] => 5 [2] => 5 [3] => 5 ) [2] =>Array 
( [0] => -6 [1] => 6 [2] => 6 [3] => 6 ) )

and comes out looking like this:

Array ( [0] => Array ( [0] => Resource id #5 [1] => Resource id #8 [2] => 
1[3] => 1 ) [1] => Array ( [0] => Resource id #16 [1] => Resource id #17 
[2]=> 2 [3] => 10 [4] => 2 [5] => ) [2] => Array ( [0] => Resource id #24 
[1]=> Resource id #25 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] 
=>Resource id #35 [1] => Resource id #36 [2] => 4 [3] => 4 ) [1] => Array 
([0] => Resource id #44 [1] => Resource id #45 [2] => 5 [3] => 5 ) [2] 
=>Array ( [0] => Resource id #53 [1] => Resource id #54 [2] => 6 [3] => 6 ) 
)

The Resource id #'s only go into the first two places in the end(third)
arrays.

Heres the other guys code, Im pretty sure the bug is in monic or prodmono as 
they're the functions that deal with the elements that are turned into 
Resource id #'s . I know this is an awful lot to ask,but like I said Im 
desperate

>  function grobmonic($g)
> {
>
>   for($c=0;$c   {
>   $g[$c]=monic($g[$c]);
>   }
> return $g;
> }
> ?>
>
>
>  function monic($p)
> {
>   print_r($p);
>   if(gmp_cmp($p[0][0],$p[0][1])!=0)
>   {
>   $temp[0]=$p[0][1];
> $temp[1]=$p[0][0];
>   $p=prodmono($temp,$p);
>   }
> return $p;
> }
> ?>
>
>
>
>
>  function prodmono($p1,$p2)
> {
>
>   for($a=0;$a {
>
>   $num=gmp_mul($p1[0],$p2[$a][0]);
>
> $den=gmp_mul($p1[1],$p2[$a][1]);
>   $g=gmp_gcd($num,$den);
>   if(gmp_cmp($g,1)!=0)
>   {
>   $num=gmp_divexact($num,$g);
>   $den=gmp_divexact($den,$g);
>   }
>   $res[$a][0]=$num;
> $res[$a][1]=$den;
>   $k=$i=$j=2;
>   while($i   {
>   if($p1[$i]<$p2[$a][$j])
>   {
>   $res[$a][$k]=$p1[$i];
>   $res[$a][$k+1]=$p1[$i+1];
>   $i=$i+2;
>   }
>   elseif($p1[$i]>$p2[$a][$j])
>   {
> $res[$a][$k]=$p2[$a][$j];
> $res[$a][$k+1]=$p2[$a][$j+1];
> $j=$j+2;
> }
>   else
>   {
> $res[$a][$k]=$p1[$i];
> $res[$a][$k+1]=$p1[$i+1]+$p2[$a][$j+1];
> $i=$i+2;
>   $j=$j+2;
> }
>   $k=$k+2;
>   }
>   while($i   {
>   $res[$a][$k]=$p1[$i];
> $res[$a][$k+1]=$p1[$i+1];
> $i=$i+2;
>   $k=$k+2;
> }
> while($j {
> $res[$a][$k]=$p2[$a][$j];
> $res[$a][$k+1]=$p2[$a][$j+1];
> $j=$j+2;
> $k=$k+2;
> }
>   }
>   return $res;
>   }
> ?>
>


I'd really appreciate help with this


Thanks a million







_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] cron with php as apache module

2002-03-22 Thread Erik Price


On Friday, March 22, 2002, at 03:16  PM, Paul Roberts wrote:

> for lynx, at the command prompt i get
> bash: lynx: command not found
>
> I've also looked in all the obvious places for php but can't find it.
>
> the server is a cobalt raq 3 and i have a virtual host account so i 
> can't recompile php.
>
> maybe I'll rewrite it in Perl.

Try looking for "links", it's basically the same thing (but don't tell 
the links people I said that! :)

If not, why not just download and build links, and put it in your ~/bin 
directory or something?  I don't believe it has to be admin-installed, 
does it?


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] FAQ

2002-03-22 Thread James Taylor

The PHP FAQ isn't really specific when it comes to most problems. The 'code' 
section has like 10 questions, the rest of the FAQ is mainly how to 
download/compile, what do these PHP errors mean, migration, etc.  A FAQ that 
had answers to questions that people ask on this list on a frequent basis 
would be more helpful.



On Friday 22 March 2002 12:05 pm, you wrote:
> I just don't see what the difference is.  This is a PHP mailing list which
> supposedly gets questions about PHP.  Why would the PHP FAQ not be the
> right place for this?
>
> -Rasmus
>
> On Fri, 22 Mar 2002, James Taylor wrote:
> > You are correct sir.  The purpose of the FAQ would be so that, like I
> > said, similar questions that pop up say, once a week, could be answered
> > in the FAQ instead of on the list - That way I won't get 300 messages a
> > day :)
> >
> > On Friday 22 March 2002 11:36 am, you wrote:
> > > Despite what Rasmus just said, I think that you are saying a PHP
> > > Mailing List faq based on the q's that the mailing list gets, not the
> > > general PHP faq.
> > >
> > > Scott
> > >
> > > -Original Message-
> > > From: James Taylor [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, March 22, 2002 2:30 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] FAQ
> > >
> > >
> > > Has anyone given any thought to possibly maintaining a FAQ containing
> > > the answers to the most commonly asked PHP questions on this list? I
> > > notice duplicates roll through every couple of days, and it would
> > > probably be a really nice PHP resource.
> > >
> > > Or, does one already exist? Ha.
> >
> > --
> > 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




RE: [PHP] Maillist

2002-03-22 Thread Robert V. Zwink

Both php and MySQL support MD5().  Consider this:

 // Define a secret key
$secret_key = "ThisIsASecretKey123";

 // Take the user's current email address
$email_address = "[EMAIL PROTECTED]";

 // And create a unique ID
$unique_id = md5($email_address.$secret_key);

Stick this unique id in the email you send to you user.
http://sitename.com/remove.php?unique_id=$unique_id

Then when someone sends back the $unique_id by clicking on your link, you
can instuct MySQL to disable the record:

"UPDATE users SET send_email = 'NO' WHERE
MD5(email_address.'ThisIsASecretKey123')=$unique_id "

The $secret_key prevents someone from guessing an email address, MD5 them,
and sending it to you script.  They would also need to know the secret key
to guess correctly.  This way you also do not need to "store" the hash
anywhere.  You could also update the secret key from time to time for
security.

What do you think?

Robert V. Zwink
http://www.zwink.net/daid.php

-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 12:38 PM
To: PHP-General List
Subject: [PHP] Maillist



I need to send out several hundred, to several thousand emails out of
our
database.  Now, before everyone starts telling me to use an actual MLM for
this, let me explain what I need to do.

I need to send a unique ID with each message, in the form of a URL.  We
want to make unsubscribing as easy as possible for our clients, so what I
plan
on doing is sending out a URL in the body of the message that contains a
unique
ID.  When they click on that URL, it hits another script on our website
which
than takes that ID, searches for it in the database and flags that record
(and
returns a 'Thank you' page.)

So, somehow, I need to generate a unique ID for each message send, stick
that ID into the database with the corresponding email address that it was
just
sent to and thenwait.

What's the best way to approach this? Should I generate IDs outside of
the
script, and then query the database for both the email and the ID and
construct
the message that way?  Or should I dynamically generate an ID during the
mailing process and shove it in the DB as the message goes out?

Suggestions, criticism, comments...welcome.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




--
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




Re: [PHP] FAQ

2002-03-22 Thread Rasmus Lerdorf

So add it those.

On Fri, 22 Mar 2002, James Taylor wrote:

> The PHP FAQ isn't really specific when it comes to most problems. The 'code'
> section has like 10 questions, the rest of the FAQ is mainly how to
> download/compile, what do these PHP errors mean, migration, etc.  A FAQ that
> had answers to questions that people ask on this list on a frequent basis
> would be more helpful.
>
>
>
> On Friday 22 March 2002 12:05 pm, you wrote:
> > I just don't see what the difference is.  This is a PHP mailing list which
> > supposedly gets questions about PHP.  Why would the PHP FAQ not be the
> > right place for this?
> >
> > -Rasmus
> >
> > On Fri, 22 Mar 2002, James Taylor wrote:
> > > You are correct sir.  The purpose of the FAQ would be so that, like I
> > > said, similar questions that pop up say, once a week, could be answered
> > > in the FAQ instead of on the list - That way I won't get 300 messages a
> > > day :)
> > >
> > > On Friday 22 March 2002 11:36 am, you wrote:
> > > > Despite what Rasmus just said, I think that you are saying a PHP
> > > > Mailing List faq based on the q's that the mailing list gets, not the
> > > > general PHP faq.
> > > >
> > > > Scott
> > > >
> > > > -Original Message-
> > > > From: James Taylor [mailto:[EMAIL PROTECTED]]
> > > > Sent: Friday, March 22, 2002 2:30 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] FAQ
> > > >
> > > >
> > > > Has anyone given any thought to possibly maintaining a FAQ containing
> > > > the answers to the most commonly asked PHP questions on this list? I
> > > > notice duplicates roll through every couple of days, and it would
> > > > probably be a really nice PHP resource.
> > > >
> > > > Or, does one already exist? Ha.
> > >
> > > --
> > > 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




Re: [PHP] looking for tutorial on XML parsing of attributes...

2002-03-22 Thread Erik Price

I'm no expert on the XML functions, but post your code and maybe we can 
figure out what's wrong.


Erik



On Thursday, March 21, 2002, at 09:24  PM, Scott Brown wrote:

> Ok - first off, I've found a few... phpbuilder has a nice number of
> references.  But every one I've tried has ignored attributes... either 
> that,
> or I dont understand what I'm doing.
>
> I retrieve from a distant server an XML response to an inquiry:
>
> 
> 
>   
> sometext
>   
>   
> 
>   sometext1
> 
>   
>   
> 
>   sometext2
> 
>   
>   
> 
>   sometext3
> 
>   
> 
>
> BUT... when I parse this using xml_parse, all I'm getting out is:
>
> Name = RESPONSE  -- Attributes = Array
> Name = STATUS  -- Attributes = Array
> Name = DESCRIPTION  -- Attributes = Array
> Name = DOMAIN  -- Attributes = Array
> Name = STATUS  -- Attributes = Array
> Name = DESCRIPTION  -- Attributes = Array
> Name = DOMAIN  -- Attributes = Array
> Name = STATUS  -- Attributes = Array
> Name = DESCRIPTION  -- Attributes = Array
> Name = DOMAIN  -- Attributes = Array
> Name = STATUS  -- Attributes = Array
> Name = DESCRIPTION  -- Attributes = Array
>
> I cant seem to nail down how to pull the actual attribute values 
> does
> anyone know of a tutorial that's going to teach me how to pull those
> attributes of fqdn and code?  I've figured out how to get the 
> DESCRIPTION...
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Hi!

2002-03-22 Thread savaidis

Hi all!

I'm quite new to PHP so I have two questions:

How is possible to  on an image and run a php function?

Also how is possible to pass some php vars to javascript vars?


Makis
Thessaloniki
Greece

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




Re: [PHP] Sooo close - please help

2002-03-22 Thread charlesk


It looks like gmp_divexact returns a resource which does not appear to be what you 
want.

You may have to access the result somehow to see if it is giving you what you expect.

Charles Killmer

-- Original Message --
From: "brendan conroy" <[EMAIL PROTECTED]>
Date: Fri, 22 Mar 2002 20:18:10 +

Hi guys,
   Thanks for reading this. I desperatley need help with this
error. I just finished a huge project thats taken me months, my code works,
but the code it uses has an error. The project is due Monday and naturally 
enough the guy who wrote the code with the error is gone on holiday for the
weekend- typical. To be so close to having it finished is sort of
sickening..

Does anyone know what the hell Resource id's are, and why they are showing
up in my array instead of good ol fashioned numbers?

My array goes (correct)into a function looking like this :

Array ( [0] => Array ( [0] => -1 [1] => 1 [2] => 1 [3] => 1 ) [1] =>Array (
[0] => -2 [1] => 2 [2] => 2 [3] => 10 [4] => 2 ) [2] => Array ( [0] => -3[1]
=> 3 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0] => -4 [1] => 4 [2]=> 4
[3] => 4 ) [1] => Array ( [0] => -5 [1] => 5 [2] => 5 [3] => 5 ) [2] =>Array
( [0] => -6 [1] => 6 [2] => 6 [3] => 6 ) )

and comes out looking like this:

Array ( [0] => Array ( [0] => Resource id #5 [1] => Resource id #8 [2] =>
1[3] => 1 ) [1] => Array ( [0] => Resource id #16 [1] => Resource id #17
[2]=> 2 [3] => 10 [4] => 2 [5] => ) [2] => Array ( [0] => Resource id #24
[1]=> Resource id #25 [2] => 3 [3] => 9 ) ) Array ( [0] => Array ( [0]
=>Resource id #35 [1] => Resource id #36 [2] => 4 [3] => 4 ) [1] => Array
([0] => Resource id #44 [1] => Resource id #45 [2] => 5 [3] => 5 ) [2]
=>Array ( [0] => Resource id #53 [1] => Resource id #54 [2] => 6 [3] => 6 )
)

The Resource id #'s only go into the first two places in the end(third)
arrays.

Heres the other guys code, Im pretty sure the bug is in monic or prodmono as
they're the functions that deal with the elements that are turned into
Resource id #'s . I know this is an awful lot to ask,but like I said Im
desperate

>  function grobmonic($g)
> {
>
>   for($c=0;$c   {
>   $g[$c]=monic($g[$c]);
>   }
> return $g;
> }
> ?>
>
>
>  function monic($p)
> {
>   print_r($p);
>   if(gmp_cmp($p[0][0],$p[0][1])!=0)
>   {
>   $temp[0]=$p[0][1];
> $temp[1]=$p[0][0];
>   $p=prodmono($temp,$p);
>   }
> return $p;
> }
> ?>
>
>
>
>
>  function prodmono($p1,$p2)
> {
>
>   for($a=0;$a {
>
>   $num=gmp_mul($p1[0],$p2[$a][0]);
>
> $den=gmp_mul($p1[1],$p2[$a][1]);
>   $g=gmp_gcd($num,$den);
>   if(gmp_cmp($g,1)!=0)
>   {
>   $num=gmp_divexact($num,$g);
>   $den=gmp_divexact($den,$g);
>   }
>   $res[$a][0]=$num;
> $res[$a][1]=$den;
>   $k=$i=$j=2;
>   while($i   {
>   if($p1[$i]<$p2[$a][$j])
>   {
>   $res[$a][$k]=$p1[$i];
>   $res[$a][$k+1]=$p1[$i+1];
>   $i=$i+2;
>   }
>   elseif($p1[$i]>$p2[$a][$j])
>   {
> $res[$a][$k]=$p2[$a][$j];
> $res[$a][$k+1]=$p2[$a][$j+1];
> $j=$j+2;
> }
>   else
>   {
> $res[$a][$k]=$p1[$i];
> $res[$a][$k+1]=$p1[$i+1]+$p2[$a][$j+1];
> $i=$i+2;
>   $j=$j+2;
> }
>   $k=$k+2;
>   }
>   while($i   {
>   $res[$a][$k]=$p1[$i];
> $res[$a][$k+1]=$p1[$i+1];
> $i=$i+2;
>   $k=$k+2;
> }
> while($j {
> $res[$a][$k]=$p2[$a][$j];
> $res[$a][$k+1]=$p2[$a][$j+1];
> $j=$j+2;
> $k=$k+2;
> }
>   }
>   return $res;
>   }
> ?>
>


I'd really appreciate help with this


Thanks a million







_
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com


--
PHP General Mailing List (http://www.php.net/)
To u

RE: [PHP] Re: Delete Confirmation

2002-03-22 Thread Boaz Yahav

Do that with JavaScript

Using JavaScript to show an OK/Cancel confirmation window
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1364

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


-Original Message-
From: Daniel Negron/KBE [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 6:20 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Delete Confirmation



Actually I have that working fine.  I was just looking to add to the
code a
confirmation box of some sort.  either typing in YES or clicking a YES
NO
BOX.

Thanks for your post.

**DAN**


 

Matt Wallace

cc:

 Subject: [PHP] Re: Delete
Confirmation 
03/20/2002

11:03 AM

 

 





Daniel Negron/Kbe wrote:

> Does anyone have examples of record deletions from php to mysql


Could you be more specific?

$sql = "DELETE from tablename where tablename_idx = $index";
$result = mysql_query($sql);

would be a very simple example of deleting a record from a hypothetical
database with php, but I'm not sure if that's what you were really
asking.





--
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




Re: [PHP] cron with php as apache module

2002-03-22 Thread Bruce S. Garlock

Are you specifying the full path in the crontab?  If the raq 3 does not have lynx, you 
might
be able to use wget.  I'm not too familiar with wget, you may want to read the manpage.
Here's how I run PHP scripts from cron, when PHP is compiled as a DSO:

0 8 * * * TERM=xterm; export TERM; /usr/bin/lynx -source
"http://your.server.address/phpscript.php"; 1>/dev/null 2>&1

You can leave off the stdin and stdout redirects if you want an email that the script 
was
run.

HTH..

- Bruce



Paul Roberts wrote:

> ok
> for lynx, at the command prompt i get
> bash: lynx: command not found
>
> I've also looked in all the obvious places for php but can't find it.
>
> the server is a cobalt raq 3 and i have a virtual host account so i can't recompile 
>php.
>
> maybe I'll rewrite it in Perl.
>
> Paul Roberts
> [EMAIL PROTECTED]
> 
> - Original Message -
> From: "Analysis & Solutions" <[EMAIL PROTECTED]>
> To: "PHP List" <[EMAIL PROTECTED]>
> Sent: Friday, March 22, 2002 7:26 PM
> Subject: Re: [PHP] cron with php as apache module
>
> > Even if you can't get, or don't want to bother getting, PHP as a
> > standalone CGI type program, you can still execute via crontab.  Make a
> > web page that you want to have run, then put something along the lines
> > of:
> >
> >lynx http://localhost/scriptname.php
> >
> > as the command in the crontab file.  Do note, you'll likely need to take
> > steps to protect the script from being run by people you don't want
> > touching it.  You could use SSL, cookies and REMOTE_ADDR, among other
> > things to accomplish that.
> >
> > --Dan
> >
> > --
> > PHP scripts that make your job easier
> >   http://www.analysisandsolutions.com/code/
> >  SQL Solution  |  Layout Solution  |  Form Solution
> >  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
> >
> > --
> > 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] included files not reread by php when i edit the files

2002-03-22 Thread Chris

While editing pages, for some reason (default setting? / configuration 
problem?) the changes i make in included files (with sometimes quite 
some nesting) are not recognized when reloading a page. So i see 
errors that belong to the previous version.

What setting could do this?

I'm quite sure the browser is not caching the page.

Win98 + 'foxserv', that is: apache, mysql. php, zend.
Using: Postnuke 0.7.1 with sessions (it did not happen before the 
sessions, but cannot imagine the sessions do this.).
I would suspect zend but it also happened with the normal php 4.06.

cheers,
Chris

-- 
 !  please check my email address   !  
 !  only my email [EMAIL PROTECTED] works   !
 !  email [EMAIL PROTECTED] is a black hole since januari 2002 !

Chris Hayes - Droef 35 - Wageningen


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




RE: [PHP] Hi!

2002-03-22 Thread Rick Emery

> How is possible to  on an image and run a php function?


> Also how is possible to pass some php vars to javascript vars?
Can't do it directly.  JavaScript is client-side.  PHP is server-side.  As
you execute a PHP script, it will "create" the values for the JavaScript
source that PHP is creating.

-Original Message-
From: savaidis [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Hi!


Hi all!

I'm quite new to PHP so I have two questions:

How is possible to  on an image and run a php function?

Also how is possible to pass some php vars to javascript vars?


Makis
Thessaloniki
Greece

-- 
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] T1lib configure broken?

2002-03-22 Thread Michael A. Peters

Red Hat 7.2

t1lib installed in /usr/local

I build --with-t1lib=/usr/local

build fails saying it can't find /usr/lib/.libs/libt1.so

Well, duh! It's in /usr/local/lib (as I specified in config w/ the
=/usr/local flag)
Anyway- that configure option worked perfect in php-4.0.5

What broke 4.1.2 from beig able to find my t1lib install?
How can I fix it?

I need t1lib- so I can't upgrade till I find how to fix.
Please cc me in the reply (don't just reply to list)

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




  1   2   >