[PHP] "writing" a backspace or del char in a file

2003-01-24 Thread ng
Hi

i want to erease 'one' or more caracters in a file, so, if this file is too
big ( >10MB ) i don't want to read entirely it to substr(); the last line and
entirely re-write it...

i like to write -at the end by exemple- the char backspace ( 0x08 )
ex :


but this simply add the char "backspace" at the end and doesn't delete it !
the same problem appears with the character 127 ( delete ).

i don't really know if that i want is possible ( perhaps with direct i/o
methods ? )
so, please show me the way :)



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




Re: [PHP] regexps

2003-01-28 Thread ng
>using any of the string functions on the output would ofcourse
> cause a performance drawback (do you agree with me?), i had
> used a combination of string functions to do instead of regexps,
> which one will be faster as you think ?

Hi,

i made some basic bench and see that it really depends...

try to make some basic search like ^[0-9]{1,4}$
how can u do this ? with substr, strlen, strstr and ifthenelse ?
i found really faster to use preg_match(), which is really faster
than if (ereg())...



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




[PHP] Re: Remembering which option in a SELECT tag the user had chosen

2003-01-29 Thread ng
hi

smarty ( and pear ? ) provide some interresant function
http://smarty.php.net/manual/en/language.function.html.options.php


on my own scripts i have somthing like :

exemple :
   
>a
>b
>c
   
or :

%1\$s\n",$value,bool($_POST['foo'],$value,'s'));
} ?>

( sorry for the long code )



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




[PHP] Re: Super Globals

2003-03-21 Thread ng
Hi,

>>If I turn register_global on and print $QUERY_STRING it works,
>> but it wont if I print $_SERVER['QUERY_STRING'].
>> I'm on XP/PHP 4.0.6.

the super globals arrays are availables from PHP 4.1.0 i think, no ?
before this version your should use $HTTP_SERVER_VARS['QUERY_STRING']

upgrade your PHP version :)
a lot of parallels projects exists for windows, i use easyphp (
http://www.easyphp.org/ )

regards



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



Re: [PHP] multiline text areas and mysql doesn't work :(

2001-05-13 Thread Keith Ng

In reply to [EMAIL PROTECTED]:

> Return-Path: <[EMAIL PROTECTED]>
> Received: from toye.php.net (va.php.net [198.186.203.51])
> by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4DGDXZ25935
> for <[EMAIL PROTECTED]>; Mon, 14 May 2001 00:13:39 +0800
> Received: (qmail 12864 invoked by uid 1013); 13 May 2001 16:15:49 -
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> list-help: <mailto:[EMAIL PROTECTED]>
> list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> list-post: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> Received: (qmail 12848 invoked by uid 9); 13 May 2001 16:15:49 -
> To: [EMAIL PROTECTED]
> From: "Ciaron Nixon" <[EMAIL PROTECTED]>
> Date: Sun, 13 May 2001 17:22:28 +0100
> Lines: 9
> Message-ID: <9dmbvl$chc$[EMAIL PROTECTED]>
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
> Subject: [PHP] multiline text areas and mysql doesn't work :(
> X-UIDL: ;GH!!Oa4!!_P6"!Z&K!!

> I'm trying to insert the conents of a submitted textarea into a field of a
> db but it seems to be stripping the control characters or not fomatting them
> properly. The record updates fine but when I display it all the newlines are
> gone ie the whole field appears on 1 line.
> Any ideas how to get it to store the control chars?

> -Ciaron




Use nl2br() to format the display properly in HTML.
Goto www.php.net/nl2br for more info.

So this would work well:



Updating the record works because you probably did something like this:




Regards,
Keith Ng
___
Co-founder
K-Designs Incorporated
[EMAIL PROTECTED]

http://www.k-designs.com.sg/


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

2001-05-16 Thread Keith Ng

Hi all,

With regards to the PDF library, I'm wondering if there are any
generators that generate the code for the pdf document instead of
manually hard-coding everything. Or is there an easy way out by
converting an already designed pdf document into the code which pdflib
recognises?

Thanks very much.


Regards,
Keith Ng
___
Senior Web Developer
K-Systems & Services
[EMAIL PROTECTED]

http://www.k-systems.com.sg/


-- 
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 can I enable magic_quotes_gpc without editing PHP.ini

2001-05-16 Thread Keith Ng

In reply to [EMAIL PROTECTED]:

> Return-Path: <[EMAIL PROTECTED]>
> Received: from toye.php.net (va.php.net [198.186.203.51])
> by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4GEsVZ09896
> for <[EMAIL PROTECTED]>; Wed, 16 May 2001 22:54:31 +0800
> Received: (qmail 7963 invoked by uid 1013); 16 May 2001 14:57:06 -
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> list-help: <mailto:[EMAIL PROTECTED]>
> list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> list-post: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> Received: (qmail 7957 invoked from network); 16 May 2001 14:57:06 -
> Reply-To: <[EMAIL PROTECTED]>
> From: "SED" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Date: Wed, 16 May 2001 15:00:23 -
> Message-ID: <[EMAIL PROTECTED]>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
> X-Priority: 3 (Normal)
> X-MSMail-Priority: Normal
> X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
> In-Reply-To: <9du3pi$te4$[EMAIL PROTECTED]>
> Importance: Normal
> Subject: [PHP] How can I enable magic_quotes_gpc without editing PHP.ini
> X-UIDL: BlS"!FI`"!LJI"!a2_!!

> Hi,

> I need to enable magic_quotes_qpc for one session (or a script) but I can no
> access to the php.ini on the server. Is it possible to do it? And if so,
> how?

> Regards,
> Sumarlidi Einar Dadason

> SED - Graphic Design

> --
> Phone:   (+354) 4615501
> Mobile:  (+354) 8960376
> Fax: (+354) 4615503
> E-mail:  [EMAIL PROTECTED]
> Homepage:www.sed.is <- New Homepage!
> --



set_magic_quotes_runtime();


Regards,
Keith Ng
___
Co-founder
K-Designs Incorporated
[EMAIL PROTECTED]

http://www.k-designs.com.sg/


-- 
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] Barcode in PDF.

