Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL Interface

Status
Not open for further replies.

bopritchard

Programmer
Joined
Jan 27, 2003
Messages
199
Location
US
I need to do a simple create, edit, delete interface with a mysql table

all of my web content is feed from my database...and there is only one table i want the users to be able to write to...they do not have coding skills...so it needs to be something that will allow them to insert carriage returns, breaks, underlines, bold text...without knowing tags...

they need to be able to add new records, edit them and delete them...

it's a news section...so all they will do is enter their name as the author, and then enter the body of the news item...nothing fancy...
 
without knowing tags??? How does one do that in this forum?

Why reinvent the wheel? You might want to search out 'blogs' on the net to do this for you. What you describe is a blog.

sourceforge.net may be another good resource.

- - picklefish - -
 
i don't want to reinvent the wheel...but i can't seem to find one of these 'blogs' that do what i want it to do...all i need to be able to do is add, edit and delete rows from a single table and use a WYSIWYG textarea editor on the text field in that table...
 
Even though the blog may not do what you want, you can extract and use the section of code that allows add/edit/delete. The big challenge is to find a WYSIWYG editor component - - which I have never seen as you describe - - but would be interested if such exists.

In addition to add/edit/delete, you most likely will want to consider admin functions, profanity filters, html link filters, script filters, etc. As a site admin, you may be held liable if someone posts illegal material or a link to illegal material. Forms without error-checking could allow a hacker into areas you prefer to keep private. Even a simple interface as you describe could take over 100 lines. Someone may be kind enough to post some code here but you are more likely going to get it from a blog example script.

- - picklefish - -
 
Hi, here's an example of what you could do. It's a javascript function which inserts the tags when clicking the relative image. In this example I'm using the bold tags.

Add this where you would usually place your javascript:

<script language=JavaScript type=&quot;text/javascript&quot;>

function AddText(NewCode) {
if (document.all) {
insertAtCaret(document.input.message,NewCode);
setfocus();
} else {
document.input.message.value+=NewCode;
setfocus();
}
}

function insertAtCaret (textEl, text) {
if (textEl.createTextRange && textEl.caretPos) {
var caretPos = textEl.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
} else {
textEl.value = text;
}
}

function bold() {
AddTxt=&quot;<b></b>&quot;;
AddText(AddTxt);
}

function setfocus() {
document.input.message.focus();
}

</script>

Rename the form tag to (the name part is important):

<form method=&quot;post&quot; action=&quot;whateveryouwanthere&quot; name=&quot;input&quot;>

Add somewhere in the form:

<a href=&quot;javascript:bold()&quot;><img src=&quot;images/bold.gif&quot; border=&quot;0&quot;></a>

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top