HTML in String
#1

Hello!
I have an email system on my server. I can use basic HTML tags (<b>, <i>, </ br>, etc.) within strings and works perfectly.
The problem is that when I try to put the following code the pawno returns error:
PHP код:
format(Stringsizeof(String), "<a href="http://www.darkstreetrpg.com.br/" target="_blank" ><img src="https://s20.postimg.org/yvy9av9fh/logo.png" /></a>"); 
Returned error in pawno:
PHP код:
...\Server\gamemodes\GM.pwn(8318) : error 001expected token"-string end-"but found "-identifier-"
...\Server\gamemodes\GM.pwn(8318) : error 029invalid expressionassumed zero
...\Server\gamemodes\GM.pwn(8318) : warning 215expression has no effect
...\Server\gamemodes\GM.pwn(8318) : warning 203symbol is never used"http" 
Any help?
Reply
#2

Welp its cuz of the use of "

Idk maybe replace it with this?
Код:
format(String, sizeof(String), ''<a href=''http://www.darkstreetrpg.com.br/'' target=''_blank'' ><img src=''https://s20.postimg.org/yvy9av9fh/logo.png'' /></a>'');
Also why format a string when you're not passing any values to it?
Reply
#3

PHP код:
format(Stringsizeof(String), "<a href='www.darkstreetrpg.com.br/' target='_blank' ><img src='https://s20.postimg.org/yvy9av9fh/logo.png' /></a>"); 
Reply
#4

You need to escape the quotes

https://sampwiki.blast.hk/wroot/index.ph...&printable=yes
Reply
#5

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
Welp its cuz of the use of "

Idk maybe replace it with this?
Код:
format(String, sizeof(String), ''<a href=''http://www.darkstreetrpg.com.br/'' target=''_blank'' ><img src=''https://s20.postimg.org/yvy9av9fh/logo.png'' /></a>'');
Also why format a string when you're not passing any values to it?
Because this is only a part(signature) of the formated email.
Thank you!

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
PHP код:
format(Stringsizeof(String), "<a href='www.darkstreetrpg.com.br/' target='_blank' ><img src='https://s20.postimg.org/yvy9av9fh/logo.png' /></a>"); 
Worked Fine! Thank you.

Quote:
Originally Posted by ExTaZZ69
Посмотреть сообщение
Thank you!


SOLVED
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)