php-windows Digest 3 Apr 2001 18:47:02 -0000 Issue 525

Topics (messages 6448 through 6467):

free hosting with php
        6448 by: Vlad Bejenaru aka BJ

Re: Warning: 1 is not a valid File-Handle resource
        6449 by: Mangiola Nunzio         arivia.kom
        6450 by: Richard Kurth

Re: Case insensitive str_replace
        6451 by: Matthew
        6463 by: Chris Adams
        6466 by: Asendorf, John

Re: mail() Function and time
        6452 by: David Elliott

/i modifier with preg_replace
        6453 by: Matthew
        6455 by: Carsten Senf
        6456 by: Daniel Beulshausen
        6459 by: Matthew

security alert
        6454 by: Mike Schwarz

About mysql
        6457 by: yanshuldg
        6461 by: Rasmus Lerdorf
        6462 by: Svensson, B.A.T.

Re: Problem - Sending mail
        6458 by: Giro De Roover

Re: PHP & IIS5
        6460 by: Matthew

Apache no see PHP
        6464 by: Marco Bleeker
        6465 by: Marco Bleeker

Re: Insert query in Oracle database using php and COM
        6467 by: John Lim

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


can any one help me to find free hosting were i can run php? (for testing my
projects?)

10x
Vlad BEJENARU aka BJ
Home Page
ICQ: 113502358

----------------------------------------------------------------------------
----






I know that fget() only allows for 2 parameters. That is fget(value,value)
Is it possible that the same applies to fgetcsv()? Because I used to 
get the same error when I tried to add to many parameters.

> ----------
> From:         Richard Kurth[SMTP:[EMAIL PROTECTED]]
> Sent:         Tuesday, April 03, 2001 7:13 AM
> To:   php-windows
> Subject:      [PHP-WIN] Warning: 1 is not a valid File-Handle resource 
> 
> I am using the newest ver of PHP and newest ver of apache on win98 
> just installed new php and apache yesterday set php up as a module
> 
> What is causing this error
>  It worked fine until I added the new ver of php and apache
>  
> Warning: 1 is not a valid File-Handle resource in
>  c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88
> 
> This is the cod in question
> 
>  $tab = chr(9); // define tabulator
>  if(file_exists("userdata")) {
>  $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)");
>  flock($fp2, 2); //unless ($use_flock == 0);
>  while ($data = fgetcsv ($fp2, 1000, $tab)) {   <---this is line 88
>    $num = count ($data);
>     $row++;
>      for ($c=0; $c<$num; $c++) {
> 
>    }
> 
> -- 
> PHP Windows 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]
> 




No fgetcsv allows three fgetcsv (int fp, int length [, string delimiter])
and as I sead it worked fine untel I upgraded php and apache.


> I know that fget() only allows for 2 parameters. That is fget(value,value)
> Is it possible that the same applies to fgetcsv()? Because I used to
> get the same error when I tried to add to many parameters.
>
> >
> > I am using the newest ver of PHP and newest ver of apache on win98
> > just installed new php and apache yesterday set php up as a module
> >
> > What is causing this error
> >  It worked fine until I added the new ver of php and apache
> >
> > Warning: 1 is not a valid File-Handle resource in
> >  c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88
> >
> > This is the cod in question
> >
> >  $tab = chr(9); // define tabulator
> >  if(file_exists("userdata")) {
> >  $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)");
> >  flock($fp2, 2); //unless ($use_flock == 0);
> >  while ($data = fgetcsv ($fp2, 1000, $tab)) {   <---this is line 88
> >    $num = count ($data);
> >     $row++;
> >      for ($c=0; $c<$num; $c++) {
> >
> >    }
> >
> > --
> > PHP Windows 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 Windows 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]
>
>





I'm not sure where to put the /i.
If I had code like:

$print preg_replace("test", "this is a test", "test TEST tEsT TEst")

where in that code would i put the modifier?

--

