Strange letter on battle.php

Location of the Videos
Post Reply
SFC
Posts: 16
Joined: Mon Apr 06, 2015 6:32 pm

Strange letter on battle.php

Post by SFC »

on battle.php, at end, where it should be "Attack" I have this:
Attack!d»z
So I dont know where this d»z came from or how to remove it... everything works fine, but it bugs me to see it :D
Here is how code looks like (but I doubt it is about the actual code...)

echo "<a href='attack.php?creature=$creature'>Attack!";

What am I missing?
gedq
Posts: 18
Joined: Sun Apr 05, 2015 9:53 pm

Re: Strange letter on battle.php

Post by gedq »

Change the double quotes to single so any hidden characters don't get rendered?
SFC
Posts: 16
Joined: Mon Apr 06, 2015 6:32 pm

Re: Strange letter on battle.php

Post by SFC »

When I change to single qoutes like this:

echo '<a href='attack.php?creature=$creature'>Attack!';

I get error:

Parse error: syntax error, unexpected 'attack' (T_STRING), expecting ',' or ';' in /home/vhosts/mojaigra.orgfree.com/battle.php on line 56
gedq
Posts: 18
Joined: Sun Apr 05, 2015 9:53 pm

Re: Strange letter on battle.php

Post by gedq »

you need to escape the singles in the html line and render the variable outside the string - single quotes aren't put through the parser:

echo '<a href=\'attack.php?creature=' , $creature, '\'>Attack!';
SFC
Posts: 16
Joined: Mon Apr 06, 2015 6:32 pm

Re: Strange letter on battle.php

Post by SFC »

I change reference like you said and still have d»z at end.
Winawer
Posts: 180
Joined: Wed Aug 17, 2011 5:53 am

Re: Strange letter on battle.php

Post by Winawer »

Looks like a byte order mark (BOM). It's being added by your editor so check your file encoding settings.
Post Reply

Return to “Older Browser MMO Videos”