Reply
HTML Forms, Outputting a certain style?
Old 05-23-2006, 09:54 AM HTML Forms, Outputting a certain style?
Novice Talker

Posts: 8
Hey everyone, this is my dilemma. I have a form (PHP/MySQL) and have people inputting text that they usually copy preformatted with bolds, spaces, new paragraphs and things like that and then paste it into my multi-line form box that will output to a MySQL database.

I was wondering if there is anyway to auto-format these so that they go in formatted as the user has put them in already so they dont have to re-do things?

Here is the actual code for the box.

Quote:
<form action="insert.php" method="post">
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#CCCCCC">
<td>Job Details (description):</td>
<td><textarea name="details" cols="60" rows="30">Enter job description here.</textarea></td>
</tr>
</table>
<p/>
<div align="center">
<input type="Submit">
</div>
</form>
The code for the above mentioned "insert.php" is here:

Quote:
<?
$user="xx";
$password="xx";
$database="xx";
$title=$_POST['title'];
$number=$_POST['number'];
$description=$_POST['description'];
$category=$_POST['category'];
$salary=$_POST['salary'];
$addcomp=$_POST['addcomp'];
$position=$_POST['position'];
$location=$_POST['location'];
$details=$_POST['details'];

mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "INSERT INTO joborder VALUES ('','$title','$number','$description','$category', '$salary','$addcomp','$position','$location','$det ails')";

$result = mysql_query($query);

if($result)
echo "Success!<p/><div align=\"center\">To return to the upload form please click <a href=\"<A href="http://andiamo.andiamopartners.com/form.php\">Here</a></div">xx.com\">Here</a></div>
</p><div align=\"center\">To see results please click <a href=\"xx.com<A href="http://andiamo.andiamopartners.com/output.php\">Here</a></div">\">Here</a></div>";
else
echo "There was an error!<p/>" . mysql_error();
?>
virtuexru is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-23-2006, 02:09 PM Re: HTML Forms, Outputting a certain style?
LadynRed's Avatar
Super Moderator

Posts: 6,555
Location: Tennessee
There is no 'auto formatting', somehow you'd have to do it in your scripting.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-23-2006, 04:53 PM Re: HTML Forms, Outputting a certain style?
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
You mean a bit like the rich text edits like on this forum? AFAIK, they're a bit of a hack - I think it's an iFrame put into 'edit mode'. There's a number of pre-made ones out there, some probably free, that you can use. Seaarch google.

http://www.google.co.uk/search?sourc...ased+rich+edit
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"
Inoxia Pyrotechnics Supplies | Surrey Angels Cheerleading Squad
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 05-23-2006, 05:20 PM Re: HTML Forms, Outputting a certain style?
Novice Talker

Posts: 8
Figured it out already, am using FCKeditor! Works perfectly.
virtuexru is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to HTML Forms, Outputting a certain style?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12093 seconds with 12 queries