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