Jump to content

no HTML?


ColdEdge

Recommended Posts

Ok, this is getting very annoying and frustrating. For one I can't get BBCode to work and here is the other one.My stupid post reply script posts data like this

___________________________$_________________________$$$$________________________$$$$$$_______________________$$$$$$_______________________$$$_______________________$$__________$$$$$$$$$$$$$_$$$$$$$$$$$$$$$$_______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$___$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$__$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ __$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ __$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ __$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ___$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ _____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_________$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ___________$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ _____________$$$$$$$$$$$$$$$$$$$$$$$$$ _______________$$$$$$$$$$__$$$$$$$$$

but a forum BBS installed on my localhost UseBB to be exect and other BBS's render the same text as

___________________________$_________________________$$$$________________________$$$$$$_______________________$$$$$$_______________________$$$_______________________$$__________$$$$$$$$$$$$$_$$$$$$$$$$$$$$$$_______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$___$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$__$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ __$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ __$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ __$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ___$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ _____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_________$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ___________$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ _____________$$$$$$$$$$$$$$$$$$$$$$$$$ _______________$$$$$$$$$$__$$$$$$$$$

What the ###### is going on?quick post script

echo '					<form method="post" action="reply.php?id=' . $row['topic_id'] . '&p='.$p.'">						<textarea name="reply-content" rows="5" cols="60" accesskey="q"></textarea>						<div style="clear:both;height:10px;"></div>						<input type="submit" name="submit" value="OK" accesskey="s" />						<input type="reset" value="Reset" />					</form>					<div style="clear:both;height:20px;"></div>';

post reply script

<?phpinclude 'connect.php';include 'header.php';if($_SERVER['REQUEST_METHOD'] != 'POST'){	//someone is calling the file directly, which we don't want	echo 'This file cannot be called directly.';}else{	//check for sign in status	if(!$_SESSION['signed_in'])	{		echo 'You must be signed in to post a reply.';	}	else	{		//a real user posted a real reply		$sql = "INSERT INTO 					posts(post_content,						  post_date,						  post_topic,						  post_by) 				VALUES ('" . $_POST['reply-content'] . "',						NOW(),						" . mysql_real_escape_string($_GET['id']) . ",						" . $_SESSION['user_id'] . ")";								$result = mysql_query($sql);								if(!$result)		{			echo 'Your reply has not been saved, please try again later.';		}		else		{			echo 'Your reply has been saved, check out <a href="topic.php?id=' . htmlentities($_GET['id']) . '&p='.$_GET['p'].'">the topic</a>.';		}	}}include 'footer.php';?>

connect script

<?php session_start();//connect.php$host = "localhost";$db_user = "......";$db_pass = ".........";$db_name = "........";$connectClass = mysql_connect("$host", "$db_user", "$db_pass") or die ("Couldn't establish connection to database server.");$dbObject = mysql_select_db("$db_name", $connectClass) or die ("Couldn't select database.");?>

header.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 	<meta name="description" content="A short description." /> 	<meta name="keywords" content="put, keywords, here" /> 	<title>PHP-MySQL forum</title>	<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>	<script type="text/javascript" src="objects/thickbox.js"></script>	<link rel="stylesheet" href="objects/thickbox.css" type="text/css" media="screen" />		<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script><script language="javascript" type="text/javascript">tinyMCE.init({	mode : "textareas",	theme : "advanced",	plugins : "safari,paste",	theme_advanced_buttons1 : "fontselect,fontsizeselect,forecolor,emotions,bold,italic,|,paste,pastetext,pasteword,bullist,numlist,|,undo,redo,|,link,unlink,anchor,",	theme_advanced_buttons2 : "",	theme_advanced_buttons3 : "",	theme_advanced_buttons4 : "",	theme_advanced_toolbar_location : "top",	theme_advanced_toolbar_align : "left",	theme_advanced_path : false,	valid_elements : "em,i,a[href|target=_blank],strong/b,p,ol,ul,li",	paste_use_dialog : true,	paste_create_paragraphs : true,	paste_create_linebreaks : false,	paste_force_cleanup_wordpaste : true,	paste_strip_class_attributes: "all",	paste_auto_cleanup_on_paste : true,	paste_convert_headers_to_strong : true,	paste_convert_middot_lists : true,	paste_unindented_list_class : ""});</script><script type="text/javascript">	setInterval("getData()",5000);</script><link rel="stylesheet" href="style.css" type="text/css"></head><body>

Link to comment
Share on other sites

The problem with the apple logo appearing as a mess is that line breaks are not treated as such in HTML unless the parent tag has white-space: pre; declared in the CSS.

Link to comment
Share on other sites

white-space: pre; works but the logo is massive now

___________________________$_________________________$$$$________________________$$$$$$_______________________$$$$$$_______________________$$$_______________________$$__________$$$$$$$$$$$$$_$$$$$$$$$$$$$$$$_______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$___$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$__$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$__$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$__$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$__$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$___$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_____$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_______$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_________$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$___________$$$$$$$$$$$$$$$$$$$$$$$$$$$$$_____________$$$$$$$$$$$$$$$$$$$$$$$$$_______________$$$$$$$$$$__$$$$$$$$$

Link to comment
Share on other sites

Try adding line-height: 1em; to the logo's CSS.

Link to comment
Share on other sites

k, I will read on that on php.net, JustSomeGuy or others, I have one more question.ATM, I am using full paths like topic.php?tid=# how can I instead convert it to be like any other forum BBS so like this current IPB forum dose it displaysindex.php?showtopic=# since I am seeing full paths is bit annoying to use

Link to comment
Share on other sites

well lets say I have a blog, as you know the blog entry's are fetched/displayed by PHP by calling there id or what ever the field is in MySQLso the url would be something like myblog/blogentry.php?id=# <-- loads a specific article depending on id# I want to replace the blogentry.php part with just making it index.php?blog=# or what ever the variable is after the index.php?..... So I was referring to W3Schools forum, its powered by IPB and as you can see the topics are fetched via index.php?showtopic=# query not like my forum which atm, is using topic.php?id=# So ye thats what I am trying to get help with... I am sure its a include method. Here is an example code that should do the trick but doesn't as I failed in it somewhere ^^

f($_GET['id'] == '') {	$page = "main";} else {	$page = $_GET['id'];}$filename = "/".$page.".php";if(file_exists($_SERVER{'DOCUMENT_ROOT'}.$filename)) {include ''.$page.'.php';} else {	echo "<br /><br /><center>The page you are trying to reach does not exist.  Please check the url and try again.</center><br />";}

Link to comment
Share on other sites

The code for IPB probably has an if structure which checks which variables in $_GET are defined, and includes a file based on that. e.g.:

if (isset($_GET['act'])){  ...}elseif (isset($_GET['showtopic'])){  ...}elseif (isset($_GET['showforum'])){  ...}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...