Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Programming > PHP Development
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-12-2006, 12:20 PM   #1 (permalink)
jonnyw6969
Junior Member
 
Join Date: Aug 2006
Posts: 7
Default Newbie needs some help

Hi all,

Please could someone help me with this situation?
Ok here's my problem, Im using a text editor called Fckeditor and using this to store the page information in a mysql database which im later calling it the main pages. The editor seems to work fine and is storing the information in the table.
The information it stores is stored as followed

<p align=\"center\"><br /><font color=\"#ff0000\"><font face=\"Arial\" size=\"4\"><strong>appears to have forgiven the Frenchman.<br /><br /><br /></strong></font></font></p>

I believe this is so it can be inserted into a php section but im not really sure.

When it gets echoed into the page it displays as above so none of the styles work.

Can anyone please shed some light onto this for me please?
jonnyw6969 is offline   Reply With Quote
Sponsored Links
Old 08-12-2006, 12:38 PM   #2 (permalink)
No0oB
Junior Member
 
Join Date: May 2006
Location: Near Frankfurt
Posts: 26
Send a message via ICQ to No0oB Send a message via MSN to No0oB
Default Re: Newbie needs some help

The escaping is correct, but you only have to escape when its in a string such as between " and "
So it would be
PHP Code:
$string "<p align=\"center\"><br /><font color=\"#ff0000\" face=\"Arial\" size=\"4\"><strong>appears to have forgiven the Frenchman.</strong></font></p><br /><br /><br />"

I also corrected it a bit
No0oB is offline   Reply With Quote
Old 08-12-2006, 12:43 PM   #3 (permalink)
jonnyw6969
Junior Member
 
Join Date: Aug 2006
Posts: 7
Default Re: Newbie needs some help

Ok great that makes sense

At the moment im using the code below to call it

<?php
$sql_page=mysql_query("SELECT * FROM `cms_page` where page_name='home'");
$res_page=mysql_fetch_array($sql_page);
?>

then

<?=$res_page['description']?>


what would i need to change there?
jonnyw6969 is offline   Reply With Quote
Old 08-12-2006, 12:44 PM   #4 (permalink)
jonnyw6969
Junior Member
 
Join Date: Aug 2006
Posts: 7
Default Re: Newbie needs some help

didnt mean to sound sarcastic then, i really do appreciate any help
jonnyw6969 is offline   Reply With Quote
Old 08-12-2006, 09:28 PM   #5 (permalink)
No0oB
Junior Member
 
Join Date: May 2006
Location: Near Frankfurt
Posts: 26
Send a message via ICQ to No0oB Send a message via MSN to No0oB
Default Re: Newbie needs some help

I actually dont see any connection between the first post, and your request afterwards.
The mysql request doesnt have anything to do with that string
PHP Code:
<?
$sql 
"SELECT * FROM cms_page WHERE page_name = 'home'";
$query mysql_query($sql);
// if theres only one description
$row mysql_fetch_array($query);
echo 
$row['description'];
// if there are more than one
while ($row mysql_fetch_array($query))
   {
   echo 
$row['description'];
   }

I dont see any problem, why you would have to change your code.
I just pasted my code, so you see how I do it.
I think its a bit more structured
No0oB is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 03:37 PM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums