0

I have data in an Excel spreadsheet linked to a mysql database and on to the webpage through php. I am trying to style the lines with a CSS stylesheet but somewhere the data is changed meaning (I think) the browser ignores the CSS command.

Written in the spreadsheet is as follows:-

<p class="fixturedate"><strong>Friday May 17th 2013</strong></p>

Somewhere along the way, by the time it gets to the browser, this is being changed to:-

<p class=\"fixturedate\"><strong>Friday May 17th 2013</strong></p>

Any ideas why those two backslashes are being added? Is that the problem or is it just not going to work anyway?

Thanks

5
  • You are using echo, right?
    – Ligth
    May 17, 2013 at 19:36
  • 1
    is the data on the screen coming from mysql or excel? May 17, 2013 at 19:42
  • Ideally, data should be going into the database using database specific escaping so that it's unescaped when it actually resides in the database. Double escaping can cause the undesired slashes.
    – cimmanon
    May 17, 2013 at 19:43
  • ....or escaping double quotes when your strings are enclosed in single quotes May 17, 2013 at 19:44
  • OK got it - it was the double escaping causing the problem. Took the quote marks out and changed it to this :- <p class=fixturedate><strong>Friday May 17th 2013</strong></p> and it worked. Thanks. May 17, 2013 at 20:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.