2001-05-17 Thread Keith Ng

Hi,

Does anyone know how to go about drawing a barcode in PDFLIB?

Regards,
Keith Ng
___
Co-founder
K-Designs Incorporated
[EMAIL PROTECTED]

http://www.k-designs.com.sg/


-- 
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] Parse error..help!

2001-05-18 Thread Keith Ng

In reply to [EMAIL PROTECTED]:

> Return-Path: <[EMAIL PROTECTED]>
> Received: from toye.php.net (va.php.net [198.186.203.51])
> by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4IDicZ30638
> for <[EMAIL PROTECTED]>; Fri, 18 May 2001 21:44:39 +0800
> Received: (qmail 23365 invoked by uid 1013); 18 May 2001 13:47:20 -
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> list-help: <mailto:[EMAIL PROTECTED]>
> list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> list-post: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> Received: (qmail 23359 invoked from network); 18 May 2001 13:47:20 -
> Reply-To: <[EMAIL PROTECTED]>
> From: "Taline Makssabo" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Date: Fri, 18 May 2001 09:49:35 -0400
> Message-ID: <[EMAIL PROTECTED]>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
> X-Priority: 3 (Normal)
> X-MSMail-Priority: Normal
> X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
> Importance: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
> Subject: [PHP] Parse error..help!
> X-UIDL: #l6"!fL$#!:Bj"!n1f!!

> Here is another error i keep on getting, this is suppose to send me an email
> each time someone enters in my website but i keep on gettong this error
> message:



> Parse error: parse error in
> /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8
> I don't see anything wrong, please help.



>  SetLogging(1);

> Function AccessHit
> (

> $NL = (\n);


> $H = getLastHost();


> $R = getLastRef();

> $To = "[EMAIL PROTECTED]";


> $Sub = "Page Accessed";


> $D = Date("D d M y h:ia",time());

> $Msg = $H + $NL + $R + $NL + $D;

> mail($To,$Sub,$Msg);
> );
> AccessHit();

?>>

$NL = (\n)?

It should be $NL = "\n";


Regards,
Keith Ng
___
Co-founder
K-Designs Incorporated
[EMAIL PROTECTED]

http://www.k-designs.com.sg/


-- 
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] Parse error..help!

2001-05-18 Thread Keith Ng

In reply to [EMAIL PROTECTED]:

