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
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] . '';
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
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
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:
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
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]
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:
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
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
[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
[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
-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,
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)){
[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
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
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.
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
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
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
* 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
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
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
[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:
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
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() :
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
[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()?
-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
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
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
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
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
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:
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
[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
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,
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
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
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
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.
[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
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.
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
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
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
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
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
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 (
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/ ).
* 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
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
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
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
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
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
56 matches
Mail list logo