/    Sign up×
Community /Pin to ProfileBookmark

Hey, I need a way for my teachers to post ‘notes’ on the site I am making for the school… I don’t need the registration option for now, just a ‘mini forum’, where they can login and post information. There can either be one username, or two, as long as only THEY can post the information…

It will be things like, homework, delays or closings, or important information.

Can someone help me out with this, or know of a way I can put this on the website?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@MauMar 18.2006 — Sure - it sounds like you really just want a guestbook like system.

To do this, you simply setup a MySQL database with a table containing all the data. Then, design the PHP-backend that updates, selects, and inserts into this table.

Let us know if you need help with any of these individual steps.
Copy linkTweet thisAlerts:
@codym43authorMar 18.2006 — Yeah, the thing is, I don't know a whole lotta PHP.
Copy linkTweet thisAlerts:
@MauMar 18.2006 — Now is a great time to [url=https://webdeveloper.com/forum/showthread.php?t=99565]learn[/url] then. ? The people here, I'm sure, will be glad to help you along your way.
Copy linkTweet thisAlerts:
@codym43authorMar 19.2006 — I am learning. I need the thing now. I don't have time to learn, if I did, I would not be here.
Copy linkTweet thisAlerts:
@72newbieMar 20.2006 — I know a little and i will help you the best I can....

It will take some ingenuity on your part to make this work, but it's a start to work with.

Form:
[CODE]<form name="MyForm" method="post"
action="<?php echo $_SERVER['SCRIPT_NAME']?>"><input type="text" name="mypost" size="50"><input type="submit" value="Submit" name="submit" onClick="submit"></form>[/CODE]


php submit:
[CODE]<?php




if (isset($_POST['submit'])) {

$name = $_POST['name'];



$fp = fopen("data.txt","a");

if(!$fp) {
echo 'Error, the file could not be opened or there was an error creating it.';
exit;
}
fwrite($fp, $mypost."n");
fclose($fp);

}
?>[/CODE]


php call:
[CODE]
<?php

$array = file("data.txt");

sort($array);
foreach ($array as $row) {
rtrim($row);

echo "{$row}<br>
";

}

?> [/CODE]


I think that might give you something to work with.

You will still need some cookie code for the user part. you can add that in by changing the write code to:

[CODE]}
fwrite($fp, $cookiename." - ");
fwrite($fp, $mypost."n");
fclose($fp);

}[/CODE]
×

Success!

Help @codym43 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...