Re: [PHP] [newbie] Can PHP be a security risk if it's just connecting to MySQL?

2004-05-19 Thread John W. Holmes
Dave G wrote: If that text is not properly validated and escaped, you could be open to SQL Injection attacks I'm less clear on what properly escaped means. I thought escaping was a matter of putting slashes before special characters, so that their presence doesn't confuse the SQL queries

[PHP] Re: Select box

2004-05-19 Thread \[php\]Walter
Sure! ?php $x = 'some value'; echo 'select name=uname'; $sqlu = SELECT id,user,name '; $sqlu .= FROM users '; $sqlu .= ORDER BY user ASC; $name_result = mysql_query($sqlu); while($rowu=mysql_fetch_array($name_result)){ echo 'option value=' . $rowu[user] . '';

[PHP] Re: sessions pls help

2004-05-19 Thread \[php\]Walter
Take a look at PEAR:Auth Walter Robi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I need some info about sessions in php, to clarify my knowledge and usage. So lets imagine that I am building a web site where I can log in and log off, it is without db. How do I use

[PHP] IMAP connect problem

2004-05-19 Thread Haseeb Iqbal
hi all, when i try to connect to imap server i get this and the script aborts. what should i do to fix. Certificate failure for localhost: self signed certificate: /C=US/ST=NY/L=New York/O=Courier Mail Server/OU=Automatically-generated IMAP SSL key/CN=localhost/[EMAIL PROTECTED] consider

[PHP] Fatal error help

2004-05-19 Thread robi
hello I am programing a simple chat and I am using my own classes and I get this error I have no idea what it is. pls help. Fatal error: Cannot redeclare class ch in /var/www/html/class/common.php on line 3 troby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Fatal error help

2004-05-19 Thread Haseeb Iqbal
the class you are defining is already or the file in which you have defined the class in somehow included twice.. consider using require_once for you class include file. HTH, Haseeb - Original Message - From: robi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 19, 2004 1:15

Re: [PHP] Fatal error help

2004-05-19 Thread robi
thanks it helped troby the class you are defining is already or the file in which you have defined the class in somehow included twice.. consider using require_once for you class include file. HTH, Haseeb - Original Message - From: robi [EMAIL PROTECTED] To: [EMAIL PROTECTED]

[PHP] shared memory

2004-05-19 Thread venkata ramana
Is the shared memory created with php comaptible with that created with a C program? I mean to ask, can we access the data written into shared memory by a C program from a php program? Thanks, ramana. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] shared memory

2004-05-19 Thread Burhan Khalid
venkata ramana wrote: Is the shared memory created with php comaptible with that created with a C program? I mean to ask, can we access the data written into shared memory by a C program from a php program? I would hope not, as this would cause major security problems and system instability. I

[PHP] IF statement question...

2004-05-19 Thread Tristan . Pretty
Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } * The information contained in this e-mail message is intended only for the

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } [/snip] Almost any regex function would work here, for instance $string = 1, 2, 3, 7, 8, 9; if (preg_match(/7/, $string)){ //evaluates to

Re: [PHP] IF statement question...

2004-05-19 Thread Oliver Hankeln
[EMAIL PROTECTED] wrote: Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } int strpos ( string haystack, string needle [, int offset]) is what you are looking for. HTH, Oliver Hankeln -- PHP General

RE: [PHP] IF statement question...

