I have a small problem Im an asp coder havent realy done anything with php. I have this wysiwyg online html editor view it here.
http://www.ermgroup.com.au/Richtext/rte/test_embedded.php
i want it to connect to an access database and retreive the code corrosponding to the ID for example when you put ID=2 in it goes to the database and displays the text for ID=2.
and here is some code that i found to connect to an access datatabase
if you can help just put comment in where im suposed to put specific code.
<?
// connect to a DSN "users" with a user "murtaza" and password "mur"
$connect = odbc_connect("users", "murtaza", "mur");
// query the users table for name and surname
$query = "SELECT * FROM User";
// perform the query
$result = odbc_exec($connect, $query);
// fetch the data from the database
while(odbc_fetch_row($result)){
$name = odbc_result($result, 1);
$surname = odbc_result($result, 2);
print("$name $surname\n");
}
// close the connection
odbc_close($connect);
?>
here is the code for the WYSIWYG editor.
<!--
#################################################################################
##
HTML Text Editing Component for hosting in Web Pages
Copyright (C) 2001 Ramesys (Contracting Services) Limited
##
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
##
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
##
You should have received a copy of the GNU LesserGeneral Public License
along with this program; if not a copy can be obtained from
##
##
or by writing to:
##
Free Software Foundation, Inc.
59 Temple Place - Suite 330,
Boston,
MA 02111-1307,
USA.
##
Original Developer:
##
Austin David France
Ramesys (Contracting Services) Limited
Mentor House
Ainsworth Street
Blackburn
Lancashire
BB1 6AY
United Kingdom
##
##
#################################################################################
-->
<HEAD>
<TITLE>Edit Text</TITLE>
<META content="HTML 4.0" name=vs_targetSchema>
<META content="Microsoft FrontPage 4.0" name=GENERATOR></HEAD>
<BODY leftMargin=0 topMargin=0 scroll="no" style="border:0">
<?
if (isset($text)) {
// Update your database here
// ...
// Confirmation
print "<P>Database Updated</P>";
print "<P>HTML:-<hr>" . $text . "</P>";
} else {
// Get your HTML from the datbase here
$strHTML = '<H1>Heading 1</H1>'
. '<H2>Heading 2</H2>'
. '<H3>Heading 3</H3>'
. '<P>Normal</P>'
. '<P>Welcome to the richtext text editor, the HTML text editor which works inside a web page.</P>'
;
// Create an instance of the editor
?>
<object id="richedit" style="BACKGROUND-COLOR: buttonface" data="richedit.html"
width="100%" height="100%" type="text/x-scriptlet" VIEWASTEXT>
</object>
// Dummy form used to communicate text to/from the server
<form id="theForm" method="post">
<textarea name="text" style="display:none" rows="1" cols="20"><?=$strHTML?></textarea>
</form>
// Glue to populate the editor with HTML from database
<SCRIPT language="JavaScript" event="onload" for="window">
richedit.options = "history=no;source=yes";
richedit.addField("to", "To", 128, "someone@somewhere.com");
richedit.addField("cc", "Cc", 128, "someone@else.com");
richedit.addField("subject", "Subject", 128, "Something about Nothing");
richedit.docHtml = theForm.text.innerText;
</SCRIPT>
// Glue to submit the updated HTML to the server
<SCRIPT language="JavaScript" event="onscriptletevent(name, eventData)" for="richedit">
if (name == "post") {
richedit.getValue("subject");
theForm.text.value = eventData;
theForm.submit();
}
</SCRIPT>
<?
}
?>
</BODY>
regards aron palmer