Space in user registration username

Post here is you are having problems with any of the tutorials.
Post Reply
shaunthomson
Posts: 19
Joined: Mon Nov 28, 2011 11:53 am

Space in user registration username

Post by shaunthomson »

Hi

I've almost got the Register and Login tut working.

When registering, if I enter a username but no pass, when the page comes back, the username reappears in the form field, but it has a space entered before it.

Here's the code:
<input type="text" name="username" id="username" value=" <?php if(isset($_POST['username']))echo htmlentities($_POST['username']);?>" />
Has anyone else had the same thing?

Thanks

ps - I just noticed that if you repeat the above process, spaces just keep getting added
Shaun
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Space in user registration username

Post by Temor »

you have a space here:
value=" <?php 
remove that space.
shaunthomson
Posts: 19
Joined: Mon Nov 28, 2011 11:53 am

Re: Space in user registration username

Post by shaunthomson »

Cheers Temor - I should have looked harder before posting - thanks for your time mate.
User avatar
Temor
Posts: 1186
Joined: Thu May 05, 2011 8:04 pm

Re: Space in user registration username

Post by Temor »

No worries. That's what I'm here for!
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Space in user registration username

Post by jacek »

shaunthomson wrote:Cheers Temor - I should have looked harder before posting - thanks for your time mate.
I have been in situations like this too, you convince yourself that the problem is with a certain thing and then forget about the rest of the code. Don't worry about it :)
Image
Post Reply