Jump to content

Content management problem... any ideas?


Alexhoward

Recommended Posts

Good evening!

 

I've created a content mangement system for my website.

 

This allows me to change all the text from the backend using a rich text editor.

 

The code inserts the formatted text into a MySQL table with all the HTML tags,

 

I then echo this on the front end.

 

Problem is, on some pages i need to use data either posted from a form, or pulled from a different table. i.e. a name attached to the users login via email.

 

so to pull out the content i'm using:

 

simplfied...

<?php

$con = mysql_connect($host, $db, $pass) or die ("Apologies we are experiencing technical difficulties") ;

mysql_select_db($db) or die ("Apologies we are experiencing technical difficulties") ;
		   
$query = mysql_query("SELECT * FROM table WHERE page = x") ;

while($row = mysql_fetch_array($query, MYSQL_ASSOC)) {

$content = $row['text'] ;

}

echo $content ; 

?>

 

however if i was echoing this manually i might put:

<?php

echo "Hello ".$full_name.", Welcome to my website..." ;

?>

 

So my question is... is there a way to input variables into the rich text editor so that they display a result on the front end..?

 

Thanks in advance!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.