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
Maccabee
post Oct 27 2009, 01:46 PM
Post #2


Senior Member
*******

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



so how does the file layout work? I have never done this before. it most of the php on one action page?

one page:

CODE
<?php
// Connect to MySQL
mysql_query("CREATE TABLE memo (id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), user CHAR(15) NOT NULL, pass CHAR(32) NOT NULL, date DATETIME NOT NULL, last DATETIME NOT NULL, memo TEXT NOT NULL)");


// Create a new user
if(count($_POST) > 0) {
  $user = $_POST['user'];
  $pass = md5($_POST['pass']);
  if($user && $pass) mysql_query("INSERT INTO memo ('', '$user', '$pass', NOW(), '', '')");
}
?>

<form action="action.php" method="post">
<input name="user" maxlength="15" />
<input name="pass" maxlength="16" />
<input type="submit" />
</form>


and cant I take out the first little part after I run it cause it only needs to create that table once? and then it sends them to the action page?

and how do I let them update the memo?

CODE
<form action="update.php" method="post">
<textarea name="memo" cols="50" rows="10"><?php echo $memo; ?></textarea>
<input type="submit" />
</form>


still a little lost.
 

Posts in this topic


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