2004-05-19 Thread Ford, Mike [LSS]
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 19 May 2004 12:55 Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } if (strpos($string,

Re: [PHP] IF statement question...

2004-05-19 Thread Oliver Hankeln
Jay Blanchard wrote: [snip] Is it possible to request that a string CONTAINS another string...? EG: $string = 1, 2, 3, 7, 8, 9; if ($string CONTAINS 7) { // Do stuff } [/snip] Almost any regex function would work here, for instance $string = 1, 2, 3, 7, 8, 9; if (preg_match(/7/, $string)){

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] Tipp: Do not use preg_match() if you only want to check if one string is contained in another string. Use strpos() or strstr() instead as they will be faster. [/snip] This brings up a good point. Just exactly how much faster would one be over another in this small example? How big

Re: [PHP] IF statement question...

2004-05-19 Thread Oliver Hankeln
Jay Blanchard wrote: [snip] Tipp: Do not use preg_match() if you only want to check if one string is contained in another string. Use strpos() or strstr() instead as they will be faster. [/snip] This brings up a good point. Just exactly how much faster would one be over another in this small

[PHP] Distance and info

2004-05-19 Thread Brent Clark
Hi all I have a question regarding phpclasses.org. There is a section, where is says, Find the closest mirror. My question is, does anyone know how do they determine the distance (Sits on the right of the screen) and also the details for Your approximate location. Cause its pretty acurrate.

[PHP] Re: Distance and info

2004-05-19 Thread Craig
Probably useing something like this, not altogether sure. http://www.maxmind.com/geoip/ Brent Clark [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all I have a question regarding phpclasses.org. There is a section, where is says, Find the closest mirror. My question is, does

Re: [PHP] shared memory

2004-05-19 Thread venkata ramana
Thanks for your reply, but I afraid you did not get my point. I am talking about shared memory that is used for Interprocess communication. We can access the shared memory created by one C program in other C program and same is the case with php. I am trying to communicate with a C program from

Re: [PHP] Distance and info

2004-05-19 Thread John Nichel
Brent Clark wrote: Hi all I have a question regarding phpclasses.org. There is a section, where is says, Find the closest mirror. My question is, does anyone know how do they determine the distance (Sits on the right of the screen) and also the details for Your approximate location. Cause its

Re: [PHP] IF statement question...

2004-05-19 Thread Curt Zirzow
* Thus wrote Oliver Hankeln ([EMAIL PROTECTED]): Jay Blanchard wrote: [snip] Tipp: Do not use preg_match() if you only want to check if one string is contained in another string. Use strpos() or strstr() instead as they will be faster. [/snip] This brings up a good point. Just

Re: [PHP] IF statement question...

2004-05-19 Thread Oliver Hankeln
Curt Zirzow wrote: * Thus wrote Oliver Hankeln ([EMAIL PROTECTED]): 10 Searches in a rather small string took 0.38s with strpos() and 0.55s with preg_match() Make sure your benchmarks aren't bias: - assignment takes time - concating string takes time You are right. I updated the script

Re: [PHP] IF statement question...

2004-05-19 Thread Tristan . Pretty
If I'm being Dumb, I apologies... but When using this: $row[bands] = 1,2,3,4,5,6,7,8; $row2[id] = 7; if (strpos($row[bands], $row2[id]) != FALSE) { // do stuff } I get the No 13 (as it's inthe 13th place in the string) as my result. Now I'm aware that it should work, as it's not

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] If I'm being Dumb, I apologies... but When using this: $row[bands] = 1,2,3,4,5,6,7,8; $row2[id] = 7; if (strpos($row[bands], $row2[id]) != FALSE) { // do stuff } [/snip] What is the expected output? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Date Function - Empty Value

2004-05-19 Thread Gabe
Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format ( m/d/ ). For some reason it won't let me post an empty value to that field in the DB. I've tried using empty quotes ( ) or NULL and I always get a datatype mismatch sql

Re: [PHP] IF statement question...

2004-05-19 Thread John Nichel
Curt Zirzow wrote: Make sure your benchmarks aren't bias: - assignment takes time - concating string takes time strpos($haystack,$needle); v.s. preg_match($regex,$haystack); Just for shits and giggles (and because it's a slow work day), the below script output this... strpos() :

Re: [PHP] executing php scripts via cron

2004-05-19 Thread raditha dissanayake
Merlin wrote: Hi there, I am trying to run a php script via cron. Problem is, that it does not work if I include the whole path in crontab Currently it looks like: 0 6 * * * php /home/www/project/app_cron/follow_up_new_members.php /dev/null does typing in php

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] strpos() : 0.18918436765671 preg_match() : 0.26665662288666 [/snip] 1/3rd of a second slowerinteresting. You know what though, my original assertion is correctalmost any of the regex functions will work. Tristan, why not convert the string to an array and then use in_array()?

RE: [PHP] IF statement question...

2004-05-19 Thread Ford, Mike [LSS]
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 19 May 2004 15:47 If I'm being Dumb, I apologies... but When using this: $row[bands] = 1,2,3,4,5,6,7,8; $row2[id] = 7; if (strpos($row[bands], $row2[id]) != FALSE) { // do stuff } I get

RE: [PHP] IF statement question...

