[PHP] RE: setting member variables out of class

2001-11-01 Thread Tim Ward

1.  $telefono is an array (as has already been pointed out) so you need
to reference an element
2.  you're never actually setting the property in the constructor, your
constructor lines should be:
$this-telefono = array(Teléfono,Phone);
etc.

Tim

--
From:  Silvia Mahiques [SMTP:[EMAIL PROTECTED]]
Sent:  31 October 2001 14:38
To:  [EMAIL PROTECTED]
Cc:  [EMAIL PROTECTED]
Subject:  setting member variables out of class

Hello,
I want to set member variables out of their class. The code class
is:

?php

class translator {
 
 var $nombre; 
 var $departamento;
 var $despacho;
 var $telefono;
 var $correo_electronico;
 var $pagina_personal;

 function translator(){ 
  $nombre = array(Nombre,Name);  
  $departamento = array(Departamento,Department);  
  $despacho = array(Despacho,Office);  
  $telefono = array(Teléfono,Phone);
  $correo_electronico = array(Correo Electrónico,E-mail);
  $pagina_personal = array(Página Personal,Personal HomePage);
 }
}
?


I access to this class from another php file and want to set this
member variable:

$c = new translator();
echo $c-telefono;   /* this member isn't set but in constructor
method has been set*/


I have written too:

echo $c-$telefon;
echo {$c-telefon};

but is not correct.


Can anybody help me?

Thanks


Silvia Mahiques


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Comparing strings

2001-11-01 Thread phantom

Bear with me, new to PHP and got a beginner's questions

How do I run an if statement and the if statement compares a String?

IN ASP (yes I Know, ASP is evil) I would have wrote

if (String(Request(Action))==Submit)
  do this

In PHP I have tried

if ($Action == Submit)  but I get a parse error in that statement.
What am I doing wrong?  Thank you.  I did an echo $Action to confirm
that it's value is Submit.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] regular expression

2001-11-01 Thread Galkov Vladimir

 Need to remove all ../   /..  from user inputing string to prevent him
walking and creating filesdirectories where I don't whant see them/him...

The string:

 $path =
eregi_replace('([..]{2,})|([./]{2})|([../]{3,})|([/.]{2})|([/..]{3})', '',
$path);

works good with any  combinations ( ../../..qwert.txt  =  qwert.txt) untill
somth like /../asd/../qwert.txt will be entered ...  (/../asd/../qwert.txt
= asdqwert.txt).
 So the qwestion is how upgrade regular expression to remove all this
correctly (with all entered directory names but NOT assigned their names to
file name...

 Must do the operation:
 /../asd//qwert.txt  = qwert.txt
but  not  = /asd/qwert.txt or asdqwert.txt.ru
or
/../asd/../qwert.txt.ru  = qwert.txt.ru
but  not  = /asd/qwert.txt.ru or asdqwert.txt.ru

Thanks.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Week of month

2001-11-01 Thread Jon Farmer

 Is there any way to find out the week of the month. Today is in the first
 week of month.

 That is, a function like weekofmonth() which displays 1 today  2 next
week.

No builtin function in PHP. You will need to search to see if some kind and
generous soul has published their code for this purpose or write your own.
Remember the actual first day of a week can be country specific.

Regards

Jon


--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send blank email to [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Can you AUTO Post/Submit on a mixed HTML/PHP form

2001-11-01 Thread Arf

I have a little problem that I just can't get to work.

I want to send a URL line from VB6 in an application that I have written to
populate a
three field form on one of my www sites
(http://arthurbard.com/testarea/AutoPost.php) AND post it i.e. populate the
three fields and then simulate clicking on the submit button. I can send a
URL line from VB6 or directly from a browser line and fully populate the
form but do you think I can get it to post without clicking the button
can I heck

I can call the form and populate the fields with the following line as the
URL...

http://arthurbard.com/testarea/AutoPost.php/?sender_name=Arthursender_email
=me@workmessage=Hello.


This is the server side code..



HTML
HEAD
TITLECourier Delivery Feedback Form/TITLE
/HEAD
BODY

?

$form_block = 

FORM METHOD=\post\ ACTION=\$PHP_SELF\

PstrongUser Name:/strongbr
INPUT type=\text\ NAME=\sender_name\ VALUE=\$sender_name\
SIZE=30/p

PstrongYour E-Mail Address:/strongbr
INPUT type=\text\ NAME=\sender_email\  VALUE=\$sender_email\
SIZE=30/p

PstrongMessage/Problem:/strongbr
TEXTAREA NAME=\message\ COLS=30 ROWS=5
WRAP=virtual$message/TEXTAREA/p

INPUT type=\hidden\ name=\op\ value=\ds\

PINPUT TYPE=\submit\ NAME=\submit\ VALUE=\Send This Form\/p

/FORM

;

if ($op != ds) {

 // they need to see the form
 echo $form_block;

} else if ($op == ds) {

 if ($sender_name == ) {
  $name_err = font color=redPlease enter user name!/fontbr;
  $send = no;
 }

 if ($sender_email == ) {
  $email_err = font color=redPlease enter your e-mail
address!/fontbr;
  $send = no;
 }

 if ($message == ) {
  $message_err = font color=redPlease enter a message!/fontbr;
  $send = no;
 }

 if ($send != no) {

  // it's ok to send!
  $msg = AutoPost Report\n;
  $msg .= Sender's Name:$sender_name\n;
  $msg .= Sender's E-Mail:  $sender_email\n;
  $msg .= Message:  $message\n\n;

  $to = WhoItsTo@TheirISP;
  $subject = AutoPost Response;
  $mailheaders = From: CourierDelivery@MyISP\n\n;
  $mailheaders .= Reply-To: $sender_email\n\n;

  mail($to, $subject, $msg, $mailheaders);
  echo PMail has been sent!/p;

 } else if ($send == no) {

  echo $name_err;
  echo $email_err;
  echo $message_err;
  echo $form_block;

 }

}

?

/BODY
/HTML
/font/font


What do I need to change in the following line to make the form submit/post
or do I need to change the code in my form.  I can't use the JavaScript
onLoad() event handler as I will be calling from VB6.

http://arthurbard.com/testarea/AutoPost.php/?sender_name=Arthursender_email
=me@workmessage=Hello.

I have tried other Newsgroups without success so thought that its about time
to try the experts.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] fto_connect() failed??

2001-11-01 Thread JIM

hi all,
i was developing in redhat 7.2. with php/4.0.4pl1. iwas able to use
ftp_connect().
but, in a freebsd with php/4.0.6, it returns error that call to undefined
function...
anyone can help?
thanks.
im





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Week of month

2001-11-01 Thread Andrew Braund

How about;
echo It is week .((int)(date(j)/7)+1). of the month.br;

 -Original Message-
 From: Jon Farmer [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, 1 November 2001 20:14
 To: PHP Masters; Sheni R. Meledath
 Subject: Re: [PHP] Week of month
 
 
  Is there any way to find out the week of the month. Today is in the first
  week of month.
 
  That is, a function like weekofmonth() which displays 1 today  2 next
 week.
 
 No builtin function in PHP. You will need to search to see if some kind and
 generous soul has published their code for this purpose or write your own.
 Remember the actual first day of a week can be country specific.
 
 Regards
 
 Jon
 
 
 --
 Jon Farmer
 Systems Programmer, Entanet www.enta.net
 Tel 01952 428969 Mob 07763 620378
 PGP Key available, send blank email to [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Comparing strings

2001-11-01 Thread Michael Egan

I feel fairly new to this as well but I think that, whilst your logic is
right, the syntax may be a little off.

if ($action == textstring)
{
 echo true;
}
else
{
 echo false;
}

Above should show how the syntax will rok.

Good luck

Michael

phantom wrote:
 
 Bear with me, new to PHP and got a beginner's questions
 
 How do I run an if statement and the if statement compares a String?
 
 IN ASP (yes I Know, ASP is evil) I would have wrote
 
 if (String(Request(Action))==Submit)
   do this
 
 In PHP I have tried
 
 if ($Action == Submit)  but I get a parse error in that statement.
 What am I doing wrong?  Thank you.  I did an echo $Action to confirm
 that it's value is Submit.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Comparing strings

2001-11-01 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Phantom) wrote:

 In PHP I have tried
 
 if ($Action == Submit)  but I get a parse error in that statement.
 What am I doing wrong?  Thank you.  I did an echo $Action to confirm
 that it's value is Submit.

If the variable is set as you've confirmed, then that should work. If PHP 
is reporting a parse error with that line number, note that the lines where 
PHP stopped parsing isn't necessarily the line where the bad code resides.  
Try checking back a few lines; you may have left off a semi-colon or 
somesuch.  Another idea: check that the variable's length is the expected 5 
chars; maybe there's some trailing whitespace that's causing the comparison 
to fail (trim() is handy for avoiding this gotcha).  If neither of those 
solve the problem, try re-posting with a larger code snippet.

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] destroying sessions

2001-11-01 Thread Richard Baskett

Ok why does this not work?

session_name(adminid);
session_start();
unset($sess);
session_unset();
session_destroy();
session_write_close();
$sess = 0;

etc etc etc etc etc etc..

After all that is executed I take a look at the session file and what do I
see?  All the session variables still there... and the file still there
also!  How can I get rid of them?  Please how can I do it?  I am sitting in
a corner letting tear after tear drop down into my sodden lap, people are
looking at me crazy... but Im not crazy... am I?

Rick


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Can you AUTO Post/Submit on a mixed HTML/PHP form

2001-11-01 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Arf) wrote:

 $form_block = 
 
 FORM METHOD=\post\ ACTION=\$PHP_SELF\
 
 PstrongUser Name:/strongbr
 INPUT type=\text\ NAME=\sender_name\ VALUE=\$sender_name\
 SIZE=30/p
 
 PstrongYour E-Mail Address:/strongbr
 INPUT type=\text\ NAME=\sender_email\  VALUE=\$sender_email\
 SIZE=30/p
 
 PstrongMessage/Problem:/strongbr
 TEXTAREA NAME=\message\ COLS=30 ROWS=5
 WRAP=virtual$message/TEXTAREA/p
 
 INPUT type=\hidden\ name=\op\ value=\ds\
 
 PINPUT TYPE=\submit\ NAME=\submit\ VALUE=\Send This Form\/p
 
 /FORM
 
 ;

FWIW, you can save yourself all that PITA backslashing by using heredoc 
syntaxhttp://www.php.net/manual/language.types.string.php.

 What do I need to change in the following line to make the form submit/post
 or do I need to change the code in my form.  I can't use the JavaScript
 onLoad() event handler as I will be calling from VB6.

I'm not a VB person, but it's my understanding that VBscript can be invoked 
with an HTML script tag the same way JavaScript can.  Just assign 
language=VBscript instead of language=JavaScript.  Does that help you 
at all?

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Week of month

2001-11-01 Thread Matt Williams

Please find attached a very good date class.

I can't remeber where I got it from and who wrote it but it's pretty good.

M:

 --
  Is there any way to find out the week of the month. Today is in
 the first
  week of month.
 
  That is, a function like weekofmonth() which displays 1 today  2 next
 week.

 No builtin function in PHP. You will need to search to see if
 some kind and
 generous soul has published their code for this purpose or write your own.
 Remember the actual first day of a week can be country specific.



 Date_Calc-1.2.4.tar.gz

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] Best PHP package for this kind of www site?

2001-11-01 Thread web_fm

Hello,

I would like suggestions about the best PHP solution, and possibly
some code examples, to set up a web site which:
 allows to its managers to add articles through the web
 supports threaded discussions on such articles
 includes User forum on any topic
 has internal (always PHP of course) search engine on all its
 content
 Runs with no or minimum modification on both Linux/Apache and
 W2K/IIS, as it would be tested on the first and hosted (not my
 decision) on the second