> Return-Path: <[EMAIL PROTECTED]>
> Received: from toye.php.net (va.php.net [198.186.203.51])
> by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4IDicZ30638
> for <[EMAIL PROTECTED]>; Fri, 18 May 2001 21:44:39 +0800
> Received: (qmail 23365 invoked by uid 1013); 18 May 2001 13:47:20 -
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Precedence: bulk
> list-help: <mailto:[EMAIL PROTECTED]>
> list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> list-post: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> Received: (qmail 23359 invoked from network); 18 May 2001 13:47:20 -
> Reply-To: <[EMAIL PROTECTED]>
> From: "Taline Makssabo" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Date: Fri, 18 May 2001 09:49:35 -0400
> Message-ID: <[EMAIL PROTECTED]>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
> X-Priority: 3 (Normal)
> X-MSMail-Priority: Normal
> X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
> Importance: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
> Subject: [PHP] Parse error..help!
> X-UIDL: #l6"!fL$#!:Bj"!n1f!!

> Here is another error i keep on getting, this is suppose to send me an email
> each time someone enters in my website but i keep on gettong this error
> message:



> Parse error: parse error in
> /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8
> I don't see anything wrong, please help.



>  SetLogging(1);

> Function AccessHit
> (

> $NL = (\n);


> $H = getLastHost();


> $R = getLastRef();

> $To = "[EMAIL PROTECTED]";


> $Sub = "Page Accessed";


> $D = Date("D d M y h:ia",time());

> $Msg = $H + $NL + $R + $NL + $D;

> mail($To,$Sub,$Msg);
> );
> AccessHit();

?>>

Right... so all in all the code should be:

---

---

Regards,
Keith Ng
___
Co-founder
K-Designs Incorporated
[EMAIL PROTECTED]

http://www.k-designs.com.sg/


-- 
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] please help!!

2002-05-25 Thread Jolly Ng

Hi Hi,

php + apache + win2000
or 
php + IIS + win2000
I don't know why my setting do not allow me to POST or GET variable which submit in 
html 
Please help!!!

Jolly



[PHP] monitoring more than two sockets (multitask ?)

2001-07-24 Thread Keith Ng

Hello,

I have a simple question.
How do I monitor two or more sockets in PHP?

Someone told me about register_tick_function() for multi tasking but I
played with it and nothing seems to come out of it.

I monitored the first opened socket using a while() loop containing a
fgets() function.


-- 
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] Hack on Server.

2001-07-20 Thread Ng Hak Beng

Hi!
 Not sure if it the same one, there's a new IIS exploit that'll 
change the main page.but only in memory.  It's known as Code Red Worm 
at the cert.org site.

 I noticed it after I had lots of weird requests in my httpd logs 
for about 8 hours last night (+800) which I thought was a buffer overflow 
attempt

 Check the url for more info

  http://www.cert.org/advisories/CA-2001-19.html

Hak Beng




At 04:59 20/07/2001, I noticed a mail from Jean-Francois Jauvin:
>Hi, my server with php on it has been "hacked" or something., what
>appened is every PHP pages displayed a certain message like "Hacked by blah
>blah blah...".
>None of the HTML pages were affected, only the PHP ones
>but the scripts were not altered, I've shut down IIS,  reinstalled PHP, and
>everything is back to normal... kinda strange.
>Did anyone had a similar problem...
>
>Thanks
>
>JF
>
>
>
>--
>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] How to Retrieve All Selected Values of CheckBox Group in Form?

2001-09-12 Thread Hon-Chi Ng

Hi

How I read the all values selected for checkboxes of same name that are
submitted to HTML form?

I tried to translate the example on CGI.pm homepage to PHP below.

  
What's your name? 

What's the combination?

eenie
meenie
minie
moe



  
  
  
  Your name is 
  
  The keywords are 
  

Echoing the value of $words in PHP always display the last one only,
regardless of the number of choices for "words" checkboxes have been
selected.

On the other hand, if param('words') is used with CGI.pm, it displays all
the selections for "words" checkboxes.


FYI, below are some of info displayed by the phpinfo().

  Version: 4.0.6
  System: SunOS 5.7
  Configure Command: './configure' '--with-apache=../apache_1.3.20' '--enable-ftp' -- 
