Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello, I am new to the php developer's network as well as the php language itself. Please forgive me if this is the wrong forum to ask this
sort of question.
On one of my web page, a php script is supposed to retrieve a string from the global array $_POST then store the information into MySQL. On another page, I provided means for the user to view this information by accessing the database. However, whenever the data is displayed there seems to be no carrige return or new lines at all. All the characters are lined up in their cell in a marathon (the text only goes to the next line when it reaches the border of the cell, which has a fixed width). Here is the partial script I used to perform this task:
submission.php
[syntax="html"]<P>
<textarea name="content" rows="20" cols="60">
Code: Select all
<?php
//Attempt To Connect To Database
$content = $_POST['content'];
$title = $_POST['text_title'];
$author = $_POST['author'];
$host = "localhost"; //Subject To Change On The Production Server
$user = "avantsci";
$password = "delta08";
$connection = mysql_connect($host,$user,$password) or die(mysql_error());
mysql_select_db("avantsci?user?submission");
$query = "INSERT INTO submissions (title, author, content) VALUES ('".$title ."', '".$author."', '".$content."')";
$results = mysql_query($query) or die (mysql_error());
include 'pre_content.php';
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]