I know about PHPNuke and Midgard, but would like to know your opinion
about which is the most turn-key solution w.rt. the specific points
above. Of course, other packages are welcome too

Again, code examples, or pointers to them are veryy welcome.

   TIA,

web_fm
-- 
Nature is very un-American.  Nature never hurries.
-- William George Jordan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Week of month

2001-11-01 Thread Jon Farmer

Well seeing as Monday of this week was the 29th of October is this week the
first of November or the last of October? I think the United Nations set out
a specification for determining the week number of the year but not sure if
they have a spec for the week of the month.

Regards

Jon

--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send blank email to [EMAIL PROTECTED]


- Original Message -
From: Andrew Braund [EMAIL PROTECTED]
To: PHP Masters [EMAIL PROTECTED]
Sent: Thursday, November 01, 2001 9:57 AM
Subject: RE: [PHP] Week of month


 How about;
 echo It is week .((int)(date(j)/7)+1). of the month.br;

  -Original Message-
  From: Jon Farmer [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, 1 November 2001 20:14
  To: PHP Masters; Sheni R. Meledath
  Subject: Re: [PHP] Week of month
 
 
   Is there any way to find out the week of the month. Today is in the
first
   week of month.
  
   That is, a function like weekofmonth() which displays 1 today  2 next
  week.
 
  No builtin function in PHP. You will need to search to see if some kind
and
  generous soul has published their code for this purpose or write your
own.
  Remember the actual first day of a week can be country specific.
 
  Regards
 
  Jon
 
 
  --
  Jon Farmer
  Systems Programmer, Entanet www.enta.net
  Tel 01952 428969 Mob 07763 620378
  PGP Key available, send blank email to [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Can you AUTO Post/Submit on a mixed HTML/PHP form

2001-11-01 Thread Arf

Like the heredoc thanx for that...

The way that I am using VB will not support the VBscript option
unfortunately but a good suggestion.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Yes you can........ but....

2001-11-01 Thread Galkov Vladimir

Yes you can...
 Ifif I rightly understand you only well... you whant submit
information without clicking submit button? .. well then you have to imagine
any suported event or use meta tag.. One problrm I don't use VB
script

Way one... ( this is example of 100% stupid code ... only to show the
gate;-) ... will be usefull only if you find the way to abort/allow submit
in you script )

form id= action=test.php onsubmit='chek()'   //  any supported
event
 input type=text
 input type=submit
/form
script
 function chek()
  {
  document.forms('').submit();
  }
/script

---
Way two... use meta tag (somth like game... or grenade ;-)  I'm not
worry you are not qwik enoth to fill all fields :-) )
?
$timer = 10; // seconds
$url_str =
http://arthurbard.com/testarea/AutoPost.php/?sender_name=Arthursender_emai
l=me@workmessage=Hello.; // well.. what you wrote
?
META HTTP-EQUIV=Refresh Content=? print $timer?; URL=? print $url_str
?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Yes you can........ but....

2001-11-01 Thread Arf

Ummm... Like that where's me PHP editor. will let you know how it goes
after I have had breakfast.

Thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: regular expression

2001-11-01 Thread liljim

Hello,

Galkov Vladimir [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Need to remove all ../   /..  from user inputing string to prevent him
 walking and creating filesdirectories where I don't whant see them/him...

 The string:

  $path =
 eregi_replace('([..]{2,})|([./]{2})|([../]{3,})|([/.]{2})|([/..]{3})', '',
 $path);

 works good with any  combinations ( ../../..qwert.txt  =  qwert.txt)
untill
 somth like /../asd/../qwert.txt will be entered ...
(/../asd/../qwert.txt
 = asdqwert.txt).
  So the qwestion is how upgrade regular expression to remove all this
 correctly (with all entered directory names but NOT assigned their names
to
 file name...

  Must do the operation:
  /../asd//qwert.txt  = qwert.txt
 but  not  = /asd/qwert.txt or asdqwert.txt.ru
 or
 /../asd/../qwert.txt.ru  = qwert.txt.ru
 but  not  = /asd/qwert.txt.ru or asdqwert.txt.ru


Try this:

?

$string = /../asd//qwert.txt;

$string = preg_replace(/(\.*\/\.?)+.*?(\.*\/)?/s, , $string);

echo $string;

?

May need some tweaking, let me know.

~James



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem with date_format() in indirect MySQL query...

2001-11-01 Thread Ryan Fischer

Hello!  :)

First off, please respond to me directly as I am not subscribed to the
list.  Thanks!  :)

Now then, I have a quick question I'm hoping someone can help me with.

I have this class method:

 function query($sql, $type = 'obj')
 {

  if(!$result = @mysql_query($this-masl($sql))){
   echo Problem with query: btt$sql/tt/b.   . mysql_error();
   exit;
  }

  $objary = array();
  if(@mysql_num_rows($result)  0){
   if($type == 'obj'){
while($object = @mysql_fetch_object($result)){ $objary[] =
$object; }
@mysql_free_result($result);
   }elseif($type == 'assoc'){
while($object = @mysql_fetch_assoc($result)){ $objary[] = $object; }
@mysql_free_result($result);
   }else{
echo Problem with type of query requested.;
exit;
   }
   return $objary;
  }else{
   return null;
  }
 }

And this something like this query:

$res = $this-query(select *, date_format(thedate, 'M d, Y') as dt,
date_format(thedate, 'l:i p') as tm from thetable where foo = '$bar');

Every other query I've executed in this fashion, I've been successful in
retrieving the results.  But, when I try doing something with the
date_format function, when I try to print out the formatted date and
time returned, I get the formats instead.

Does anyone have any idea why, and any idea what I can do to rectify
this?  TIA!  :)

--
 -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: regular expression

2001-11-01 Thread liljim

Whooops,

Pasted wrong line.  This should do it:

$string = preg_replace(/(\.*\/)+(.*?\.*\/)?/s, , $string);

James



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: regular expression

2001-11-01 Thread liljim

 Whooops,

 Pasted wrong line.  This should do it:

 $string = preg_replace(/(\.*\/)+(.*?\.*\/)?/s, , $string);

Gah... Not.. enough... caffeine: Modification:

$string = preg_replace(/(\.*\/)+(.*?\.*\/)?(\.*)?/s, , $string);



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] regular expression

2001-11-01 Thread Christian Reiniger

On Thursday 01 November 2001 10:39, Galkov Vladimir wrote:
  Need to remove all ../   /..  from user inputing string to prevent
 him walking and creating filesdirectories where I don't whant see
 them/him...

 The string:

  $path =
 eregi_replace('([..]{2,})|([./]{2})|([../]{3,})|([/.]{2})|([/..]{3})',
 '', $path);

 works good with any  combinations ( ../../..qwert.txt  =  qwert.txt)
 untill somth like /../asd/../qwert.txt will be entered ... 
 (/../asd/../qwert.txt = asdqwert.txt).
  So the qwestion is how upgrade regular expression to remove all this
 correctly (with all entered directory names but NOT assigned their
 names to file name...

Here's what I use (take out the parts useful to you):

function FixSrcURI ($SrcURI)
{
// remove script name
$SrcURI = preg_replace ('#^/*{{$ Page.Source }}/*#', '', $SrcURI);

// remove potentially harmful parts
$SrcURI = preg_replace ('#/?\.\./?#', '/', $SrcURI);
$SrcURI = preg_replace ('#/\./#', '/', $SrcURI);
$SrcURI = preg_replace ('#/\.$#', '/', $SrcURI);
$SrcURI = preg_replace ('#/{2,}#', '/', $SrcURI);
$SrcURI = preg_replace ('#^/#', '', $SrcURI);

if (preg_match ('#(\A|/)\.#', $SrcURI) ||
preg_match ('#CVS#', $SrcURI))
{
pbHTTP_404 ();
}

if ($SrcURI == '') {
return array ($SrcURI, -1, 'src');
}
else {
$matches = array ();

if (preg_match ('#^[^/]+$#', $SrcURI))
{
return array ($SrcURI, '', $SrcURI);
}
elseif (preg_match ('#^(.*)/([^/]*)$#', $SrcURI, $matches))
{
return array ($SrcURI, $matches [1], $matches [2]);
}
else
{
pbHTTP_404 ();
return false;
}
}
}

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

/* you are not expected to understand this */

- from the UNIX V6 kernel source

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Detecting Languages...

2001-11-01 Thread Tommy Gildseth

Arcadius A. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 HEllo !
 I have a website designed in several languages (En , Fr , Cz) 
 My question is :
 How to detect the language setting of the the visitor's PC  in order to
 redirect him to a specified content ?


These are the HTTP headers my browser send along when  I load a page from a
webserver.
I expect you can guess which one would be interesting for you :-)

Accept: */*
Accept-Language: en-gb,no;q=0.5
Host: www.gildseth.com
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Detecting Languages...

2001-11-01 Thread Tommy Gildseth

Tommy Gildseth [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Arcadius A. [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  How to detect the language setting of the the visitor's PC  in order to
  redirect him to a specified content ?
 

 Accept: */*
 Accept-Language: en-gb,no;q=0.5
 Host: www.gildseth.com
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)

More specifically the variabel $HTTP_ACCEPT_LANGUAGE will tell you what
languages the users browser will accept.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem writing to file, can't find the error

2001-11-01 Thread Jeff Lewis

I have this code in my program but I fail to find the error, does anyone see it after 
a quick glance?


?php
if ($action == save_filter) {
$fh = fopen (./filters.data.php, r+b) or die (couldnt open);
$file = fread($fh, filesize(./filters.data.php));
$file = stripslashes($file);
$array = unserialize($file);
$array[] = array($filter, $name);

$out = serialize($array);
fwrite($fh, $out) or die;

fclose($fh);

}
?



[PHP] Uncertainties about MySQL commands

2001-11-01 Thread TD - Sales International Holland B.V.

Hey list, i'm new to php so bare with me...

got some questions on mysql commands. I'd like to know how the 
mysql_insert_id() function works exactly. 
First of all how reliable is it? What happens this happens:
Table: (ID int unsigned primary key auto_increment, Stuff text, MoreStuff 
text)
(my script)
insert into table values(NULL, bla, bla)
(some other application)
insert into table values(NULL, bleh, bleh)
(my script)
$id = mysql_insert_id

it's not likely that this will happen, but if the site is very/extremely 
crowded it could be that there's an insert right after mine but before me 
callind mysql_insert_id. As you might guess I'd like to know which ID will be 
returned, the one my script created or the one from the other application?

Also what happens if my table is like this:
Table: (Stuff text, ID int unsigned primary key auto_increment, OtherStuff 
text)
Thus having the ID on column 2 instead of 1
or like this
Table: (Bla int unsigned primary key auto_increment, Stuff text, Otherstuff 
text)
Thus the ID not having the name ID
Or like this
Table: (bla int unsigned primary key auto_increment, id int unsigned primary 
key auto_increment, stuff text, otherstuff text)
Thus having 2 auto_increment columns where the 2nd one is called ID (lower 
case).

I'm really uncertain about that and couldn't find it back in the manual 
does it only read the first column? does this column have to be named ID, 
what if ID is another column? what if there is more than 1 auto_increment 
column in the table? what happens if some(one)/(thing) else inserts before 
calling mysql_insert_id.

One more question (pure curiosity this one) the return value from 
mysql_query... is that ever gonna be higher than 1? I assume it can be if the 
insert affects more than 1 line right? Also my book says that the return 
value is TRUE or FALSE for every command except for an INSERT in which case 
it would be 0 on failure and higher on succes. I think that's crap? I'm 
guessing it will also return a number for UPDATE's and REPLACE's is that 
correct? Are there others?