2004-05-19 Thread Michael Sims
Jay Blanchard wrote: [snip] strpos() : 0.18918436765671 preg_match() : 0.26665662288666 [/snip] 1/3rd of a second slowerinteresting. You know what though, my original assertion is correctalmost any of the regex functions will work. Personally, I prefer using preg_match() 9 times

Re: [PHP] IF statement question...

2004-05-19 Thread John Nichel
Jay Blanchard wrote: [snip] strpos() : 0.18918436765671 preg_match() : 0.26665662288666 [/snip] 1/3rd of a second slowerinteresting. You know what though, my original assertion is correctalmost any of the regex functions will work. Tristan, why not convert the string to an array and then

Re: [PHP] Problem - Turckmmcache, Apache2 and SuSE 9.1

2004-05-19 Thread raditha dissanayake
Perhaps you might want to try an mmcache list. Andrei Verovski (aka MacGuru) wrote: Hi, I have compiled and installed (precisely following instruction) turck-mmcache 2.4.6 for Apache2-2.0.49-23/php4-4.3.4-43.3 on SuSE 9.1. Unfortunately, I cannot start Apapche2 anymore, I am getting this error

Re: [PHP] IMAP connect problem

2004-05-19 Thread raditha dissanayake
Hi, Haseeb Iqbal wrote: hi all, when i try to connect to imap server i get this and the script aborts. what should i do to fix. Certificate failure for localhost: self signed certificate: /C=US/ST=NY/L=New York/O=Courier Mail Server/OU=Automatically-generated IMAP SSL key/CN=localhost/[EMAIL

[PHP] Problem - Turckmmcache, Apache2 and SuSE 9.1

2004-05-19 Thread Andrei Verovski (aka MacGuru)
Hi, I have compiled and installed (precisely following instruction) turck-mmcache 2.4.6 for Apache2-2.0.49-23/php4-4.3.4-43.3 on SuSE 9.1. Unfortunately, I cannot start Apapche2 anymore, I am getting this error message: /usr/sbin/httpd2-prefork: error while loading shared libraries:

Re: [PHP] IF statement question...

2004-05-19 Thread John Nichel
John Nichel wrote: Jay Blanchard wrote: [snip] strpos() : 0.18918436765671 preg_match() : 0.26665662288666 [/snip] 1/3rd of a second slowerinteresting. You know what though, my original assertion is correctalmost any of the regex functions will work. Tristan, why not convert the string to

RE: [PHP] IF statement question...

2004-05-19 Thread Jay Blanchard
[snip] strpos() : 0.19018315076828 preg_match() : 0.26157474517822 in_array() : 0.26403407096863 [/snip] Very interesting...thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Lista en Espanol?

2004-05-19 Thread Lucas Passalacqua
Hole, queria saber si alguien conoce alguna lista en espanol sobre PHP. Gracias! -Mensaje original- De: raditha dissanayake [mailto:[EMAIL PROTECTED] Enviado el: miercoles, 19 de mayo de 2004 13:10 Para: Haseeb Iqbal CC: [EMAIL PROTECTED] Asunto: Re: [PHP] IMAP connect problem Hi,

Re: [PHP] Lista en Espanol?

2004-05-19 Thread James Kaufman
On Wed, May 19, 2004 at 02:02:37PM -0300, Lucas Passalacqua wrote: Hole, queria saber si alguien conoce alguna lista en espanol sobre PHP. Gracias! Start with http:///www.php.net/mailing-lists.php and look for Spanish PHP Mailing List. -- Jim Kaufman Linux Evangelist public key

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Torsten Roehr
Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format ( m/d/ ). For some reason it won't let me post an empty value to that field in the DB. I've tried

Re: [PHP] IMAP connect problem

2004-05-19 Thread Haseeb Iqbal
i am using standard port 143. - Original Message - From: raditha dissanayake [EMAIL PROTECTED] To: Haseeb Iqbal [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, May 19, 2004 9:10 PM Subject: Re: [PHP] IMAP connect problem Hi, Haseeb Iqbal wrote: hi all, when i try to

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Gabe
Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format ( m/d/ ). For some reason it won't let me post an empty value to that field in the DB.

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Matt Matijevich
[snip] Well, I would, but I can't seem to figure out how to export just the structure out of access. Wouldn't NULL be allowed by default? [/snip] Do you have access to the mdb file? If you do you can just go into design view of the table to find out the data definitions. -- PHP General

Re: [PHP] Re: Date Function - Empty Value

2004-05-19 Thread Gabe
Matt Matijevich wrote: [snip] Well, I would, but I can't seem to figure out how to export just the structure out of access. Wouldn't NULL be allowed by default? [/snip] Do you have access to the mdb file? If you do you can just go into design view of the table to find out the data definitions.

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Torsten Roehr
Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Environment: PHP 4.3.6 Access DB W2K IIS 5

[PHP] Re: How to use pcntl_fork()?

2004-05-19 Thread Ben Ramsey
Does no one know how to use pcntl_fork(), then? ;-) Ben Ramsey wrote: I'm working with PHP-GTK to create a GUI application. This GUI application opens a socket to a gaming server to send/receive data to display to the user. So far, this is working well, but the problem is that it can only

RE: [PHP] Text/Image Streaming in PHP for a web chat application

2004-05-19 Thread Vail, Warren
I had a problem that I think might be similar to what you are struggling with and solved it by causing the browser to drive the push (or in this case more like a pull). The main page was sent with an imbedded frame and other controls to allow the user to type in his real-time responses and a

[PHP] Text/Image Streaming in PHP for a web chat application

2004-05-19 Thread Stephen Lake
Hey all, After reviewing all the scripts written for a web chat application at the various sites (ie Hotscripts, cgi resource and so on) I have resorted to writing my own as none available fit my specific requirements. What I need to know is, how can I implement a server push alternative and/or

Re: [PHP] Text/Image Streaming in PHP for a web chat application

2004-05-19 Thread John Nichel
Stephen Lake wrote: Hey all, After reviewing all the scripts written for a web chat application at the various sites (ie Hotscripts, cgi resource and so on) I have resorted to writing my own as none available fit my specific requirements. What I need to know is, how can I implement a server push

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Gabe
Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format (

[PHP] Re: Date Function - Empty Value

2004-05-19 Thread Torsten Roehr
Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Torsten Roehr wrote: Gabe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Environment: PHP 4.3.6 Access DB W2K IIS 5 I'm trying to store a date in a date/time field using the short date format ( m/d/ ).

Re: [PHP] IF statement question...

2004-05-19 Thread Curt Zirzow
* Thus wrote Jay Blanchard ([EMAIL PROTECTED]): [snip] strpos() : 0.19018315076828 preg_match() : 0.26157474517822 in_array() : 0.26403407096863 [/snip] Very interesting...thanks! So if we're not going to search though a string 10,000 times you'll save ~0.07139159440994 seconds. or

[PHP] Re: Distance and info

2004-05-19 Thread Manuel Lemos
Hello, On 05/19/2004 09:51 AM, Brent Clark wrote: I have a question regarding phpclasses.org. There is a section, where is says, Find the closest mirror. My question is, does anyone know how do they determine the distance (Sits on the right of the screen) and also the details for Your approximate

Re: [PHP] Constant questions

2004-05-19 Thread Don Read
On 12-May-2004 René Fournier wrote: Hi, I have two questions involving Constants. 1. I want to refer to a refer to a Constant by its value (which is unique), and return its name. E.g.,: define (SEND_DS,1); define (SEND_DS_ACK,2); define (RESEND_DS,3); define

Re: [PHP] Best way to do Last 3 Items Viewed

2004-05-19 Thread Don Read
On 14-May-2004 Chuck Barnett wrote: Anyone have any code snippits that would allow me to do a Last 3 Items Viewed like on ebay? array_unshift($items, $new); $items = array_slice($items, 0, 3)); Regards, -- Don Read [EMAIL PROTECTED] -- It's always

Re: [PHP] create if table not exists

2004-05-19 Thread Don Read
On 17-May-2004 John Taylor-Johnston wrote: How can I check if a table exists in a mysql db. function tableexists($tbl) { $res = @mysql_query(SELECT COUNT(*) FROM $tbl); return ($res ? true : false); } Regards, -- Don Read [EMAIL PROTECTED] -- It's

Re: [PHP] Multiple Update from one form

2004-05-19 Thread Don Read
On 18-May-2004 Miles Thompson wrote: This is close to your situation, but I only needed a one dimensional array for a bulk delete. So the form part has this line: print( 'input type=checkbox name=chkdelete[] value=' . $myrow['sub_key'] . ''); There's no need for a subscript in