Jump to content

[SOLVED] AS-IS display


elite_prodigy

Recommended Posts

I don't want users to have to enter a <br /> every time they need a new line. And I certainly don't want to enter them into the string using string searching and replacing. So, how would I put data on a page that was entered through a form and have it's original integrity retained like this forum? <![CDATA["text"]]>?

 

Link to comment
https://forums.phpfreaks.com/topic/137415-solved-as-is-display/
Share on other sites

how else do i use it? here is the code where it is used:

 

<?php

session_start();
if(!isset($_SESSION['id'])){
header("location:login.php");
}

include 'config.php';
include 'functions.php';

mysql_select_db('exembar_site');

$id			= $_SESSION['id'];
$sql			= "SELECT * FROM `permissions` WHERE `staffId`='{$id}'";
$result			= mysql_query($sql);
$info			= mysql_fetch_array($result);
$pages 			= $info['pages'];

if($pages == 0){
header("location:{$root}/index.php");
}

$title			= $_POST['title'];
$display 		= $_POST['display'];
$top 			= $_POST['topbar'];
$content 		= $_POST['content'];
$id 			= $_GET['id'];

//sanitize everything
$title 			= sanitize($title);
$display 		= sanitize($display);
$top 			= sanitize($top);
$content 		= sanitize($content);

$content                = nl2br($content);

$sql 			= "UPDATE `navigation` SET `display`='{$display}' WHERE id='{$id}'";
mysql_query($sql) or die(mysql_error());

$sql 			= "UPDATE `pages` SET `title`='{$title}' WHERE `navId`='{$id}'";
mysql_query($sql) or die(mysql_error());

$sql 			= "UPDATE `pgContent` SET `topBar`='{$top}', `content`='{$content}' WHERE `navId`='{$id}'";
mysql_query($sql) or die(mysql_error());

header("location:{$root}");

?>

Link to comment
https://forums.phpfreaks.com/topic/137415-solved-as-is-display/#findComment-718087
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.