if else echo
Okay, my CMS is going great .. But … I need help with one little thing …
Okay, my news system pulls the news out of a database. So the origional code i made was
markupprint ("$content");
(content was defined earlyer in the document)
Okay, so you might have guessed if $content contained any php, the script would fail and nothing would be displayed…. So .. I added an extra collum to my sql table called ifphp …. if the content had php in it i must set ifphp to 1 and otherwise leave it null ….. So .. I need help making my script to use this .. as i keep getting errors ….
$content;
} else {
echo $content;
}```
Any ideas???
I got a better idea … can anyone help me mod this script <?php include "config.php"; ?>
<?php
$id = $_GET['id'];
database_connect();
$query = "SELECT * from content
WHERE id = $id";
$error = mysql_error();
if (!$result = mysql_query($query)) {
print "$error";
exit;
}
while($row = mysql_fetch_object($result)){
$content = $row->text;
print("$content");
}
?>
So that I can also link directly to pages and open them in iframe "centerframe" instead