OK just one more thing, this is for the people from troutworks if they're 
monitoring this list. I think the translation of the PHP Bible is 
crap! Please complain about it at the translator. The guy/girl 
managed to translate (quotes)  to (comma's) , and there are a lot of other 
wrongly translated things in there, luckily the examples in there got me on 
the right path again over and over showing that the translation was incorrect 
but it's just confusing like hell. The number of mistakes is unbelievable 
(and i'm NOT talking about spelling errors, I'm talking about messy stuff 
like calling quotes comma's) and I'm 100% certain it was NOT translated by a 
programmer

regards

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how do I use and lt with eval()?

2001-11-01 Thread John A. Grant

Stefan Rusterholz [EMAIL PROTECTED] wrote in message
001001c162af$1fd842f0$3c01a8c0@quasimodo">news:001001c162af$1fd842f0$3c01a8c0@quasimodo...
[...]
 As you see, for PHP is some HTML-Code in the php-code-zone. To avoid this,
 do it that way:
 ?php
  function somefunc($text,$n)
   {
  for($i=0;$i$n;$i++){
  echo $text;
  }
  }
  $string='xxx ?php somefunc(yyy,3); ? zzz';
  eval(?$string);
  ?

 Pay attention to the trailing ? in eval. That causes php to change to
 HTML-Mode within the eval'd code.

Yes, thanks - it works now. I can see that you have to exit
php code mode before you encounter HTML 'xxx'.
Then you enter php mode, run somefunc() and exit again
so you can deal with HTML 'zzz'.  But that leaves you
outside php mode, right?  If the next thing after eval()
is more php code, don't you have to enter php mode
again like this:
eval(?$string?php );
echo hello;

I tried it with and without ?php appended to $string. The
hello always works. Why?  Does eval() automatically put
you back into php mode?

Stated another way, you said that this
$string='xxx ?php somefunc(yyy,3); ? zzz';
eval(?$string);
echo hello;

is equivalent to:
?xxx ?php somefunc(yyy,3); ? zzz
echo hello;

So why doesn't it treat echo hello as HTML code in
pass-through mode? In fact, it just prints hello.

--
John A. Grant  * I speak only for myself *  (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] MySQL Questions

2001-11-01 Thread TD - Sales International Holland B.V.

Hey there,

part of my old question can be ignored since I just found out (stupid.) 
there can be only 1 auto_increment column in a table and by testing with PHP 
I also found out the position of the column doesn't matter nor it's name.

I'd still like an answer on the rest tho'

regards

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Text Editor with Highlighting

2001-11-01 Thread TD - Sales International Holland B.V.

Hey there,

I looked on the site for this but couldn't find anything about it. I'd like a 
list of your favorite text editors (preferable for Linux/XFree) with 
highlighting. I'm using beaver now, I tried cooledit but it's not me... too 
much functions and looks like it came from an old 386 :-). I have kde 2.1.2 
which has kwrite, but it's kwrite does not yet support PHP, kde 2.2.1 does 
but i don't wanna download the entire kde package. Besides i think it's still 
in development I tried in on my laptop at home but it just makes things bold 
instead of all kinds of different colors. also beaver colors for in plain 
html and has some problems with correctly indentifying /* */ comments if you 
use more of em. i'm also interested in windows though and i think more people 
are interested so maybe somebody of the site might also want to keep track of 
the list so it can be put online

regards

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Text Editor with Highlighting

2001-11-01 Thread Anthony

For Windows, hands down Homesite is the best

Td - Sales International Holland B.V. wrote:

 Hey there,
 
 I looked on the site for this but couldn't find anything about it. I'd like a 
 list of your favorite text editors (preferable for Linux/XFree) with 
 highlighting. I'm using beaver now, I tried cooledit but it's not me... too 
 much functions and looks like it came from an old 386 :-). I have kde 2.1.2 
 which has kwrite, but it's kwrite does not yet support PHP, kde 2.2.1 does 
 but i don't wanna download the entire kde package. Besides i think it's still 
 in development I tried in on my laptop at home but it just makes things bold 
 instead of all kinds of different colors. also beaver colors for in plain 
 html and has some problems with correctly indentifying /* */ comments if you 
 use more of em. i'm also interested in windows though and i think more people 
 are interested so maybe somebody of the site might also want to keep track of 
 the list so it can be put online
 
 regards
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem with date_format() in indirect MySQL query...

2001-11-01 Thread Mark Roedel

 -Original Message-
 From: Ryan Fischer [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, November 01, 2001 5:37 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Problem with date_format() in indirect MySQL query...
 
 
 $res = $this-query(select *, date_format(thedate, 'M d, Y') as dt,
 date_format(thedate, 'l:i p') as tm from thetable where foo = 
 '$bar');
 
 Every other query I've executed in this fashion, I've been 
 successful in retrieving the results.  But, when I try doing
 something with the date_format function, when I try to print
 out the formatted date and time returned, I get the formats
 instead.
 
 Does anyone have any idea why, and any idea what I can do to rectify
 this?  TIA!  :)

Perhaps a quick re-read of the date_format() section of
http://www.mysql.com/doc/D/a/Date_and_time_functions.html
is in order?  (Hint: the % characters mean something.)


---
Mark Roedel |  Blessed is he who has learned to laugh
Systems Programmer  |   at himself, for he shall never cease
LeTourneau University   |   to be entertained.
Longview, Texas, USA|   -- John Powell 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem writing to file, can't find the error

2001-11-01 Thread Mark Roedel

 -Original Message-
 From: Jeff Lewis [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, November 01, 2001 7:21 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Problem writing to file, can't find the error
 
 
 I have this code in my program but I fail to find the error, 
 does anyone see it after a quick glance?
 
 ?php
 if ($action == save_filter) {
 $fh = fopen (./filters.data.php, r+b) or die (couldnt open);
 $file = fread($fh, filesize(./filters.data.php));
 $file = stripslashes($file);
 $array = unserialize($file);
 $array[] = array($filter, $name);
 
 $out = serialize($array);
 fwrite($fh, $out) or die;
 
 fclose($fh);
 
 }
 ?

Sorry...my internal PHP parser is just a little rusty.  Does this code
produce an error message?  (If so, what does it say?)  Or just not the
results you were expecting?  (In which case, what results were you
expecting, and how did the actual results differ?)


---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Text Editor with Highlighting

2001-11-01 Thread Eugene Mah

At 10:02 PM 11/01/2001 +0100, TD - Sales International Holland B.V. wrote:
Hey there,

I looked on the site for this but couldn't find anything about it. I'd like a
list of your favorite text editors (preferable for Linux/XFree) with
highlighting.

emacs!
:)

Eugene


--
To put my contact info into your Palm device, click here:
http://signature.coola.com/?[EMAIL PROTECTED]
Personal Signature Coolet
-
Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
Department of Radiology   For I am a Bear of Very Little
Medical University of South Carolina   Brain, and long words Bother
Charleston, South Carolina me.   Winnie the Pooh
http://home.netcom.com/~eugenem/
PGP KeyID = 0x1F9779FD, 0x319393F4
PGP keys available on request ICQ 3113529 O-
-


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] regular expression

2001-11-01 Thread DL Neil

Wow, there are some long and curly ways to use RegExp-s aren't there? I'm not very 
good at them (and I hear that
they can be expensively inefficient) so I tend to look elsewhere.

Check out pathinfo -- Returns information about a file path
array pathinfo (string path)
pathinfo() returns an associative array containing information about path. The 
following array elements are
returned: dirname, basename and extension.

- the basename result appears to give what you have requested: with all entered 
directory names but NOT
assigned their names to file name

However you then go on to talk about qwert.txt.ru  = qwert.txt.ru.

I'm not sure what pathinfo() does in this situation with regard to its extension 
result. Perhaps you will test
and advise!? Nor can I be sure that the previous contribution will address that part 
of the problem. Does having
a filename containing multiple dots (placed in the appropriate directory) contravene 
the specification?

=dn