Matt
[EMAIL PROTECTED]
[EMAIL PROTECTED]
< www.mralston.co.uk />
""James Moore"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> >
> > Does anyone know how to do a case insensitive str_replace?
> > I don't want to alter the case of the original string (so I can't do a
> > strtolower first).
> >
> > I've seen some functions used with the likes of [^Aa] in them but I'm
not
> > sure how to use this...
> > Anyone got any ideas?
>
> use preg_replace with /i modifier.
>
> James
>
>
>
> --
> PHP Windows 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]
>






On 3 Apr 2001 00:49:05 -0700, Matthew <[EMAIL PROTECTED]>
wrote:
>I'm not sure where to put the /i.
>If I had code like:
>
>$print preg_replace("test", "this is a test", "test TEST tEsT TEst")
>
>where in that code would i put the modifier?

I don't think that code would work as it is without putting the pattern in
delimiters, at which point it becomes more obvious where modifiers go: 

print preg_replace("/test/i", "this is a test", "test TEST tEsT TEst");




What's wrong with eregi_replace ???

Do you really need the POSIX regex?

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Aut insanit homo, aut versus facit


> -----Original Message-----
> From: Matthew [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 02, 2001 10:51 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Case insensitive str_replace
> 
> 
> Hello...
> 
> Does anyone know how to do a case insensitive str_replace?
> I don't want to alter the case of the original string (so I can't do a
> strtolower first).
> 
> I've seen some functions used with the likes of [^Aa] in them 
> but I'm not
> sure how to use this...
> Anyone got any ideas?
> 
> 
> --
> 
> Matt
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> < www.mralston.co.uk />
> 
> 
> 
> -- 
> PHP Windows 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]
> 




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02 April 2001 at 16:01:54 +0100 (which was 16:01 where I live) James
Moore wrote

>> I an using PHP Version 4.0.5RC1 on an NT 4 sp5 box. I am playing around
>> with the mail() function but I and have got it working a minor problem
>> is that the date header is wrong the header is
>>
>> Date: Fri, 30 Mar 2001 13:42:59 0000
>>
>> it should be.
>>
>> Date: Fri, 30 Mar 2001 13:42:59 +0100
>>
>> I have checked the server for time zone etc.
>>
>> I also run an SMTP server from it (Not exchange) and everything is OK on
>> that.

> I just checked this with 4.0.5RC5 and 4.0.6-dev and it works for me..
> looks like screwed Daylight savings time doesnt seem to be a problem with
> PHP although because it doesnt touch the date header (which is done by
> the mail server itself.) One option is to set your own valid date header
> using the extra argument to mail.

Thanks James

- --

 BBFN,                     _______________________________________________
  David                   |  MUA :- The Bat! 1.52 Beta/1  | E-mailaholics |
 _________________________| Win 2000 Server 5.0.2195 SP1  | International |
| I have a cheap sysop, no taglines:-(                                    |

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8ckt (Build 04/01)
Comment: PGP Signed, sealed, delivered.

iQA/AwUBOsmM7vmK8eZlD0U0EQI4JQCgsAPVAZ8Ln+6aYuNvEThuxPqDwYQAoJzv
1mvLUnQvkpC9e7REZzWdmppx
=oRS+
-----END PGP SIGNATURE-----






Hello...

I'm trying to implement a case insensitive str_replace (bearing in mind that
I'll be performing the replace on a paragraph of text so I don't want to
convert it all to upper or lower case first).

Somebody suggested using the /i modifier with pregreplace but I don't know
where to put the modifier... i've put an example bit of code below, can
somebody please put the modifier in its rightful place for me?

$print preg_replace("test", "this is a test", "test TEST tEsT TEst")

--

Matt
[EMAIL PROTECTED]
[EMAIL PROTECTED]
< www.mralston.co.uk />






Hi Matt,

in preg_replace you should use regular expressions to specify what you
search. The form is "/<regular expression>/<options>".

So you regular expression is your text "test" and the option is "i" for
insnsitive search.

$print preg_replace("/test/i", "this is a test", "test TEST tEsT TEst")

Just take a look at the online help:
http://www.php.net/manual/en/function.preg-replace.php

regards,
carsten

