[PHP] eregi_replace() problems

2002-08-30 Thread Tony Harrison

Can anyone tell me why my emoticons arent appearing? Please?

Note: $message is a variable set by a form. The field `pattern` is the
string to search for, like :-), and `url` is the relative url to the
emoticon. I just get the plain text, no replacement emoticon. Note: this bit
is above the INSERT
statement in the script.
?php

$emotes = mysql_query(SELECT `pattern`,`url` FROM `emoticons`);
for ($t = 0; $t  mysql_num_rows($emotes); $t ++) {
$emotes_array = mysql_fetch_row($emotes);
eregi_replace($emotes_array[0], img src=\emoticons/$emotes_array[1]\
alt=\$emotes_array[0]\, $message);
}

?

-
[EMAIL PROTECTED]
http://www.cool-palace.com



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




Re: [PHP] eregi_replace() problems

2002-08-30 Thread Kevin Stone

The parameters to the eregi_replace() are not passed by reference.  You need
to set a variable to capture the returning value.

Read the manual..
http://www.php.net/manual/en/function.eregi-replace.php

-Kevin

- Original Message -
From: Tony Harrison [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 30, 2002 11:53 AM
Subject: [PHP] eregi_replace() problems


 Can anyone tell me why my emoticons arent appearing? Please?

 Note: $message is a variable set by a form. The field `pattern` is the
 string to search for, like :-), and `url` is the relative url to the
 emoticon. I just get the plain text, no replacement emoticon. Note: this
bit
 is above the INSERT
 statement in the script.
 ?php

 $emotes = mysql_query(SELECT `pattern`,`url` FROM `emoticons`);
 for ($t = 0; $t  mysql_num_rows($emotes); $t ++) {
 $emotes_array = mysql_fetch_row($emotes);
 eregi_replace($emotes_array[0], img src=\emoticons/$emotes_array[1]\
 alt=\$emotes_array[0]\, $message);
 }

 ?

 -
 [EMAIL PROTECTED]
 http://www.cool-palace.com



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



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




[PHP] eregi_replace() problems

2002-08-29 Thread Tony Harrison

Can anyone tell me why my emoticons arent appearing? Please?

Note: $message is a variable set by a web form. The field `pattern` is the
string to search for, like :-), and `url` is the relative url to the
emoticon. I just get the plain emoticon. Note: this bit is above the INSERT
statement in the script.
?php

$emotes = mysql_query(SELECT `pattern`,`url` FROM `emoticons`);
for ($t = 0; $t  mysql_num_rows($emotes); $t ++) {
$emotes_array = mysql_fetch_row($emotes);
eregi_replace($emotes_array[0], img src=\emoticons/$emotes_array[1]\
alt=\$emotes_array[0]\, $message);
}

?

-
[EMAIL PROTECTED]
http://www.cool-palace.com



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