- Original Message -
From: Christian Reiniger [EMAIL PROTECTED]
To: Galkov Vladimir [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 01 November 2001 11:50
Subject: Re: [PHP] regular expression


On Thursday 01 November 2001 10:39, Galkov Vladimir wrote:
  Need to remove all ../   /..  from user inputing string to prevent
 him walking and creating filesdirectories where I don't whant see
 them/him...

 The string:

  $path =
 eregi_replace('([..]{2,})|([./]{2})|([../]{3,})|([/.]{2})|([/..]{3})',
 '', $path);

 works good with any  combinations ( ../../..qwert.txt  =  qwert.txt)
 untill somth like /../asd/../qwert.txt will be entered ...
 (/../asd/../qwert.txt = asdqwert.txt).
  So the qwestion is how upgrade regular expression to remove all this
 correctly (with all entered directory names but NOT assigned their
 names to file name...

Here's what I use (take out the parts useful to you):

function FixSrcURI ($SrcURI)
{
// remove script name
$SrcURI = preg_replace ('#^/*{{$ Page.Source }}/*#', '', $SrcURI);

// remove potentially harmful parts
$SrcURI = preg_replace ('#/?\.\./?#', '/', $SrcURI);
$SrcURI = preg_replace ('#/\./#', '/', $SrcURI);
$SrcURI = preg_replace ('#/\.$#', '/', $SrcURI);
$SrcURI = preg_replace ('#/{2,}#', '/', $SrcURI);
$SrcURI = preg_replace ('#^/#', '', $SrcURI);

if (preg_match ('#(\A|/)\.#', $SrcURI) ||
preg_match ('#CVS#', $SrcURI))
{
pbHTTP_404 ();
}

if ($SrcURI == '') {
return array ($SrcURI, -1, 'src');
}
else {
$matches = array ();

if (preg_match ('#^[^/]+$#', $SrcURI))
{
return array ($SrcURI, '', $SrcURI);
}
elseif (preg_match ('#^(.*)/([^/]*)$#', $SrcURI, $matches))
{
return array ($SrcURI, $matches [1], $matches [2]);
}
else
{
pbHTTP_404 ();
return false;
}
}
}

--
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

/* you are not expected to understand this */

- from the UNIX V6 kernel source

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Text Editor with Highlighting

2001-11-01 Thread Papp Gyozo

EditPlus (http://www.editplus.com) on windows
HTML-Kit (http://www.chami.com/html-kit/)

- Original Message -
From: Eugene Mah [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 01, 2001 3:32 PM
Subject: Re: [PHP] Text Editor with Highlighting


 At 10:02 PM 11/01/2001 +0100, TD - Sales International Holland B.V. wrote:
 Hey there,
 
 I looked on the site for this but couldn't find anything about it. I'd
like a
 list of your favorite text editors (preferable for Linux/XFree) with
 highlighting.

 emacs!
 :)

 Eugene


 --
 To put my contact info into your Palm device, click here:
 http://signature.coola.com/?[EMAIL PROTECTED]
 Personal Signature Coolet
 -
 Eugene Mah, M.Sc., DABR   [EMAIL PROTECTED]
 Medical Physicist/Misplaced Canuck[EMAIL PROTECTED]
 Department of Radiology   For I am a Bear of Very Little
 Medical University of South Carolina   Brain, and long words Bother
 Charleston, South Carolina me.   Winnie the Pooh
 http://home.netcom.com/~eugenem/
 PGP KeyID = 0x1F9779FD, 0x319393F4
 PGP keys available on request ICQ 3113529 O-
 -


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP4, NT Workstation, Xitami issue...

2001-11-01 Thread Erik H. Mathy

Hey All!

I hit a snag yesterday on something I've done a million times before.
Perhaps one of you might be able to lend a hand.

Situation:

I use a Dell Latitude laptop for development. It's got pretty much
everything I need for my day to day needs. NT Workstation, mysql, mssql,
odbc drivers galore, Xitami, etc... Until now I've had PHP3 on it. There's
no particular reason that I haven't upgraded to PHP4. Lazy, I guess.
Anyways, today I downloaded the PHP4.0.6 zip and did the install.

We all know the drill. Unzip into the directory of choice (D:/Php4/),
copy over the renamed php.ini file, copy over php4ts.dll, edit php.ini to
suit,
change Xiatmi's default.cfg (.phtml=D:\Php4\php.exe), double check
permissions,
fire up Xitami, test with a print(test); or phpinfo();...done!

Wrong. When I hit my test page with a web browser I get a blank screen. A
check of the source shows:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=Content-Type content=text/html;
charset=windows-1252/HEAD
BODY/BODY/HTML

Xitami's status continues to show activity for 30 seconds after the page
itself is done loading. My current max_execution time in php.ini is set to
240, in Xitami it's the same.

The kicker is when I go to the command prompt I can fire off that page
manually and get results. My test code of:

?
print(test\r\n);
?

gets me:

D:\PHP4php.exe -e -f D:\work\moskal\oracle\ora_test.php
test

This makes me think that, for some reason, Php4 and Xitami aren't really
communicating. But I'm not getting any errors, even though my error
reporting in php.ini is set to (error_reporting = E_ALL).

Any ideas?
- Erik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: Where are lists of PHP's predefined constants and keywords?

2001-11-01 Thread Johnson, Kirk

Thank you Jim, Mike, CC and Philip.

Geez! I thought I did a search, but maybe I imagined that...

LOL

Kirk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem with fopen() when php is in safe_mode

2001-11-01 Thread Daniel Bergqvist

Hi!

I'm having trouble with a script who should attach files to a mail. The script 
looks like this:
?
include inc/mime_mail.inc;
$mail = new mime_mail;
$mail - from = $email;
$mail - to = $to_email;
$mail - subject = Testing;
$mail - body = Testing;


if($dir = @opendir(/home/d5051/public_html/test)){
 while ($file = readdir($dir)) {
 $content_type = text/txt;
 if ($file != .  $file != ..){
 $fd = fopen($file,r);
 $data = fread($fd,filesize($file));
 fclose($fd);

 $mail-add_attachement($data,$file,$content_type);
 }
 }
 closedir($dir);
}
$mail-send();
?

And a get error messages like thoose below:


Warning: Unable to access testar.txt in /home/d5051/public_html/mail.php on 
line 17

Warning: fopen(testar.txt,r) - No such file or directory in 
/home/d5051/public_html/mail.php on line 17

I know that the path to the file is correct and the file is set to -rwxrwxrwx. 
Also my ISP is running php in safe_mode

Anyone who has any idea what might be wrong??

Cheers
/daniel



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Problem with fopen() when php is in safe_mode

2001-11-01 Thread Mark Roedel

 -Original Message-
 From: Daniel Bergqvist [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, November 01, 2001 9:57 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Problem with fopen() when php is in safe_mode
 
 
   if($dir = @opendir(/home/d5051/public_html/test)){

You're getting filenames from
/home/d5051/public_html/test

$fd = fopen($file,r);
 [snip]

 Warning: fopen(testar.txt,r) - No such file or directory in 
 /home/d5051/public_html/mail.php on line 17

But your script is apparently running in
/home/d5051/public_html
And trying to open the file in that same directory.

Try changing the fopen line to

$fd = fopen(test/$file,r);
Or
$fd = fopen(/home/d5051/public_html/test/$file,r);


---
Mark Roedel   | The most overlooked advantage to owning a
Systems Programmer|  computer is that if they foul up there's no
LeTourneau University |  law against whacking them around a little.
Longview, Texas, USA  |  -- Owen Porterfield 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Text Editor with Highlighting

2001-11-01 Thread Chris Bailey

Check the list archives, this topic gets covered almost weekly.

But, for Linux (and various others):
- Visual SlickEdit is awesome, but commercial (the cost is absolutely worth
it, I'm extremely satisfied).  It has function name completion, parameter
completion (for PHP and many other langs), and just a ton of other features.
Runs on Linux, FreeBSD, Windows, and many others.
- Emacs as mentioned.
- vim/gvim (this would be my second choice, vim and it's graphical version
gvim do nice PHP syntax highlighting).  Runs on probably every platform I
can think of.
- ActiveState Komodo (Linux and Windows).  This is an IDE for PHP, Perl,
Python, and more.  Has a debugger, etc.
- Glimmer and NEdit probably have PHP highlighting, but I'm not sure.

-Original Message-
From: TD - Sales International Holland B.V. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 01, 2001 1:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Text Editor with Highlighting


Hey there,

I looked on the site for this but couldn't find anything about it. I'd like
a
list of your favorite text editors (preferable for Linux/XFree) with
highlighting. I'm using beaver now, I tried cooledit but it's not me... too
much functions and looks like it came from an old 386 :-). I have kde 2.1.2
which has kwrite, but it's kwrite does not yet support PHP, kde 2.2.1 does
but i don't wanna download the entire kde package. Besides i think it's
still
in development I tried in on my laptop at home but it just makes things bold
instead of all kinds of different colors. also beaver colors for in plain
html and has some problems with correctly indentifying /* */ comments if you
use more of em. i'm also interested in windows though and i think more
people
are interested so maybe somebody of the site might also want to keep track
of
the list so it can be put online

regards

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-WIN] 4.0.6 mssql.dll Extension load failure

2001-11-01 Thread DL Neil

Mike,

 We have PHP installed as an ISAP module on our W2K IIS5 server and
 its operational with no problems - phpinfo() runs just fine.

 But - When I uncomment the php_mssql.dll extension in php.ini I get an error
 when PHP starts up saying it cannot find the .dll file.

 The extension directory is correctly set to, c:\php\extensions
 and the actual file itself is in that directory as wells as
 c:\winnt\system32 and MSSQL client libraries are loaded and operational.

I found that PHP was adding the slash between the dir name and the extension's 
filename, and that caused a
problem such as you have described - so did adding a slash as the final character. 
Here is the code that works
on my WinNT4.0/Apache set up (watch the dir diff):

extension_dir = C:/program files/php/extensions

 Cant think of anything else I need to do - does the .dll file need
 be registered with regsrvr or something ??

=no

  Can anybody give me some pointers please this problem is driving me nuts -
 I even tried reversing the slashes to the UNIX way !

=um, don't like the sound of that...
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Is there a way not to pop up the default login window?

2001-11-01 Thread Zhu George-CZZ010


If we are using the default Apache/PHP authentication, it will always pop up the 
default login window for login user ID /password.   Is there a method to redirect to a 
customized PHP login page instead of the default pop up window?

Thanks ahead.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Some facts about MsSQL/ODBC

2001-11-01 Thread Valentin V. Petruchek

Hello everyone!
Here i'm not going to ask community about smth.
I would like to present results of one test speed.

i perform the same query to MsSQL directly (using mssql_...) and through
ODBC (odbc_...)
In first case (direct connection) php works SLOWER than through ODBC.

My server is on NT 5.1.

Can anyone explain me why ODBC is faster than direct connection?

Thnx, Valentin




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Is there a way not to pop up the default login window?

2001-11-01 Thread Jon Haworth

Yep. Design your own form, and feed the data from that to $PHP_AUTH_USER and
$PHP_AUTH_PW. Don't send the header() for the 403.

Cheers
Jon


-Original Message-
From: Zhu George-CZZ010 [mailto:[EMAIL PROTECTED]]
Sent: 01 November 2001 17:18
To: [EMAIL PROTECTED]
Subject: [PHP] Is there a way not to pop up the default login window?



If we are using the default Apache/PHP authentication, it will always
pop up the default login window for login user ID /password.   Is there a
method to redirect to a customized PHP login page instead of the default pop
up window?

Thanks ahead.


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Is there a way not to pop up the default login window?

2001-11-01 Thread Zhu George-CZZ010


Thanks for the suggestion. I think I didn't explain it clearly, what I really want to 
do is: whenever someone types any of the secured URL (it might be any secured php page 
or other files), how can we configure the server to automatically redirect to a 
customized PHP login page instead of popping up the default login window?

Regards.



-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 01, 2001 11:36 AM
To: 'Zhu George-CZZ010'; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there a way not to pop up the default login
window?


Yep. Design your own form, and feed the data from that to $PHP_AUTH_USER and
$PHP_AUTH_PW. Don't send the header() for the 403.

Cheers
Jon


-Original Message-
From: Zhu George-CZZ010 [mailto:[EMAIL PROTECTED]]
Sent: 01 November 2001 17:18
To: [EMAIL PROTECTED]
Subject: [PHP] Is there a way not to pop up the default login window?



If we are using the default Apache/PHP authentication, it will always
pop up the default login window for login user ID /password.   Is there a
method to redirect to a customized PHP login page instead of the default pop
up window?

Thanks ahead.


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Text Editor with Highlighting

2001-11-01 Thread Brent Rieck

I use Nedit, which for me works well.  It's no (x)emacs, but it also
doesn't have a vertical learning curve, you can easily just start
working in it with little chance of shooting your foot clean off.  It's
got syntax highlighting for PHP and other languages, it's small-ish
(doesn't take 30 seconds to load off disk), fast, unlimited undo (woo!),
brace/paren flashing, free (GPL'd), stable (I'll typicaly have it open
for weeks if not months at a time).  http://www.nedit.org

--Brent
[EMAIL PROTECTED] - www.spek.org

TD - Sales International Holland B.V. wrote:
 I looked on the site for this but couldn't find anything about it. I'd like a 
 list of your favorite text editors (preferable for Linux/XFree) with 
 highlighting. 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Is there a way not to pop up the default login window?

2001-11-01 Thread Jon Haworth

if (!isset ($PHP_AUTH_USER)) { 
header (Location: http://mydomain.com/mypage;);
}

would probably do the trick

Cheers
Jon


-Original Message-
From: Zhu George-CZZ010 [mailto:[EMAIL PROTECTED]]
Sent: 01 November 2001 17:51
To: Jon Haworth; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there a way not to pop up the default login
window?



Thanks for the suggestion. I think I didn't explain it clearly, what I
really want to do is: whenever someone types any of the secured URL (it
might be any secured php page or other files), how can we configure the
server to automatically redirect to a customized PHP login page instead of
popping up the default login window?

Regards.



-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 01, 2001 11:36 AM
To: 'Zhu George-CZZ010'; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there a way not to pop up the default login
window?


Yep. Design your own form, and feed the data from that to $PHP_AUTH_USER and
$PHP_AUTH_PW. Don't send the header() for the 403.

Cheers
Jon


-Original Message-
From: Zhu George-CZZ010 [mailto:[EMAIL PROTECTED]]
Sent: 01 November 2001 17:18
To: [EMAIL PROTECTED]
Subject: [PHP] Is there a way not to pop up the default login window?



If we are using the default Apache/PHP authentication, it will always
pop up the default login window for login user ID /password.   Is there a
method to redirect to a customized PHP login page instead of the default pop
up window?

Thanks ahead.


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include(remote host) under w2k problem

2001-11-01 Thread Marek Wysmulek

Hi all.

I have searched almost everything on the net regarding php and windows
focusing on one thing.
How to include to php script started on apache on w2k external sript placed
on some URL.
Source of test script (http://mylocalhost/marek.php)
?
include("http://hermes.com.pl/test.php");
?

and answer viewed in browser

"Warning: Failed opening 'http://hermes.com.pl/test.php' for inclusion
(include_path='') in c:\www\hermes\windykacja\marek.php on line 2"

I know that parser sayes that include_path is not correctly set but, when
I'm trying do the same under Linux - works perfectly. So (I'm sure -because
Include_path has other adaptation) it is not the reason.

Will be wery glad for answer. Even "Leave it !" - but with explanation ;-)))

Marek.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Text Editor with Highlighting

2001-11-01 Thread Jason Wood

Check out UltraEdit for Windows it's great.  Text highlighting for
around 10 programming languages, auto-tabbing for brackets, all kinda
things.  www.ultraedit.com  it's even got built in FTP functions so you can
open a file from a server, and when you save it automatically uploads.
great proggie :)


--
Jason Wood
Chief Technology Officer
Expressive Tek, Inc.
407 Kehrs Mill Road
Ballwin, MO 63011
Phone 636.256.1362
www.expressivetek.com


Td - Sales International Holland B.V. [EMAIL PROTECTED] wrote in message
01110122020108.00569@linux-testbank">news:01110122020108.00569@linux-testbank...
 Hey there,

 I looked on the site for this but couldn't find anything about it. I'd
like a
 list of your favorite text editors (preferable for Linux/XFree) with
 highlighting. I'm using beaver now, I tried cooledit but it's not me...
too
 much functions and looks like it came from an old 386 :-). I have kde
2.1.2
 which has kwrite, but it's kwrite does not yet support PHP, kde 2.2.1 does
 but i don't wanna download the entire kde package. Besides i think it's
still
 in development I tried in on my laptop at home but it just makes things
bold
 instead of all kinds of different colors. also beaver colors for in plain
 html and has some problems with correctly indentifying /* */ comments if
you
 use more of em. i'm also interested in windows though and i think more
people
 are interested so maybe somebody of the site might also want to keep track
of
 the list so it can be put online

 regards



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Some facts about MsSQL/ODBC

2001-11-01 Thread l0t3k

Valentin,
first, let us know exactly how you tested.

second, i think it may have to do with the way the direct extension is
written. the direct extension does batch fetches every time it does a
physical read of the database. if all you're trying to get is a value from
the first row in a multi-row result set, then it makes sense that this would
be slower than a driver that does only single row fetches.

Valentin V. Petruchek [EMAIL PROTECTED] wrote in message
031801c162fa$d09bebf0$[EMAIL PROTECTED]">news:031801c162fa$d09bebf0$[EMAIL PROTECTED]...
 Hello everyone!
 Here i'm not going to ask community about smth.
 I would like to present results of one test speed.

 i perform the same query to MsSQL directly (using mssql_...) and through
 ODBC (odbc_...)
 In first case (direct connection) php works SLOWER than through ODBC.

 My server is on NT 5.1.

 Can anyone explain me why ODBC is faster than direct connection?

 Thnx, Valentin






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Weekly reporting. How to?

2001-11-01 Thread Kraa de Simon

Hello,

I want to send a weekly report to a mailinglist. 

I would like to automate the process and use a cron job to execute 'php.exe
weekly.php' or something. 

I could gather the information, put it in a string and pass the string to
mail(). 

But...is it also possible to grab the html output of a .php file already
used in the application (some report) and e-mail it to someone? 

Any ideas? 

Met vriendelijke groet / With kind regards,

ICL Nederland B.V.  Simon de Kraa
e-Applications / Logistic Systems   Systems Architect
Het Kwadrant 1  Tel. +31 346 598865
Postbus 4000Fax  +31 346 562703
3600 KA  MAARSSEN
The Netherlands mailto:[EMAIL PROTECTED]

---

Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows
2000 5.00.2195 SP 2
Progress 9.1b @ SCO UnixWare 7.1.1

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: include(remote host) under w2k problem

2001-11-01 Thread Mike Frazer

Probably a permissions problem.  Can't open a file if you don't have
permission to do so.

Mike


Marek Wysmulek [EMAIL PROTECTED] wrote in message
03b201c16308$6b6d54e0$0201a8c0@dom">news:03b201c16308$6b6d54e0$0201a8c0@dom...
 Hi all.

 I have searched almost everything on the net regarding php and windows
 focusing on one thing.
 How to include to php script started on apache on w2k external sript
placed
 on some URL.
 Source of test script (http://mylocalhost/marek.php)
 ?
 include(http://hermes.com.pl/test.php;);
 ?

 and answer viewed in browser

 Warning: Failed opening 'http://hermes.com.pl/test.php' for inclusion
 (include_path='') in c:\www\hermes\windykacja\marek.php on line 2

 I know that parser sayes that include_path is not correctly set but, when
 I'm trying do the same under Linux - works perfectly. So (I'm
sure -because
 Include_path has other adaptation) it is not the reason.

 Will be wery glad for answer. Even Leave it ! - but with explanation
;-)))

 Marek.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Weekly reporting. How to?