P.S. another way is the function eregi_replace()
http://www.php.net/manual/en/function.eregi-replace.php


cs > -----Ursprüngliche Nachricht-----
cs > Von: Matthew [mailto:[EMAIL PROTECTED]]
cs > Gesendet: Dienstag, 3. April 2001 10:33
cs > An: [EMAIL PROTECTED]
cs > Betreff: [PHP-WIN] /i modifier with preg_replace
cs > 
cs > 
cs > Hello...
cs > 
cs > I'm trying to implement a case insensitive str_replace 
cs > (bearing in mind that
cs > I'll be performing the replace on a paragraph of text so I 
cs > don't want to
cs > convert it all to upper or lower case first).
cs > 
cs > Somebody suggested using the /i modifier with pregreplace 
cs > but I don't know
cs > where to put the modifier... i've put an example bit of 
cs > code below, can
cs > somebody please put the modifier in its rightful place for me?
cs > 
cs > $print preg_replace("test", "this is a test", "test TEST 
cs > tEsT TEst")
cs > 
cs > --
cs > 
cs > Matt
cs > [EMAIL PROTECTED]
cs > [EMAIL PROTECTED]
cs > < www.mralston.co.uk />
cs > 
cs > 
cs > 
cs > -- 
cs > PHP Windows Mailing List (http://www.php.net/)
cs > To unsubscribe, e-mail: [EMAIL PROTECTED]
cs > For additional commands, e-mail: [EMAIL PROTECTED]
cs > To contact the list administrators, e-mail: 
cs > [EMAIL PROTECTED]
cs > 




At 09:32 03.04.2001 +0100, Matthew wrote:
>Hello...
>
>I'm trying to implement a case insensitive str_replace (bearing in mind that
>I'll be performing the replace on a paragraph of text so I don't want to
>convert it all to upper or lower case first).
>
>Somebody suggested using the /i modifier with pregreplace but I don't know
>where to put the modifier... i've put an example bit of code below, can
>somebody please put the modifier in its rightful place for me?
>
>$print preg_replace("test", "this is a test", "test TEST tEsT TEst")

print preg_replace("/test/i", "this is a test", "test TEST tEsT TEst");
or you might try '/(?<!\S)test(?!\S)/i' to replace only occurences of test 
and don't want to touch "betatester"

http://www.amazon.com/exec/obidos/ASIN/1565922573 is a "must have" for most 
programmers.

daniel

/*--
daniel beulshausen - [EMAIL PROTECTED]
using php on windows? http://www.php4win.de





Thanks Carsten & Daniel...that works.

Daniel... that (?<!\S) bit will be really useful to me later on in a forum
that I'm writing for my college... it'll censor swear words like c*nt but I
don't want it to touch town names and such like Scunthorpe. So I'll be
keeping that little code snippet! :)

Thanks a lot folks. :)

--

Matt
[EMAIL PROTECTED]
[EMAIL PROTECTED]
< www.mralston.co.uk />
"Daniel Beulshausen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 09:32 03.04.2001 +0100, Matthew wrote:
> >Hello...
> >
> >I'm trying to implement a case insensitive str_replace (bearing in mind
that
> >I'll be performing the replace on a paragraph of text so I don't want to
> >convert it all to upper or lower case first).
> >
> >Somebody suggested using the /i modifier with pregreplace but I don't
know
> >where to put the modifier... i've put an example bit of code below, can
> >somebody please put the modifier in its rightful place for me?
> >
> >$print preg_replace("test", "this is a test", "test TEST tEsT TEst")
>
> print preg_replace("/test/i", "this is a test", "test TEST tEsT TEst");
> or you might try '/(?<!\S)test(?!\S)/i' to replace only occurences of test
> and don't want to touch "betatester"
>
> http://www.amazon.com/exec/obidos/ASIN/1565922573 is a "must have" for
most
> programmers.
>
> daniel
>
> /*--
> daniel beulshausen - [EMAIL PROTECTED]
> using php on windows? http://www.php4win.de
>
>
> --
> PHP Windows 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]
>






i'm running php.exe on IIS 5.0 and got this alert when running
a php-script


***********************************
Security Alert! PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means
that a page will only be served up if the REDIRECT_STATUS CGI variable is
set. This variable is set, for example, by Apache's Action directive
redirect.

You may disable this restriction by recompiling the PHP binary with
the --disable-force-cgi-redirect switch. If you do this and you have your
PHP CGI binary accessible somewhere in your web tree, people will be able to
circumvent .htaccess security by loading files through the PHP parser. A
good way around this is to define doc_root in your php.ini file to something
other than your top-level DOCUMENT_ROOT. This way you can separate the part
of your web space which uses PHP from the normal part using .htaccess
security. If you do not have any .htaccess restrictions anywhere on your
site you can leave doc_root undefined.
************************************

who can help?

thank you
mike


--

C-TEK Computer
Bergstrasse 36
CH-5430 Wettingen
phone & fax 056 426 04 01






There're two result sets of the same structure created by mysql_query(),
How can I combine them into one?





uh, what?

On Tue, 3 Apr 2001, yanshuldg wrote:

> There're two result sets of the same structure created by mysql_query(),
> How can I combine them into one?
>
>
> --
> PHP Windows 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]
>





One solution could be;

Inserting the two result sets into a temporary table,
and then returning the temporary table. And of course:
the attribute set of the temporary table has to be the
lcg between the two result sets.

>-----Original Message-----
>From: yanshuldg [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 03, 2001 1:12 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP-WIN] About mysql
>
>
>There're two result sets of the same structure created by mysql_query(),
>How can I combine them into one?




Dear Andrew,

So what is the solution??

Giro

""Andrew Parry"" <[EMAIL PROTECTED]> wrote in message
99l2s4$3qo$[EMAIL PROTECTED]">news:99l2s4$3qo$[EMAIL PROTECTED]...
> Hi,
>
> Background:
> -------------
> I'm developing a web application using PHP, and want to automatically mail
> users on certain events (eg. new user logging in, etc).
>
> My web host does not provide dial-up and SMTP services, so my mail host is
> at a different domain to my web site.
>
> Problem:
> ---------
> If I use the PHP mail() function after calling ini_set("SMTP",
> "my.smtp.server") and ini_set("sendmail_from", "user@my_domain"), mail
gets
> sent but the From details are set to www@<web_host_domain_name> which is
not
> what I want.
>
> I've tried using sockets and sending directly to the SMTP server, but when
I
> do RCPT TO:<user@my_domain> the server sends back 550 <user@my_domain>
> Relaying denied.
>
> The connection (HELO) and MAIL FROM commands are accepted by the mail
host.
>
> I'm not a mail guru, and only have a very basic understanding of SMTP, but
I
> would have thought that if my mail host will process messages from my web
> host, it should also process messages sent via a socket connection.
>
> I realise this is not a PHP problem, but someone else here has probably
come
> across the same thing, so it's worth a shot. :-)
>
> Any help very gratefully received.
>
> Andrew Parry
> Parrible Limited
> [EMAIL PROTECTED]
>
>
>
>
> --
> PHP Windows 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]
>






I had lots of trouble running PHP & IIS together... after a few running a
few scripts IIS would hang or crash completely.

I tried running PHP as a CGI program but then got lots of problems with
paths like "/php/php.exe/graphics/background.gif" when it should have been
"/graphics/background.gif".

I gave up in the end and installed Apache. I had some initial setting up
problems (mainly getting the paths right), but now it's perfectly stable and
I don't get any problems with it. :)

--

Matt
[EMAIL PROTECTED]
[EMAIL PROTECTED]
< www.mralston.co.uk />
"Thomas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello!
>
> As stated in many doc-sources, ISAPI hasn't the status "stable", and this
> problem could occur also on NT 4 with IIS 4. This is "simply" a crash,
which
> dragged down the WWW pub.-service (and I supoose the iisadmin) also.
>
> Till the ISAPI-module gets stable, I'd proceed in that way: run all
scripts
> in CGI-mode, and only scripts that really need ISAPI in ISAPI.
>
> Hope that helps,
> Thomas
>
>
> anderzzo wrote:
>
> > I've installed PHP on my Win2000 Server with IIS5
> > and it worked fine in a week until today!
> >
> > All I get when I try to reach a .php page is, The page can't be found!
> > In the systemlog, it says that the WWW publishing service has been
> > unexpected ended.
> > (don't know the exact translation for that :)
> >
> > Even not a simple "hello" script works!
> > Anyone knows why?
> >
> > --
> > PHP Windows 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 Windows 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]
>






Hello, I've just installed Apache and PHP, and adapted the Apache .conf 
file. Apache works, says it triomphant in my localhost, but as soon as I 
try to read a .php file in MSIE 5.5 I get a 'file not found' (404). It goes 
even so far that an index.php is not found, and I get a directory listing 
instead. I see index.php in there, but when I click on it, MSIE persists 
that the file is not found... What could be wrong?! Any pointers to related 
web content?
Thanks, Marco
www.euronet.nl/users/mbleeker

|
| Marco Bleeker, Amsterdam
| [EMAIL PROTECTED]
| http://www.euronet.nl/users/mbleeker/
|
| Attachments only after prior notice please.
| Don't put me on any kind of mailing list.
|
| I am now receiving the Snowhite virus 4x a day
| - some of you must be infected, please check !
| (No, you did not get it from me, I use Eudora)
|     __@
|   _`\<,_
|__(*)/ (*)________________Ah, op DIE fiets !





Hello, I've just installed Apache and PHP, and adapted the Apache .conf 
file. Apache works, says it triomphant in my localhost, but as soon as I 
try to read a .php file in MSIE 5.5 I get a 'file not found' (404). It goes 
even so far that an index.php is not found, and I get a directory listing 
instead. I see index.php in there, but when I click on it, MSIE persists 
that the file is not found... What could be wrong?! Any pointers to related 
web content?
Thanks, Marco
|
| Marco Bleeker, Amsterdam
| [EMAIL PROTECTED]
| http://www.euronet.nl/users/mbleeker/
|
| Attachments only after prior notice please.
| Don't put me on any kind of mailing list.
|
| I am now receiving the Snowhite virus 4x a day
| - some of you must be infected, please check !
| (No, you did not get it from me, I use Eudora)
|     __@
|   _`\<,_
|__(*)/ (*)________________Ah, op DIE fiets !






Have you tried with PHP 4.0.5 RC1 from http://php4win.de ?

There were  many COM bugs in PHP 4.0.4 and earlier.

Best of luck -- John

"Julian" <[EMAIL PROTECTED]> wrote in message
99vl70$aqu$[EMAIL PROTECTED]">news:99vl70$aqu$[EMAIL PROTECTED]...
> i did this :
>
>   $oConn = new COM("ADODB.Connection");
>   $oConn ->ConectionString = <<<<<<<<string>>>>>>>>  ;
>
>   the next command works fine:
>
>   $oConn->Execute( "insert into Paciente
> (nid,nombre,Apell1,Apell2,Sexo,NHisto,FNac) values
>
(10042,'wfcwsfvwsvcsw','ewfrewfrew','dsfdsfsf','Hombre','121219',to_date('12
> /1/1980','MM-DD-YYYY')) ");
>
>
>   but if i execute this one the php fails with an error of memory:
>
>   $oConn->Execute("insert into Peticion
>
(NID,NPet,NPac,Diagnostico,FPet,Medico,Servicio,FPetFin,nidPass,obsPet,obsIn
> f,codSer,itt) values
> (10060,'56',10040,3,to_date('29-03-2001','DD-MM-YYYY'),'Julian','urgencias
> ',to_date('12-1-2001','DD-MM-YYYY'),1,'oooo','ttt','urgencias ','vv')");
>
>
>
> if i copy into a sql tool and execute it works fine!!!!.
>
> Somebody knows why?
>
> Regards
>
>
>
> --
> PHP Windows 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]
>




Reply via email to