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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web-Based WYSIWYG (kinda) Editor 2

Status
Not open for further replies.

KooLTaB101

Technical User
Mar 21, 2003
8
US
Hi,

I am building a php website that I expect to get a lot of traffic too. The website requires users to come to it and edit their own personal information, which will be stored in php files on the website. I don't want to give them FTP access to the directory, so I want to integrate some sort of editor that will take the content from, say page1.php and let users change the content of it. I want the editor to be purely web-based.

I dont think it would be extremely hard to code by hand, but before I start to do that, does anyone know of one that already exists (why reinvent the wheel? ;-)).

I'm sure I'm not the first to ask this question...but I could not find anything like it searching the forums. If you know of anything or can offer any suggestions, I'd greatly appreciate it.

Thank you,
Matt
 
Hi,

Can you use a mysql database. Store all the users info in the db, make it so they have to login with a correct username and password, then show them their details if they exist within form fields so they can update then a submit button that goes to an update page and updates the info in the database.

It is very easy to do. Do you have access to mysql?

Hope this helps!

Nate

mainframe.gif

 
What do you mean by their own personal informatation? If you mean that they would edit their own web pages, check out:

Even if this does not fit your need, the source PHP code may be helpful.

- - picklefish - -

Why is everyone in this forum responding to me as picklefish?
 
I have pages specifically for them created, and do not want to use a big CMS. I think I will take SYPDERIX's suggestion and build an SQL DB of the users and the text per page.

Where can I find some sample MySQL scripts that I could use to do this sort of thing?

Thanks,
Matt
 
What samples do you want?

You will need to contact your host, get a mysql db setup and an account for yourself. Then see if your host has phpmyadmin installed and where to go to log into that. Otherwise, find out the O.S. and install the proper version of phpmyadmin onto your webspace (
Then you make a table and set your fields, then using php you create a connection string to retrieve certain info then once the user modify's things they submit it via a form and you connect to the db again and do an update command.

Do you need all those types of examples?

Hope this helps!

Nate

mainframe.gif

 
I do know how to make a DB and somewhat know the fields and such, I guess I would need examples on how to manipulate the php with the sql in such a way as to connect and update information.

Thanks a lot!
Matthew
 
Hi,

Everything to do with mysql resolves around connecting and closing the connection.

<?php

$host = &quot;localhost&quot;;
$username = &quot;username&quot;;
$password = &quot;password&quot;;
$db_name = &quot;db_name&quot;;
$table_name = &quot;table_name&quot;;

$connect = mysql_connect(&quot;$host&quot;,&quot;$username&quot;,&quot;$password&quot;);

mysql_select_db(&quot;$db_name&quot;,$connect);

$sql = &quot;SELECT * FROM `$table_name` WHERE `page` = 8&quot;;

$query = mysql_query ($sql);

mysql_close($connect);

?>

Then the way you interact with it is using SQL.
Check out: to learn SQL commands.

When you retrieve info from the db, it is always returned in an array and you need to use:

while ($line=mysql_fetch_array($query))
{
echo $line[&quot;db_row_name&quot;];
}

That will help seperate the array into the sections you need.

If you need more help, just let us know.

Hope this helps!

Nate

mainframe.gif

 
Thank you so much Nate! You get a star for all your help! I will try this out right now!

Thanks again!
Matt
 
See devshed.com and webmonkey.com for tutorials on mixing MySQL and PHP

- - picklefish - -

Why is everyone in this forum responding to me as picklefish?
 
There is a FAQ about the necessary steps how to retrieve data from MySQL using PHP.
FAQ434-3850
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top