Wrong parameter count for str_replace()

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
dunrite67
Posts: 12
Joined: Thu Mar 16, 2006 9:35 pm

Wrong parameter count for str_replace()

Post by dunrite67 »

I thought everything was working fine, but then this morning I was checking out my faq and when I click on one of the top ten on the right I get this message

Warning: Wrong parameter count for str_replace() in /hsphere/local/home/s98iu43y/parishnow.com/Members/faq/inc/functions.php on line 881

Warning: Wrong parameter count for str_replace() in /hsphere/local/home/s98iu43y/parishnow.com/Members/faq/inc/functions.php on line 881
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

can you post your phpMyFAQ version and the record titles in your Top10?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dunrite67
Posts: 12
Joined: Thu Mar 16, 2006 9:35 pm

Post by dunrite67 »

I remembered I changed the function for email yesterday the one to avoid spam, so I put the original functions.php back up and the error is gone, swith back to the one with changed email function and the error comes back, but I double checked the code and it is what was listed on the board
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you changed

Code: Select all

function safeEmail($email)
{
	return str_replace(array('@', '.'), array('_AT_', '_DOT_'), $email);
}
to

Code: Select all

function safeEmail($email)
{
	return $email;
}
?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dunrite67
Posts: 12
Joined: Thu Mar 16, 2006 9:35 pm

dreamweaver

Post by dunrite67 »

ok, it is something with dreamweaver, I checked and everytime I edit it with dreamwearver I get those errors. I opened up the original and changed the email function with wordpad and that does not cause the problem. I guess I will stay away from dreamweaver
dunrite67
Posts: 12
Joined: Thu Mar 16, 2006 9:35 pm

Post by dunrite67 »

yes, that is what I changed. I just tried another change in wordpad by leaving the original function in and change the _AT_ to @ and the _dot_ to . and that works fine too, but dreamweaver must change something else.
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you can use WinDiff for checking if Dreamweaver is changing more than that line.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dunrite67
Posts: 12
Joined: Thu Mar 16, 2006 9:35 pm

Post by dunrite67 »

good idea, I will check that out and post what I find.

I was having a lot of problems with changing the css sheets yesterday too, and I was using dream weaver, maybe it is doing something.

I will let the forum know, because it was very frustating yesterday.

man phpMYFAQ is so FAASSSTTTT! It is really great software. I cant wait to go live with it!
dunrite67
Posts: 12
Joined: Thu Mar 16, 2006 9:35 pm

Post by dunrite67 »

cool, great idea windiff. Dreamweaver is changing another part of the code. It is changing it because it says it is invalid markup. Here are a couple screen shots. I think there is a setting in dream weaver to tell it not to fix code, but I think I will stay with wordpad anyways. Maybe this will help someone else.

http://parishtech.com/docs/other/dreamw ... 20code.JPG

http://parishtech.com/docs/other/windif ... s.php.jpeg

it is very important to note, I didnt go anywhere near this code that dreamweaver changed.
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

if you need a fine editor for PHP try ScITE.

The fact that Dreamweaver changed that lines of code is really bad.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dunrite67
Posts: 12
Joined: Thu Mar 16, 2006 9:35 pm

Post by dunrite67 »

Ok, I will try ScITE, thanks

Ya, I just did numerous test with dreamweaver.

I turned off all the code rewriting and validating in dreamweaver, even anything that was remotely close to being able to fix tags or anything.

Then I opened up the original funtions.php and chose save as and saved it to a new file. I had to choose save as, because since I didnt change anything the save button was greyed out still, so that shows that dreamweaver is changing the file during the save

I then compared with windiff and no matter what I turned off in Dreamweaver, and I always started with the original file, dreamweaver would modify the code in those same two lines.

I understand dreamweaver is trying to make it easier, and I think it is a fantastic product, which is why I bought it, but that is pretty bad that I can not find out where to turn off this code rewriting that it is doing.

If there is a dreamweaver expert out there that can figure this out pleas let me know. I like how dreamweaver diaplays the code, but man I cant trust it.
Post Reply