Log In · Register

 
notepad
Maccabee
post Oct 24 2009, 12:39 AM
Post #1


Senior Member
*******

Group: Official Designer
Posts: 5,880
Joined: Nov 2007
Member No: 593,382



im wanting to make an online notepad for personal use. ive got a server. it could be like the one cb uses or this.
http://jumk.de/notepad/

i use that all the time but it sucks. haha.

i figured the best way to do this would be with a database as opposed to cookies or something so that way you can always access it from any pc.

how would i go about this? i only started learning database stuff recently.

fanks. its also just for the learning experience.
 
 
Start new topic
Replies
fixtatik
post Oct 30 2009, 02:38 PM
Post #2


Senior Member
******

Group: Member
Posts: 1,237
Joined: May 2008
Member No: 648,123



If you're running it as-is, you'll have problems immediately because you're not connected to your database. The "// Connect to MySQL" is just a comment saying you need to connect to MySQL before doing anything else. Like Jon said, either run the table query once, or make tables inside phpMyAdmin, which most hosts provide standard.

Also, take note of my previous post. I forgot to add "VALUES" to the code earlier; update yours to include "VALUES".

You can pretty much do the whole thing with two pages. You can call the query script on the same page as the form; just make sure instead of linking the action attribute to a different page, link it to itself.

The first page contains the code to create a new user. Make the form, then use the PHP script to check if both the "user" and "pass" fields are filled, and enter it into the database.

The second page contains the memo, after a user has logged in. You need a textarea which contains the memo, and the PHP script to check if the submit button was pushed. If it was pushed, then run a query on the database to update that row.
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: