
Nov 21st, 2006, 11:13
|
|
Junior Member
|
|
Join Date: Oct 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
formatting of text froma a dynamic table in dreamweaver
I am trying to slowly put together a very simple content management site for a footy club i run,
the data is stored in a mysql database and lined to the web page using a dynamic table from within dreamweaver, it displays all the info except one thing it appears in one huge paragraph, take a look at my page
Link is at:
http://itdesignz.co.uk/Clients/RTFC/cms/home.php
The Data in the mysql has the spaces and enters breaks in it, but these are not reflected in my page.
I am really new to dreamweaver and am not sure how to overcome this problem,
my page code is:
- Code: Select all
<?php require_once('Connections/rtfccms.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO news (headline, story, `date`, active, archive) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['headline'], "text"),
GetSQLValueString($_POST['story'], "text"),
GetSQLValueString($_POST['date'], "date"),
GetSQLValueString(isset($_POST['active']) ? "true" : "", "defined","1","0"),
GetSQLValueString(isset($_POST['archive']) ? "true" : "", "defined","1","0"));
mysql_select_db($database_rtfccms, $rtfccms);
$Result1 = mysql_query($insertSQL, $rtfccms) or die(mysql_error());
$insertGoTo = "home.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
.style2 {
color: #006633;
font-weight: bold;
font-size: 18px;
}
.style3 {
color: #006603;
font-weight: bold;
font-size: 24px;
}
-->
</style></head>
<body>
<table width="935" height="325" border="1" align="center" bordercolor="#006700">
<tr>
<td height="93"><img src="images/top_image.jpg" width="974" height="89" longdesc="http://www.redtilefc.co.uk" /></td>
</tr>
<tr>
<td height="34"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button1.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<embed src="button1.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#FFFFFF"></embed>
</object>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
<param name="movie" value="button2.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<embed src="button2.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#FFFFFF"></embed>
</object></td>
</tr>
<tr>
<td height="158"><p class="style3">Insert A New Story
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table width="378" align="center">
<tr valign="baseline">
<td nowrap align="right">Headline:</td>
<td><input type="text" name="headline" value="" size="70"></td>
</tr>
<tr valign="baseline">
<td height="95" align="right" nowrap>Story:</td>
<td><textarea name="story" cols="70" rows="15"></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Active:</td>
<td><input type="checkbox" name="active" value="" ></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Archive:</td>
<td><input type="checkbox" name="archive" value="" ></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Insert record"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p></td>
</tr>
<tr>
<td height="28"><p align="center" class="style2">Site built and maintained By <a href="www.itdesignz.co.uk">IT Designz</a> </p> </td>
</tr>
</table>
</body>
</html>
Please help
Andy
|