2001-11-01 Thread Henrik Hansen

[EMAIL PROTECTED] (Kraa De Simon) wrote:

  Hello,

  I want to send a weekly report to a mailinglist. 

  I would like to automate the process and use a cron job to execute 'php.exe
  weekly.php' or something. 

  I could gather the information, put it in a string and pass the string to
  mail(). 

  But...is it also possible to grab the html output of a .php file already
  used in the application (some report) and e-mail it to someone? 

yeah fopen can open files over http also allowing you to get the
output of a script and put it in a string.

-- 
Henrik Hansen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.4.6 released

2001-11-01 Thread Monte Ohrt

Homepage:
http://www.phpinsider.com/php/code/Smarty/

Version 1.4.6
-
- fixed bug with {assign ...} when passing an empty value. (Monte)
- add more warning message fixes. (Monte, Tara Johnson)
- documentation updates. (Monte)
- update fetch function to give proper warning when fetching a
  non-readable or non-existant file. (Monte)
- fixed problem with newline at the end of included templates (Monte,
  Andrei)
- added feature to regenerate cache if compile_check is enabled and an
  involved template or config file gets modified. (Monte)
- added DEBUG execution times to included files: REQUIRES updated
  debug.tpl file! (Monte)
- added support for hidden config variables that cannot be read by
  templates. (Andrei)
- added execution time to DEBUG console, total and inserts. (Monte)
- fixed bug where DEBUG console would not appear with cached content.
  (Monte)
- added support for postfilter functions that are applied to compiled
  template right after compilation. (Andrei)
- fixed the name of clear_compile_tpl() API function to
  clear_compiled_tpl. (Andrei)
- added fix for removing comments so that the line numbers are reported
  correctly in case of errors. (patch from Anders Janson)
- made html_options output xhtml compatible code. (Monte, Arnaud
  Limbourg)



--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mail() extra headers not working

2001-11-01 Thread Byron Albert

 Hello,

 I am trying to ad extra headers to email's I am sending through php. I
want to ad Reply-To: and Bounse-To: addresses.  But when add them useing
the  forth feild of the mail() funtion.
mail($recipient,$msubject,$message,Reply-To:  $sender);
but for some reason when I send this e-mail it puts a newline befor this
header so it becomes part of the message not the headers.  Any ideas on
what to do??
Byron


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problem with non us caracters and strtr

2001-11-01 Thread Rodrigo Peres

Hi list,

I'm in a big trouble. I'm brazilian, so I've made a script to clean up the
special caracters from our language in order to not mess up my publisher,
but this script don't work in Macintosh (macos 9.1, IE 5, all in american
english).

This is my code


?
function myclean($name) {
$name = strtolower(strtr($name,
áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ ,
aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC));
return $name;
}
$temp = myclean($name_actor);
echo($temp);
?

What happens is if i try for example to clean up São Paulo it prints são
paulo. Why??
The $name will receive a string form a text field in a form. my html
charset is iso-8859-1

Thank's in advance

Rodrigo Peres


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help with an error I can't find!

2001-11-01 Thread Lic. Carlos A. Triana Torres

Can some one help fix this error?

Warning: Variable passed to each() is not an array or object in
/usr/local/.test.php on line 14

Here is the line:

while(list ($key, $mid) = each ($HTTP_POST_VARS)) {

--
Lic. Carlos A. Triana Torres.
Webmaster. Centro de Informacion y Gestion Tecnologica
Sancti Spiritus
Email: [EMAIL PROTECTED]
Tel: (53-41) 2 3956
http://www.magon.cu
HamRadio: CO6TB
Locator: FL01GW
ICQ#: 137085816



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] email of listowner?

2001-11-01 Thread Chris Hayes

hi,
i know it is very ungrateful but i am trying to stop 
my subscription to this list. I cannot confirm the 
unsubscribe because my ISP changes my email on the go 
and so the confirmation mail is not accepted, even if 
i try to mess with the sender address.

The php-general-owner@ does not seem to be read.

Reactions please without [PHP] in the subject to 
myself.
thanks,
Chris

-
---
--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the 
Netherlands  --
-
---

 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Help with an error I can't find!

2001-11-01 Thread Mark Roedel

 -Original Message-
 From: Lic. Carlos A. Triana Torres [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, November 01, 2001 4:25 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Help with an error I can't find!
 
 
 Can some one help fix this error?
 
 Warning: Variable passed to each() is not an array or object in
 /usr/local/.test.php on line 14
 
 Here is the line:
 
 while(list ($key, $mid) = each ($HTTP_POST_VARS)) {

Is that line inside a function?  If so, have a look through

http://php.net/manual/en/language.variables.scope.php

for information on how to access global-scope variables from inside a
function.


---
Mark Roedel |  Blessed is he who has learned to laugh
Systems Programmer  |   at himself, for he shall never cease
LeTourneau University   |   to be entertained.
Longview, Texas, USA|   -- John Powell 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Extensions problem

2001-11-01 Thread Brandon Orther

Hello,
 
I have mssql extensions working with the .dll in the extensions
directory of my PHP4 folder.
 
I am trying to get curl to work but when I try to run php it says that
php_curl.dll was not found,  But it is in the same dir as the mssql and
mssql is working great.
 
 
Any IDEAS?
 
Thanks
Brandon



RE: [PHP] Extensions problem

2001-11-01 Thread Erik H. Mathy

 I have mssql extensions working with the .dll in the extensions
 directory of my PHP4 folder.

 I am trying to get curl to work but when I try to run php it says that
 php_curl.dll was not found,  But it is in the same dir as the mssql and
 mssql is working great.

I've never used curl, but I assume that there are some libraries you need to
download and install.

- Erik


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Question about MySQL, ORDER

2001-11-01 Thread BlueBytes

http://paa.fragland.net/hosted/myquestion/

here you find my question, thx

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Help with an error I can't find!

2001-11-01 Thread Liz Fulghum

Sounds like $HTTP_POST_VARS is not a valid array (to check do
if(is_array($HTTP_POST_VARS)) { print YUP; } else { print NOPE; })

Check to make sure that track_vars is turned on in the PHP.ini.


Lic. Carlos A. Triana Torres [EMAIL PROTECTED] wrote in message
005901c16324$1cf252e0$0301a8c0@RED">news:005901c16324$1cf252e0$0301a8c0@RED...
 Can some one help fix this error?

 Warning: Variable passed to each() is not an array or object in
 /usr/local/.test.php on line 14

 Here is the line:

 while(list ($key, $mid) = each ($HTTP_POST_VARS)) {

 --
 Lic. Carlos A. Triana Torres.
 Webmaster. Centro de Informacion y Gestion Tecnologica
 Sancti Spiritus
 Email: [EMAIL PROTECTED]
 Tel: (53-41) 2 3956
 http://www.magon.cu
 HamRadio: CO6TB
 Locator: FL01GW
 ICQ#: 137085816





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Question about MySQL, ORDER

2001-11-01 Thread Mike Eheler

SELECT Main.title, Replies.date FROM (Main LEFT JOIN Replies ON Main.id 
= Replies.main_id) ORDER BY Replies.date

That should do it.

Mike

BlueBytes wrote:

http://paa.fragland.net/hosted/myquestion/

here you find my question, thx




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mail() extra headers not working

2001-11-01 Thread DL Neil

  I am trying to ad extra headers to email's I am sending through php. I
 want to ad Reply-To: and Bounse-To: addresses.  But when add them useing
 the  forth feild of the mail() funtion.
 mail($recipient,$msubject,$message,Reply-To:  $sender);
 but for some reason when I send this e-mail it puts a newline befor this
 header so it becomes part of the message not the headers.  Any ideas on
 what to do??



Byron,

I had the same problem. Gave up!

I recommend that you check out Richard Heyes' MIME and SMTP classes available from 
http://www.phpguru.org/.

Regards,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Utility script: dates

2001-11-01 Thread DL Neil

Somewhere on my travels around the many PHP/script sites, I'm sure that at one time I 
noticed a date-display
utility. I cannot find it again. Please would someone point the way...

What I'm looking for:
displays a form with a variety of date/time fields, user enters a date/time into 
various fields -
utility returns with equivalent values/formats, eg timestamp to calendar, local to 
GMT, date to day of week,
etc.

Please advise,
=dn



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Destroying Ssessions

2001-11-01 Thread Richard Baskett

Unusual that I didnt even get one response, so I shall try again! :)

Ok why does this not work?

session_name(adminid);
session_start();
unset($sess);
session_unset();
session_destroy();
session_write_close();
$sess = 0;

etc etc etc etc etc etc..

After all that is executed I take a look at the session file and what do I
see?  All the session variables still there... and the file still there
also!  How can I get rid of them?

Rick


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] submitting form to a page with frames

2001-11-01 Thread Matt Fair

I have 2 pages page1.php and page2.php.  I want to submit the form and 
its values to page2.php.  page2.php has frames:
frameset rows=218,*
frame src=menu.php name=menuFrame
frame src=editor.php name=editorFrame
/frameset
How can I get the variables that were submitted from page1.php into the 
menuFrame?  When I do this it doesn't get any php variables, but if I 
take it out of the frame it works fine.
Thanks in advance,
Matt


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] submitting form to a page with frames