enable-versioning' --enable-track-vars'
  Server API: Apache
  Virtual Directory Support: disabled
  ZEND_DEBUG: disabled
  Thread Safety: disabled


Thanks.  I'm new to PHP, and any specific and detail explanations are
appreciated.

Regards
Hon-Chi



--== Sent via Deja.com ==--
http://www.deja.com/

-- 
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 connect used to work PLUS errors not displaying

2007-08-24 Thread Linux NG/Lists
I swear, it was just working last week! Well, a while ago, on another 
machine. You get the idea. Here's the deal...


PHP 5.1.6 and MySQL 5.x on FC6 fully patched.

1. A simple page with a call to phpinfo() works fine.

2. A barely more complicated page also works fine, in that it throws an 
expected error:




returns

Notice: Use of undefined constant dsjdlfjsldfjs - assumed 
'dsjdlfjsldfjs' in index.php on line 22.


(thanks to another message that suggested adding the calls directly into 
the page when error reporting in php.ini seems to be ignored).


Then the phpinfo data displays.

3. BUT, a call to a MySQL database:



results in a blank page. No errors, no warnings, no nothing. I have 
confirmed through the Query Browser that the credentials passed are good 
and result in access to the test database on localhost.


So two things seem broken:

a) The connect doesn't work. I have done this oodles of times before, 
although not on this particular machine. I'm thinking there's a config 
issue with mysqli but I dunno what. The config from phpinfo is below.


b) Why does the error reporting NOT work as soon as I jam a $db new 
mysql call into the code?


Thanks,
Whil

phpinfo() reports this configure script:

'./configure' '--build=i686-redhat-linux-gnu' 
'--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' 
'--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' 
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' 
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' 
'--libexecdir=/usr/libexec' '--localstatedir=/var' 
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man' 
'--infodir=/usr/share/info' '--cache-file=../config.cache' 
'--with-libdir=lib' '--with-config-file-path=/etc' 
'--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' 
'--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' 
'--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' 
'--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' 
'--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' 
'--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' 
'--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' 
'--enable-exif' '--enable-ftp' '--enable-magic-quotes' 
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' 
'--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' 
'--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' 
'--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' 
'--enable-calendar' '--enable-dbx' '--enable-dio' 
'--with-mime-magic=/usr/share/file/magic' '--without-sqlite' 
'--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' 
'--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' 
'--disable-dba' '--without-unixODBC' '--disable-pdo' 
'--disable-xmlreader' '--disable-xmlwriter'


// end

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



Re: [PHP] MySQL connect used to work PLUS errors not displaying

2007-08-24 Thread Linux NG/Lists

comex wrote:

On 8/24/07, Linux NG/Lists <[EMAIL PROTECTED]> wrote:


b) Why does the error reporting NOT work as soon as I jam a $db new
mysql call into the code?

Because you disabled it with an '@'.




Well, I suppose I should say "Doh!" but even when I get rid of the 
"@", I still get a blank page - no errors, and no database, either!


Whil

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



Re: [PHP] MySQL connect used to work PLUS errors not displaying

2007-08-24 Thread Linux NG/Lists


Well, I suppose I should say "Doh!" but even when I get rid of the 
"@", I still get a blank page - no errors, and no database, either!


A followup - I'm taking this over to PHP-DB since it's now 
database-centric, I think.


This still fails:
  $db = new mysqli(

But this works
  $conn = mysqli(...

See you on that list.

Whil

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



[PHP] Time in php problem....

2001-02-12 Thread Ng Kok Chun

hi... i need some help...

currently i doing web base programming ( econsultant )using php, apache and mysql as 
well... now i facing a problem which i need :
1) get time when consultant log on
2) get time when consultant log off
3) calculate how long for the specified consultant been log on to the web
4) accumulate all the time everyday
5) then multiple accumulate with working rate ( X ).
6.) finally output to web ( html form )

pls help !
thanks !



[PHP] Asking Sth about PHP

2001-02-20 Thread Ng Chun Chi

Dear Sir, 
I have two problems in using PHP. Could you help me? 
I am using Red-Hat to build up my System. 
Could I use Perl to control some PHP program? 
Also, could I run my PHP program in Linux Console? 

Sorry to disturb you 
THx! 
Mr Ng

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