On 03/11/06, Richard Lynch [EMAIL PROTECTED] wrote:
On Fri, November 3, 2006 5:30 am, Dotan Cohen wrote:
To all others who took part in this thread: I was unclear on another
point as well, the issue of sql-injection. As I'm removing the
symbols, signs, and other non-alpha characters from the
On 31/10/06, Larry Garfield [EMAIL PROTECTED] wrote:
From your original message, it sounds like you want to strip selected complete
words, not substrings, from a string for indexing or searching or such.
Right?
I think that was my mistake- not differentiating between the two.
Symbols and such
# [EMAIL PROTECTED] / 2006-10-30 21:18:33 +:
Dotan Cohen wrote:
$searchQuery=str_replace( ^.$noiseArray.$, , $searchQuery);
Ok, this is what the compiler will see...
$searchQuery=str_replace(^Array$, , $searchQuery);
Yes, that's a literal Array in the string. You cannot, and you
On Fri, November 3, 2006 5:30 am, Dotan Cohen wrote:
To all others who took part in this thread: I was unclear on another
point as well, the issue of sql-injection. As I'm removing the
symbols, signs, and other non-alpha characters from the query, I
expect it to be sql-injection proof. As I
Dotan Cohen wrote:
I need to remove the noise words from a search string. I can't seem to
get str_replace to go through the array and remove the words, and I'd
rather avoid a redundant foreach it I can. According to TFM
str_replace should automatically go through the whole array, no? Does
Dotan Cohen wrote:
I need to remove the noise words from a search string. I can't seem to
get str_replace to go through the array and remove the words, and I'd
rather avoid a redundant foreach it I can. According to TFM
str_replace should automatically go through the whole array, no? Does
It looks like you guys are coming up with some cool solutions, but I
have a question. Wasn't the original purpose of this thread to
prevent sql injection attacks in input from user forms? If so,
wouldn't mysql_real_escape_string be an easier solution?
On Oct 30, 2006, at 8:17 AM,
Ed Lazor wrote:
It looks like you guys are coming up with some cool solutions, but I
have a question. Wasn't the original purpose of this thread to
prevent sql injection attacks in input from user forms? If so,
wouldn't mysql_real_escape_string be an easier solution?
Me thinkie nottie.
On 30/10/06, Stut [EMAIL PROTECTED] wrote:
Ed Lazor wrote:
It looks like you guys are coming up with some cool solutions, but I
have a question. Wasn't the original purpose of this thread to
prevent sql injection attacks in input from user forms? If so,
wouldn't mysql_real_escape_string be
Dotan Cohen wrote:
Er, so how would it be done? I've been trying for two days now with no
success.
Ok, I guess my original reply didn't get through, or you ignored it.
Here it is again for your convenience.
Dotan Cohen wrote:
$searchQuery=str_replace( ^.$noiseArray.$, , $searchQuery);
Ok,
On Oct 30, 2006, at 9:19 AM, Stut wrote:
Ed Lazor wrote:
It looks like you guys are coming up with some cool solutions, but
I have a question. Wasn't the original purpose of this thread to
prevent sql injection attacks in input from user forms? If so,
wouldn't mysql_real_escape_string
On Monday 30 October 2006 15:10, Dotan Cohen wrote:
Er, so how would it be done? I've been trying for two days now with no
success.
From your original message, it sounds like you want to strip selected complete
words, not substrings, from a string for indexing or searching or such.
Right?
On Oct 30, 2006, at 1:10 PM, Dotan Cohen wrote:
On 30/10/06, Stut [EMAIL PROTECTED] wrote:
Ed Lazor wrote:
It looks like you guys are coming up with some cool solutions,
but I
have a question. Wasn't the original purpose of this thread to
prevent sql injection attacks in input from
I need to remove the noise words from a search string. I can't seem to
get str_replace to go through the array and remove the words, and I'd
rather avoid a redundant foreach it I can. According to TFM
str_replace should automatically go through the whole array, no? Does
anybody see anything wrong
Yes you need to put some \ in front of some of those characters
On Sunday 29 October 2006 21:05, Dotan Cohen wrote:
I need to remove the noise words from a search string. I can't seem to
get str_replace to go through the array and remove the words, and I'd
rather avoid a redundant foreach it I
On 29/10/06, Alan Milnes [EMAIL PROTECTED] wrote:
Dotan Cohen wrote:
$searchQuery=str_replace( ^.$noiseArray.$, , $searchQuery);
Can you explain what you are trying to do with the ^ and $? What is a
typical value of the original $searchQuery?
Alan
The purpose of the ^ and the $ is to
At 10/29/2006 01:07 PM, Dotan Cohen wrote:
The purpose of the ^ and the $ is to define the beginning and the
end of a word:
http://il2.php.net/regex
No, actually, ^ and $ define the beginnning end of the entire
expression being searched, not the boundaries of a single
word. Therefore
I never use this function, since I always use regular expressions, but
according to the manual:
If you don't need fancy replacing rules (like regular
expressions), you should always use this function instead of
ereg_replace() or preg_replace().
So, I assume your
Paul Novitski wrote:
If you go this route, perhaps you could enclose each member of your
original array in \b word boundary sequences using an array_walk
routine so that you don't have to muddy your original array
declaration statement.
IIRC str_replace() does not interpret or understand
Dotan Cohen wrote:
$searchQuery=str_replace( ^.$noiseArray.$, , $searchQuery);
Ok, this is what the compiler will see...
$searchQuery=str_replace(^Array$, , $searchQuery);
Yes, that's a literal Array in the string. You cannot, and you should
remember this, you cannot concatenate strings and
On 29/10/06, Børge Holen [EMAIL PROTECTED] wrote:
Yes you need to put some \ in front of some of those characters
On Sunday 29 October 2006 21:05, Dotan Cohen wrote:
I need to remove the noise words from a search string. I can't seem to
get str_replace to go through the array and remove the
Paul Novitski wrote:
If you go this route, perhaps you could enclose each member of your
original array in \b word boundary sequences using an array_walk
routine so that you don't have to muddy your original array
declaration statement.
At 10/29/2006 01:54 PM, rich gray wrote:
IIRC
Thanks all for the heads up with the str_replace not working with
regexes. Duh! I've switched to preg_replace, but still no luck. (nor
skill, on my part)
I'm trying to use array_walk to go through the array and deliminate
each item with /b so that the preg_replace function will know to only
Dotan Cohen wrote:
Thanks all for the heads up with the str_replace not working with
regexes. Duh! I've switched to preg_replace, but still no luck. (nor
skill, on my part)
I'm trying to use array_walk to go through the array and deliminate
each item with /b so that the preg_replace
On 30/10/06, Paul Novitski [EMAIL PROTECTED] wrote:
Hi Dotan,
To get help with your problem, share more of your PHP code with the
list so we can look at what you're doing.
Also, give us a link to the PHP script on your server so we can see the output.
Regards,
Paul
Nothing else is
checkout the function mysql_real_escape_string()
On Oct 29, 2006, at 3:13 PM, Dotan Cohen wrote:
On 30/10/06, Paul Novitski [EMAIL PROTECTED] wrote:
Hi Dotan,
To get help with your problem, share more of your PHP code with the
list so we can look at what you're doing.
Also, give us a link
26 matches
Mail list logo