Alt Tags

Alexej Kubarev

New member
set magic_slashes in PHP.ini to on and your problems will be solved... however its safer to save everything to DB with addslashes and when you get something from DB strippslashes before output :)
 
AlGale said:
I am pulling some info from a database, and it is being displayed fine on the web site. However, I am using the exact same info for the Alt Tags, and only the first word is being displayed. Do I need to use add slashes and strip slashes, or htmlspecial chars, or is there something else I am missing?

Check the html view-source, check if there is any error in the outputted html..
eg.
Code:
<... alt="this"name"..>
 
ok after you do the stripslasheses thing...
do
Code:
$string = str_replace('\'', '&apos;', $string);
$string = str_replace('\"', '"', $string);

This should solve the problem !! :grin:
 
AlGale said:
Hi ruturajv - thanks for the reply.

Howevre, what is happening is that the data pulled from the database is appearing fine on the site, eg it pulls through "This is an image of a pyramid" for example, and correctly displayes it under the image - trying to send the exact same variabe through to the ALT tag howevre, displays simply "This" - addslashes and stripslashes has no effect at all - I still end up with only the first word being displayed!

Can anyone help?

Cheers guys

you may use like this:
Code:
alt='This "some" text'
or
Code:
alt="This 'some' text"
 
Back
Top