Current location: Hot Scripts Forums » Programming Languages » PHP » Wysiwyg


Wysiwyg

Reply
  #1 (permalink)  
Old 09-02-10, 11:01 PM
williamh26 williamh26 is offline
Wannabe Coder
 
Join Date: Jul 2010
Posts: 132
Thanks: 2
Thanked 0 Times in 0 Posts
Wysiwyg

hi guy i have the page to insert data, how put the text area with wysiwyg, any idea

<?php
if (array_key_exists('insert', $_POST)) {
include('includes/conn_pdo.inc.php');
include('includes/corefuncs.php');
// remove backslashes
nukeMagicQuotes();
// initialize flag
$OK = false;
// create database connection
$conn = dbConnect('admin');
// create SQL
$sql = 'INSERT INTO journal (title, article, created)
VALUES(:title, :article, NOW())';
// prepare the statement
$stmt = $conn->prepare($sql);
// bind the parameters and execute the statement
$stmt->bindParam(':title', $_POST['title'], PDO:ARAM_STR);
$stmt->bindParam(':article', $_POST['article'], PDO:ARAM_STR);
$OK = $stmt->execute();
// redirect if successful or display error
if ($OK) {
header( 'Location: http://localhost/php%20solutions/adm...ist.php');
exit;
}
else {
$error = $stmt->errorInfo();
echo $error[2];
}
}
?>
<!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>Journal - insert new record</title>
<link href="assets/admin.css" rel="stylesheet" type="text/css" />
</head>

<body>
<h1>Insert new journal entry </h1>
<form id="form1" name="form1" method="post" action="">
<p>
<label for="title">Title:</label>
<input name="title" type="text" class="widebox" id="title" />
</p>
<p>
<label for="article">Article:</label>
<textarea name="article" cols="60" rows="8" class="widebox" id="article"></textarea>
</p>
<p>
<input type="submit" name="insert" value="Insert new entry" />
</p>
</form>
</body>
</html>
Reply With Quote
  #2 (permalink)  
Old 09-03-10, 03:48 AM
Yeroon's Avatar
Yeroon Yeroon is offline
Code Master
 
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WYSIWYG - Backend>> davestar057 PHP 2 04-01-09 10:48 PM
BB Editor to WYSIWYG Editor DAL JavaScript 2 12-08-08 08:58 AM
WYSIWYG Editors Barnz1986 JavaScript 8 03-08-06 04:47 PM
WYSIWYG Editors Blaine0002 PHP 1 08-24-05 04:50 AM


All times are GMT -5. The time now is 08:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.