2001-11-01 Thread Jim Lucas

try using the $GLOBALS[variable_name] array.

Jim 
- Original Message - 
From: Matt Fair [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 01, 2001 3:08 PM
Subject: [PHP] submitting form to a page with frames


 I have 2 pages page1.php and page2.php.  I want to submit the form and 
 its values to page2.php.  page2.php has frames:
 frameset rows=218,*
 frame src=menu.php name=menuFrame
 frame src=editor.php name=editorFrame
 /frameset
 How can I get the variables that were submitted from page1.php into the 
 menuFrame?  When I do this it doesn't get any php variables, but if I 
 take it out of the frame it works fine.
 Thanks in advance,
 Matt
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Where is my php.ini?

2001-11-01 Thread Gaylen Fraley

Ok.  I've installed php on linux and all is well!  Been running for weeks
now.  Problem is, I never had to set up my php.ini .  Got curious and am
wondering where it is.  Locate php.ini yields one in the pear/tests
directory, but that's not it.  Suggestions?

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.21 Guestbook http://64.133.20.82/phpwebsite




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Where is my php.ini?

2001-11-01 Thread Jim Lucas

most of my installs, Redhat linux 7.0 and 7.1, have placed the php.ini file
in the /etc/php.ini  location.  what version of linux are you using?

Jim
- Original Message -
From: Gaylen Fraley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 01, 2001 3:16 PM
Subject: [PHP] Where is my php.ini?


 Ok.  I've installed php on linux and all is well!  Been running for weeks
 now.  Problem is, I never had to set up my php.ini .  Got curious and am
 wondering where it is.  Locate php.ini yields one in the pear/tests
 directory, but that's not it.  Suggestions?

 --
 Gaylen
 [EMAIL PROTECTED]
 Home http://www.gaylenandmargie.com
 PHP KISGB v2.21 Guestbook http://64.133.20.82/phpwebsite




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Strange include

2001-11-01 Thread Marius Pertravius

Sveiki, php-general,

  I have a file index.php . I include file menu.php in index.php ( I
write include('menu.php'); in index.php ) . I want to do like this:

  index.php/menu.php . That means, that index.php has to include menu.php

  index.php/second.php . That means, that index.php has to include
  second.php .

  I think that you already know what I'm talkking about. So how could
I do it?

Thank you



 
 2001.11.02, penktadienis
 Marius Pertravèius
 iCQ: #125733984
 [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] submitting form to a page with frames

2001-11-01 Thread Tom Rogers

The simplest way is to use sessions to hold the values, or you can loop 
through the post vars and add them to the menu.php line like 
src=menu.php?var1=var2=xxx... which will get messy if you have a 
lot of fields.
Tom


At 09:08 AM 2/11/01, Matt Fair wrote:
I have 2 pages page1.php and page2.php.  I want to submit the form and its 
values to page2.php.  page2.php has frames:
frameset rows=218,*
frame src=menu.php name=menuFrame
frame src=editor.php name=editorFrame
/frameset
How can I get the variables that were submitted from page1.php into the 
menuFrame?  When I do this it doesn't get any php variables, but if I take 
it out of the frame it works fine.
Thanks in advance,
Matt


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Where is my php.ini?

2001-11-01 Thread Meir Kriheli

On Friday 02 November 2001 01:16, Gaylen Fraley wrote:
 Ok.  I've installed php on linux and all is well!  Been running for weeks
 now.  Problem is, I never had to set up my php.ini .  Got curious and am
 wondering where it is.  Locate php.ini yields one in the pear/tests
 directory, but that's not it.  Suggestions?

If you don't have one, PHP will use defaults. In PHP's source directory 
there's a file called php.ini-dist (or something similar) you can copy it to 
where PHP expects to find it and rename it to php.ini.

To find out where you should copy it create a php file containing phpinfo() 
in it and access it with your browser. Examine the output to see where the 
ini is expected (you can define this while running configure during the build 
process)

-- 
Meir Kriheli

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Where is my php.ini?

2001-11-01 Thread Gaylen Fraley

7.2 and I compiled PHP 4.0.6 myself.  When I run phpinfo, it shows the
configuration file path = /usr/local/lib/php.ini .  there is no php.ini in
the file.

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.21 Guestbook http://64.133.20.82/phpwebsite

Jim Lucas [EMAIL PROTECTED] wrote in message
00bc01c1632b$b84bbf40$[EMAIL PROTECTED]">news:00bc01c1632b$b84bbf40$[EMAIL PROTECTED]...
 most of my installs, Redhat linux 7.0 and 7.1, have placed the php.ini
file
 in the /etc/php.ini  location.  what version of linux are you using?

 Jim
 - Original Message -
 From: Gaylen Fraley [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, November 01, 2001 3:16 PM
 Subject: [PHP] Where is my php.ini?


  Ok.  I've installed php on linux and all is well!  Been running for
weeks
  now.  Problem is, I never had to set up my php.ini .  Got curious and am
  wondering where it is.  Locate php.ini yields one in the pear/tests
  directory, but that's not it.  Suggestions?
 
  --
  Gaylen
  [EMAIL PROTECTED]
  Home http://www.gaylenandmargie.com
  PHP KISGB v2.21 Guestbook http://64.133.20.82/phpwebsite
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Destroying Ssessions

2001-11-01 Thread Johnson, Kirk

session_destroy() works fine for me - it deletes the session file after the
script finishes. I have never used the session_name() function. I am
wondering if it is possible that the server is confused about what session
needs to be destroyed because of the way session_name() is being used
here

I am also curious about the session_write_close() call. What is left to
write after the session_unset() call?

Sorry I can't give you anything more specific.

Kirk

 -Original Message-
 From: Richard Baskett [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, November 01, 2001 4:03 PM
 To: PHP General
 Subject: [PHP] Destroying Ssessions
 
 
 Unusual that I didnt even get one response, so I shall try again! :)
 
 Ok why does this not work?
 
 session_name(adminid);
 session_start();
 unset($sess);
 session_unset();
 session_destroy();
 session_write_close();
 $sess = 0;
 
 etc etc etc etc etc etc..
 
 After all that is executed I take a look at the session file 
 and what do I
 see?  All the session variables still there... and the file 
 still there
 also!  How can I get rid of them?
 
 Rick

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Where is my php.ini? - FORGET IT!

2001-11-01 Thread Gaylen Fraley

Sorry! I had a senior moment.!  I have it.

--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com
PHP KISGB v2.21 Guestbook http://64.133.20.82/phpwebsite

Meir Kriheli [EMAIL PROTECTED] wrote in message
20011101233857.HRNC958.fep2@there">news:20011101233857.HRNC958.fep2@there...
 On Friday 02 November 2001 01:16, Gaylen Fraley wrote:
  Ok.  I've installed php on linux and all is well!  Been running for
weeks
  now.  Problem is, I never had to set up my php.ini .  Got curious and am
  wondering where it is.  Locate php.ini yields one in the pear/tests
  directory, but that's not it.  Suggestions?

 If you don't have one, PHP will use defaults. In PHP's source directory
 there's a file called php.ini-dist (or something similar) you can copy it
to
 where PHP expects to find it and rename it to php.ini.

 To find out where you should copy it create a php file containing
phpinfo()
 in it and access it with your browser. Examine the output to see where the
 ini is expected (you can define this while running configure during the
build
 process)

 --
 Meir Kriheli



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Problem with non us caracters and strtr

2001-11-01 Thread Yasuo Ohgaki

Rodrigo Peres wrote:

 Hi list,
 
 I'm in a big trouble. I'm brazilian, so I've made a script to clean up the
 special caracters from our language in order to not mess up my publisher,
 but this script don't work in Macintosh (macos 9.1, IE 5, all in american
 english).
 
 This is my code
 
 
 ?
 function myclean($name) {
 $name = strtolower(strtr($name,
 áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ ,
 aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC));
 return $name;
 }
 $temp = myclean($name_actor);
 echo($temp);
 ?
 
 What happens is if i try for example to clean up São Paulo it prints são
 paulo. Why??
 The $name will receive a string form a text field in a form. my html
 charset is iso-8859-1


I think you are better to use recode extension for this.
Check out recode manual page.

--
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Strange include

2001-11-01 Thread Chris Lee

this '/' method looks kinda neet, but some vars get messed, ie $PHP_SELF,
just be carefull using it.

?php
  $INC = explode('/', $REQUEST_URI);
  unset($INC[0]);
  unset($INC[1]);
  $INC = implode('/', $INC);
  include_once($INC);
?

  Chris Lee
  [EMAIL PROTECTED]


Oòkó‰öårzòËèkó [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sveiki, php-general,

   I have a file index.php . I include file menu.php in index.php ( I
 write include('menu.php'); in index.php ) . I want to do like this:

   index.php/menu.php . That means, that index.php has to include menu.php

   index.php/second.php . That means, that index.php has to include
   second.php .

   I think that you already know what I'm talkking about. So how could
 I do it?

 Thank you



 
  2001.11.02, penktadienis
  Marius Pertravèius
  iCQ: #125733984
  [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Destroying Ssessions

2001-11-01 Thread Chris Lee

destroying session vars never worked for me either. it hasnt for quite some
time. now why its important you destoy them other then cleanup, I dont know
your reasons. Im going to guess.

- you store username/passwd in sessions and because httpd runs as nobody,
anyone on the server can read them. ans: chroot telnet, telnet, ftp, it
should be done anyhow. dont store passwd's in plain text, encypt them and
compare the encryped passwd to the storeed encrypted passwd on the server,
if correct, great. you should do it this way anyhow.
- your finatical about cleanlyness and code perfect. ans: so am I. I rip
hair out and call it a day. dont stress it.
- you think you *have* to do this just to get sessions working: ans: wrong
- you think these files will stay on the server forever and fill your HD.
ans: wrong, check php.ini for session_gc (garbage collection)

email me any questions.

--

  Chris Lee
  [EMAIL PROTECTED]



Richard Baskett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Unusual that I didnt even get one response, so I shall try again! :)

 Ok why does this not work?

 session_name(adminid);
 session_start();
 unset($sess);
 session_unset();
 session_destroy();
 session_write_close();
 $sess = 0;

 etc etc etc etc etc etc..

 After all that is executed I take a look at the session file and what do I
 see?  All the session variables still there... and the file still there
 also!  How can I get rid of them?

 Rick




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Is there a way not to pop up the default login window?

2001-11-01 Thread Chris Lee

if your using mod_auth then mod_auth will be called not mod_php. if you want
mod_php to be called, dont use .htaccess (they are apart of mod_auth).
sorry...

--

  Chris Lee
  [EMAIL PROTECTED]



Zhu George-Czz010 [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 If we are using the default Apache/PHP authentication, it will always
pop up the default login window for login user ID /password.   Is there a
method to redirect to a customized PHP login page instead of the default pop
up window?

 Thanks ahead.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: print on printer

2001-11-01 Thread Chris Lee

javascript

javascript = client side
php = server side

unless you want to print on a printer on the server, your goign to need to
use javascript. not only are you asking in the wrong forum, real answer is
'I dont know' sorry cant help ya bud.

--

  Chris Lee
  [EMAIL PROTECTED]



Luz Lopez [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi All

 I have a php that access to database and show the values in the browser,
But
 I need add hte option of print on printer, but that only print the table
 with values.

 Somebody can help me?

 Thanks in Advanced,

 Regards,



 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Crating program for access parallel

2001-11-01 Thread Chris Lee

why? if your thinking the db may give the wrong answer, postgres does a bery
good job of this. if your super worried, well use mysql, they lock the table
when a field is being inserted, updated, or deleted. if you want todo this
for some other strange reason, do it the easy way.

?php
- if file 'busy.tmp' doesnt exist
- - write a file 'busy
- - do something
- - delete the file
- else
- - bugger off
?

--

  Chris Lee
  [EMAIL PROTECTED]



Luz Lopez [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all

 I am creating a program PHP that will be access int the web for many
 persons, this aplication will be permit to insert registry on a data base
 Postgresql, When a person this inserting a registry I need to block that
 table so that another user cannot to access the data base. Exists some
form
 in php to do this?

 I want to Know how can I save  information on a Data Bse that will
 be access
 for many persons at the same time.

 Thanks in advanced for yuor advices !!!

 Regards,

 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Destroying Ssessions

2001-11-01 Thread Richard Baskett

Actually I have had a couple people respond about the code order that I
wrote, so I am going to try and see if that works.

You're right I do store the username/passwd in the session, and I do encrypt
both the session password and the database password.  I am trying to make
this very secure :)  You cannot decrypt them either which is nice.  I just
don't like having a session file there for longer then it has to be.  I do
know about php's garbage collecting so I don't have to worry about that.. I
think the problem is more the second choice you gave me :)  I like
cleanliness, since I am a designer gone coder, it needs to look good :)
Everything works beautifully though and it doesnt matter all that much if I
have to wait until the garbage collector comes by, but when a function
doesnt do what it's supposed to do.. I try to find out why.. and if it's me
that's screwing up or something else..

Thanks for your reply and I AM going to get this to work! *grin*

Rick

 destroying session vars never worked for me either. it hasnt for quite some
 time. now why its important you destoy them other then cleanup, I dont know
 your reasons. Im going to guess.
 
 - you store username/passwd in sessions and because httpd runs as nobody,
 anyone on the server can read them. ans: chroot telnet, telnet, ftp, it
 should be done anyhow. dont store passwd's in plain text, encypt them and
 compare the encryped passwd to the storeed encrypted passwd on the server,
 if correct, great. you should do it this way anyhow.
 - your finatical about cleanlyness and code perfect. ans: so am I. I rip
 hair out and call it a day. dont stress it.
 - you think you *have* to do this just to get sessions working: ans: wrong
 - you think these files will stay on the server forever and fill your HD.
 ans: wrong, check php.ini for session_gc (garbage collection)
 
 email me any questions.
 
 --
 
 Chris Lee
 [EMAIL PROTECTED]
 
 
 
 Richard Baskett [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Unusual that I didnt even get one response, so I shall try again! :)
 
 Ok why does this not work?
 
 session_name(adminid);
 session_start();
 unset($sess);
 session_unset();
 session_destroy();
 session_write_close();
 $sess = 0;
 
 etc etc etc etc etc etc..
 
 After all that is executed I take a look at the session file and what do I
 see?  All the session variables still there... and the file still there
 also!  How can I get rid of them?
 
 Rick
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Secure transfer

2001-11-01 Thread Chris Lee

you dont need any unctions in php todo this. you need to install openssl and
compile it into apache.

port 80 = http (non-secure)
port 443 = https (secure)

http://www.somesite.com/index.php unsecure
https://www.somesite.com/index.php same page, now everything is secure

have fun.

--

  Chris Lee
  [EMAIL PROTECTED]



Orv î?÷inklÏ ²ørÏkîskî [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi php'ers

I'm about to build a site that allows payment with credit card.
Of cause the card number, expiration date etc. should be secured
when transfered. How do I do that?
I've been looking at the OpenSSL functions in php, but they seem to
be unsatisfying.

 Kind regards,
 Morten Winkler





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Distributed Data Base

2001-11-01 Thread Chris Lee

I dont worry about it. why are you?

--

  Chris Lee
  [EMAIL PROTECTED]



Luis Corea [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,
 I want to Know how can I save  information on a Data Bse that will be
access
 for many persons at the same time.

 I use Postgressql

 Thanks.

 _
 Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: date problem

2001-11-01 Thread Chris Lee

date() shoudl give you the time in your timezone, gmdate() should give you
the time in the GMT timezone. I would check your server and make sure the
timezone is correctly set.

--

  Chris Lee
  [EMAIL PROTECTED]



Steve Tsai [EMAIL PROTECTED] wrote in message news:none...
 For reference:
 OS: OpenBSD 2.9
 Web Server: Apache1.3.19
 PHP Version: 4.0.6

 My problem is that date() and all the other time functions return GMT
instead
 of localtime.  system(date) returns the correct localtime.  Those
functions
 used to return localtime since GMT.  The problem seems to have started
after
 daylight savings time changed.  I hope someone has an idea of what's wrong
 and how to fix it.  As for now, I'm adding time() - 3600 * 8 to all my
 scripts right now.

 Steve



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mysql php prob...

2001-11-01 Thread Chris Lee

put the mysql_db_query in an if() statement, more likley then not your
select statement isnt returning any results.

--

  Chris Lee
  [EMAIL PROTECTED]



Sc [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi;

 i keep getting an error of: Warning: Supplied argument is not a valid
MySQL
 result resource in /datascripts/insertdata.php on line 17...

 Line 17 is: $row = mysql_fetch_assoc($test);

 and here is the rest of it (not all of it though):

 for ($p = 1; $p = 24; $p++) {
 $test = mysql_db_query(melbourne, SELECT * FROM 'Port$p' WHERE
 'Port$p'.date='$yesterday');
 $row = mysql_fetch_assoc ($test);
 $yindata = $row['switchin'];
 $youtdata = $row['switchout'];
 $dinPort = '$inPort$p' - $yindata;
 $doutPort = '$outPort$p'  - $youtdata;

 Can anyone help me overcome this prob? i've prob missed something without
 thinking but i cant seem to get it...

 Thx.

 sc






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: is there a commandline php.exe interpreter?

2001-11-01 Thread Chris Lee

sure there is, get it at php.net goto download section and choose the cgi
version. there you are. php.exe

--

  Chris Lee
  [EMAIL PROTECTED]



John A. Grant [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I've installed ActivePerl, which gives me a way to run .pl files,
 i.e. :
 c:\ perl someprogram.pl

 Does the Win32 php installation give me a command-line
 interpreter like that?

 Here's why I'm asking. I have a set of pages that I want to convert
 to php, but I will also need to drop those pages onto a CD too.
 I suppose I could view each page from the server and 'save as
 HTML' locally, but I was thinking that I might be able to run a php
 interpreter on the *.php pages and generate corresponding *.html
 pages in batch mode as follows:
 c:\ php index.php  index.html
 c:\ php about.php  about.html
 etc.

 Then I would have to run a batch search/replace program on the
 *.html files to change all links to *.php pages to link to the
 newly-generated *.html pages.

 Is there anything like that in the win32 install package or
 just configure a web server? I started to install it, but it looked
 like it was going to just install server stuff, so I cancelled it.

 --
 John A. Grant  * I speak only for myself *  (remove 'z' to reply)
 Radiation Geophysics, Geological Survey of Canada, Ottawa
 If you followup, please do NOT e-mail me a copy: I will read it here






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Binary file transfers

2001-11-01 Thread phantom

I am uploading .Jpegs and GIFS but they end up being all messed up when
I try to view them after a file transfer.

However, txt file transfers work ok.  Someone told me this is because
images need to be transfered as binary files, not ascii files (like
txt).

Is this true, and if so, how do I correct for this?  Thanks.

SOURCE CODE _

%
if ($Action == Submit)
   {
 /* define and list important vars */
 $Userfile = $HTTP_POST_FILES['Userfile']['name'];
 $Type = $HTTP_POST_FILES['Userfile']['type'];
 $Size = $HTTP_POST_FILES[Userfile][size];
 $TempLoc = $HTTP_POST_FILES[Userfile][tmp_name];
 $FinalLoc = website_com/uploads/$Userfile;
 echo  File: $Userfile | Type: $Type | Size: $Size | TempLoc:
$TempLoc br FinalLoc: $FinalLoc br;

  /* confirm file not too big and permitted type */
  if ($Size  20) $FileError = File size greater than 200 kb.;
 if (($Type != text/plain)  ($Type != image/jpeg)  ($Type !=
image/gif)  ($Type != image/pjpeg)) $FileError = File not correct
type (txt, jpg, gif only).;

 /* move file to final destination on server if no errors */
 if (!$FileError) move_uploaded_file($TempLoc, $FinalLoc);
   }
else
   { echo  Load page; }
if ($FileError) echo FILE NOT ACCEPTED: $FileError;
%
html
head
titlePHP Send File/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1

/head

body bgcolor=#FF text=#00
pSend me a file!!! Testing page 200 kbytes max. Text, Jpeg, and
Gif's only./p
form enctype=multipart/form-data action=sendfile.php method=post

  p
input type=hidden name=MAX_FILE_SIZE value=200
Send this file:
input name=Userfile type=file
  /p
  input type=submit name=Action value=Submit
/form
%
echo Browser and OS: $HTTP_USER_AGENT brIP Addr: $REMOTE_ADDR;
%
pa href=uploads/View/a the upload directory to see if your file
is there./p
pa href=sendfile.txtView/a this page's full source code./p
/body
/html



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] simple array tutorial wanted

2001-11-01 Thread Justin French

Hi all,

I really want to get me head around arrays, becuase 
I KNOW there's a better way to do some of the stuff 
i'm doing right now.

I could mess with stuff for a few hours and probably 
get it, but i'd rather have a decent tutorial if 
anyone knows of one...


Thanks,

Justin French

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: simple array tutorial wanted

2001-11-01 Thread Liz Fulghum

http://www.onlamp.com/pub/a/php/2001/06/07/php_foundations.html




Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all,

 I really want to get me head around arrays, becuase
 I KNOW there's a better way to do some of the stuff
 i'm doing right now.

 I could mess with stuff for a few hours and probably
 get it, but i'd rather have a decent tutorial if
 anyone knows of one...


 Thanks,

 Justin French



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] simple array tutorial wanted

2001-11-01 Thread Jack Dempsey

http://www.php.net/manual/en/language.types.array.php

start with that

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 02, 2001 12:33 AM
To: php
Subject: [PHP] simple array tutorial wanted


Hi all,

I really want to get me head around arrays, becuase 
I KNOW there's a better way to do some of the stuff 
i'm doing right now.

I could mess with stuff for a few hours and probably 
get it, but i'd rather have a decent tutorial if 
anyone knows of one...


Thanks,

Justin French

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Can you AUTO Post/Submit on a mixed HTML/PHP form

2001-11-01 Thread Jason G.

Just a thought...

Check out crescent internet toolkit by Progress Software.  It has a control 
for VB that lets you post data to a script, rather than relying on an HTML 
form...

Can you just use a query string?  you may have to code your own urlencode() 
function in VB, but that may be an option.

Maybe you can invoke cURL from vb.  It's free, but I do not know if it has 
a Win32 version.

Hope it helps.
-Jason Garber
IonZoft.com


At 11:01 AM 11/1/2001 +, Arf wrote:
Like the heredoc thanx for that...

The way that I am using VB will not support the VBscript option
unfortunately but a good suggestion.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Uncertainties about MySQL commands

2001-11-01 Thread Jason G.

Regarding your mysql_insert_id() function:

I believe that it works on a connection by connection basis.  Therefore, if 
you execute an insert, and then call that function, you are guarenteed to 
have the correct ID.  Look up the LAST_INSERT_ID() function in the MySQL 
manual on www.mysql.com for more information.

-Jason Garber
IonZoft.com


At 09:22 PM 11/1/2001 +0100, TD - Sales International Holland B.V. wrote:
Hey list, i'm new to php so bare with me...

got some questions on mysql commands. I'd like to know how the
mysql_insert_id() function works exactly.
First of all how reliable is it? What happens this happens:
Table: (ID int unsigned primary key auto_increment, Stuff text, MoreStuff
text)
(my script)
insert into table values(NULL, bla, bla)
(some other application)
insert into table values(NULL, bleh, bleh)
(my script)
$id = mysql_insert_id

it's not likely that this will happen, but if the site is very/extremely
crowded it could be that there's an insert right after mine but before me
callind mysql_insert_id. As you might guess I'd like to know which ID will be
returned, the one my script created or the one from the other application?

Also what happens if my table is like this:
Table: (Stuff text, ID int unsigned primary key auto_increment, OtherStuff
text)
Thus having the ID on column 2 instead of 1
or like this
Table: (Bla int unsigned primary key auto_increment, Stuff text, Otherstuff
text)
Thus the ID not having the name ID
Or like this
Table: (bla int unsigned primary key auto_increment, id int unsigned primary
key auto_increment, stuff text, otherstuff text)
Thus having 2 auto_increment columns where the 2nd one is called ID (lower
case).

I'm really uncertain about that and couldn't find it back in the manual
does it only read the first column? does this column have to be named ID,
what if ID is another column? what if there is more than 1 auto_increment
column in the table? what happens if some(one)/(thing) else inserts before
calling mysql_insert_id.

One more question (pure curiosity this one) the return value from
mysql_query... is that ever gonna be higher than 1? I assume it can be if the
insert affects more than 1 line right? Also my book says that the return
value is TRUE or FALSE for every command except for an INSERT in which case
it would be 0 on failure and higher on succes. I think that's crap? I'm
guessing it will also return a number for UPDATE's and REPLACE's is that
correct? Are there others?

OK just one more thing, this is for the people from troutworks if they're
monitoring this list. I think the translation of the PHP Bible is
crap! Please complain about it at the translator. The guy/girl
managed to translate (quotes)  to (comma's) , and there are a lot of other
wrongly translated things in there, luckily the examples in there got me on
the right path again over and over showing that the translation was incorrect
but it's just confusing like hell. The number of mistakes is unbelievable
(and i'm NOT talking about spelling errors, I'm talking about messy stuff
like calling quotes comma's) and I'm 100% certain it was NOT translated by a
programmer

regards

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] simple array tutorial wanted

2001-11-01 Thread Justin French

U, I now how to use the manual, I was after a *tutorial*.

Liz posted a VERY good link/tutorial though --  many thanks!!!

Justin



Jack Dempsey wrote:
 
 http://www.php.net/manual/en/language.types.array.php
 
 start with that
 
 -Original Message-
 From: Justin French [mailto:[EMAIL PROTECTED]]
 Sent: Friday, November 02, 2001 12:33 AM
 To: php
 Subject: [PHP] simple array tutorial wanted
 
 Hi all,
 
 I really want to get me head around arrays, becuase
 I KNOW there's a better way to do some of the stuff
 i'm doing right now.
 
 I could mess with stuff for a few hours and probably
 get it, but i'd rather have a decent tutorial if
 anyone knows of one...
 
 Thanks,
 
 Justin French
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] year 2002 strtotime problem

2001-11-01 Thread John Clarke

I have this problem with Php 4.0.5 on both  Win ME and Linus boxes, where my
year 2002 dates are converted back to 2001 when formating with 'strtotime'.

First I post the following variables from an html page to a php page

$date1='12/12/2001'
$date2='15/01/2002'

I then use date(D M j Y, strtotime($date1);  and date(D M j Y,
strtotime($date2));
to store them in an array for screen display.

As the users have the abilty to selected different dates I need to check
that 1 is before the other.
To do this I have a script timediff() that I pass the two dates to in the
above format.

All works fine until the year 2002 is selected. This is part of the
timediff() code with dispay statements and the result.

 function timediff($date1,$date2) {

   echo 'date1= '.$date1.' ';// displays  'Wed December 12
2001'   ... correct
   echo 'date2= '.$date2.' ';   //  displays   'Tue January 15
2002'   ...correct, all fine so far

$dd1=date(Ymd, strtotime($date1));
$dd2=date(Ymd, strtotime($date2));

   echo 'date1= '.$dd1.'br';// displays  '20011212'   ...
correct
   echo 'date2= '.$dd2.' br';   //  displays '20010115
...WRONG
}

It seem that by applying strtotime a 2nd time might cause this problem,
as the first application was fine.

I have tested all possible combinations of strtotime but the year 2002
always goes back to 2001
Have also tried just 'strtotime($date1)' but same problem again.

Any help or comments would be greatly appreciated as I thought I had
finished a booking program any now find this!!

Thanks in anticipation


John Clarke



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] year 2002 strtotime problem

2001-11-01 Thread Niklas Lampén

Funny, I quickly tried this:

?
$date1 = 12/12/2001;
$date2 = 15/01/2002;

$date1 = date(D M j Y, strtotime($date1));
$date2 = date(D M j Y, strtotime($date2));

print $date1.br;
print $date2.br;

print date(Y-m-d, strtotime($date1)).br;
print date(Y-m-d, strtotime($date2)).br;
?

And the result was this:

Wed Dec 12 2001
Sat Mar 1 2003
2001-12-12
2003-03-01



Niklas


-Original Message-
From: John Clarke [mailto:[EMAIL PROTECTED]] 
Sent: 2. marraskuuta 2001 8:17
To: [EMAIL PROTECTED]
Subject: [PHP] year 2002 strtotime problem


I have this problem with Php 4.0.5 on both  Win ME and Linus boxes,
where my year 2002 dates are converted back to 2001 when formating with
'strtotime'.

First I post the following variables from an html page to a php page

$date1='12/12/2001'
$date2='15/01/2002'

I then use date(D M j Y, strtotime($date1);  and date(D M j Y,
strtotime($date2)); to store them in an array for screen display.

As the users have the abilty to selected different dates I need to check
that 1 is before the other. To do this I have a script timediff() that I
pass the two dates to in the above format.

All works fine until the year 2002 is selected. This is part of the
timediff() code with dispay statements and the result.

 function timediff($date1,$date2) {

   echo 'date1= '.$date1.' ';// displays  'Wed
December 12
2001'   ... correct
   echo 'date2= '.$date2.' ';   //  displays   'Tue
January 15
2002'   ...correct, all fine so far

$dd1=date(Ymd, strtotime($date1));
$dd2=date(Ymd, strtotime($date2));

   echo 'date1= '.$dd1.'br';// displays  '20011212'
...
correct
   echo 'date2= '.$dd2.' br';   //  displays '20010115
...WRONG
}

It seem that by applying strtotime a 2nd time might cause this
problem, as the first application was fine.

I have tested all possible combinations of strtotime but the year
2002 always goes back to 2001 Have also tried just 'strtotime($date1)'
but same problem again.

Any help or comments would be greatly appreciated as I thought I had
finished a booking program any now find this!!

Thanks in anticipation


John Clarke



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] year 2002 strtotime problem

2001-11-01 Thread John Clarke

Even more funny...

I cut and pasted your code and I got;

Wed Dec 12 2001
Sat Mar 1 2003
2001-12-12
2001-03-01

What version of Php and OS are you using??

John

Niklas lampén [EMAIL PROTECTED] wrote in message
000301c16369$6817a320$ba93c5c3@Niklas">news:000301c16369$6817a320$ba93c5c3@Niklas...
 Funny, I quickly tried this:

 ?
 $date1 = 12/12/2001;
 $date2 = 15/01/2002;

 $date1 = date(D M j Y, strtotime($date1));
 $date2 = date(D M j Y, strtotime($date2));

 print $date1.br;
 print $date2.br;

 print date(Y-m-d, strtotime($date1)).br;
 print date(Y-m-d, strtotime($date2)).br;
 ?

 And the result was this:
 
 Wed Dec 12 2001
 Sat Mar 1 2003
 2001-12-12
 2003-03-01
 


 Niklas


 -Original Message-
 From: John Clarke [mailto:[EMAIL PROTECTED]]
 Sent: 2. marraskuuta 2001 8:17
 To: [EMAIL PROTECTED]
 Subject: [PHP] year 2002 strtotime problem


 I have this problem with Php 4.0.5 on both  Win ME and Linus boxes,
 where my year 2002 dates are converted back to 2001 when formating with
 'strtotime'.

 First I post the following variables from an html page to a php page

 $date1='12/12/2001'
 $date2='15/01/2002'

 I then use date(D M j Y, strtotime($date1);  and date(D M j Y,
 strtotime($date2)); to store them in an array for screen display.

 As the users have the abilty to selected different dates I need to check
 that 1 is before the other. To do this I have a script timediff() that I
 pass the two dates to in the above format.

 All works fine until the year 2002 is selected. This is part of the
 timediff() code with dispay statements and the result.

  function timediff($date1,$date2) {

echo 'date1= '.$date1.' ';// displays  'Wed
 December 12
 2001'   ... correct
echo 'date2= '.$date2.' ';   //  displays   'Tue
 January 15
 2002'   ...correct, all fine so far

 $dd1=date(Ymd, strtotime($date1));
 $dd2=date(Ymd, strtotime($date2));

echo 'date1= '.$dd1.'br';// displays  '20011212'
 ...
 correct
echo 'date2= '.$dd2.' br';   //  displays '20010115
 ...WRONG
 }

 It seem that by applying strtotime a 2nd time might cause this
 problem, as the first application was fine.

 I have tested all possible combinations of strtotime but the year
 2002 always goes back to 2001 Have also tried just 'strtotime($date1)'
 but same problem again.

 Any help or comments would be greatly appreciated as I thought I had
 finished a booking program any now find this!!

 Thanks in anticipation


 John Clarke



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED] To
 contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] sending email to php script

2001-11-01 Thread Adrian D'Costa

On Thu, 1 Nov 2001, Jason Murray wrote:

   You'll also need to compile php as a standalone, and put as 
   the first line of your php script
   
   #!/path/to/php -q
  
  What if we need both version??
 
 There's nothing stopping you running both.

How do you compile it for both?

Adrian


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >