PHP/MYSQL

I am trying to make it so that when you input your username on the webpage in the database, it is adding an underscore where the spaces are, I dont know if this is right or if im adding it in the wrong spot

var username = newUsername.replaceAll('_', ' ')

It looks right to me, except you need a “;” on the end of it.

If you’re not using a debugger to walk through your code you can do something like this, to see if it’s being hit.

[php]var username = newUsername.replaceAll(’_’, ’ ');
alert(‘Replace Activated’);[/php]

This way if you get the message box you know the code was triggered.

Sponsor our Newsletter | Privacy Policy | Terms of Service