A new project

Status
Not open for further replies.

Yek

T.F's Resident Cool Guy...
Messages
1,613
hello, though i would take on a new project :>

I have a number of questions that i need to ask and i hope some of you can give me some advice :>

The Project
What i want to create is some simple code that takes form entrys and displays them on a page. At the bottom of this page there should be another form with allows a reply to be made and displays it under the first message.
This is a very very simple version of a forum.

1) What would i code this in, PHP?
2) Will i need some form of database, MySQL?
3) Will it work?
4) In the near future would it be possiable to add email alerts on replys, emoticons etc ?


Thanks, i hope this will get some replys, again i am just asking for your opinion on this and not for a full working script ! :>
 
I sort of have this question too, except I created the code for the "insert" into the database. The only problem I'm having is the actual "posting." Here is my whole code to show the posts:


<?php

$_POST['date_stamp'] = date("M d, Y, h:i");
$topics['show_topics']['query'] = "SELECT * FROM topics WHERE parent='2'";
if ($topics['show_topics']['perform'] = mysql_query ($topics['show_topics']['query'])) {
while ($topics = @mysql_fetch_array ($topics['show_topics']['perform'])) {
echo "<div id='category'><div id='titlebar'>" . $topics['subject'] . "</div><div id='centerbar'>";
echo "<div id='titles'><table border='0'>"
."<tr>"
."<td>" . $HTTP_POST_VARS['date_stamp'] = $_POST['date_stamp'] . "</td>"
."<td width=280px>" . $topics['tid'] . "</td></tr>"
."<tr>"
."<td width=720px>" . $topics['content'] . "</td></tr>";
}
}
echo "</table></div>";mysql_close($con);

?>
 
1. That's your choice, but PHP is a great one to choose...:D
2. Need? Nope. You could have a file-based structure, although it's less usable as databases make queries simple (no file parsing, having to know the specific structure etc.) MySQL is another great choice.
3. I don't know, I guess this depends on you (or whomever writes the code). If it's done right: it sure will!
4. Always. The question is how difficult will it be? Again, that depends on your code. But in general, it'd be a snap - the simplest way that comes to mind - when putting the messages into the database, it could be fired off with PHP's mail( ) function.

This is one of the better first-time PHP scripts...try it...:)

@theone_trent
You probably want to make your own thread, but ... what problems are you having with 'posting'?
HTML Form->POST Variables->Store Data->Return to Main
As I see it above, your script has nothing to do with the 'posting' itself. ;) The one thing to note though, you want to set the time / date when the form is submitted (or when you enter the data into the database, etc.), as the user might have the page open and sitting for minutes, hours, days...
 
I'm having the return to main problem. When a user comes on to post, it stores it fine, but I can't get the board to show it.

I saw the date problem too, but I never stopped to fix that. Besides, it doesn't even show up on the board itself, so it's pretty much pointless there at this moment.

Here is the link to my board: Board Keep in mind that every script on here, I have created myself. This is not an ipb board or phpbb... this is my board? Anyways, I'll walk you through the problems I'm having...

You get on the board. Click Category. You see a lot of topics. You MAY add a topic. However, when you click on a topic, ALL of them go to the same topic id. (Problem 1). Say you click on any of the above topics, you go to the "topic." There you see one post that says "This is a test." Yay... the test worked, but when you click "Add Post" you really are adding a post, however, it will not show up on the board. (Problem 2).

Note* When viewing this site, be careful which links you click on. I transferred this board over from my old site to my new site, and haven't fixed all the links. So, watch your address bar and if you no longer read t1tweb.com, and read gwm.rctstop.com... you went the wrong way. Best solution is to press the back button.


I guess I can get my own topic, but I thought that this topic would be the same as mine... If a mod could split the topic that would be cool.
 
Yeah, I was just pointing out the date thing. :) On that topic, in the future before you get too far, I would highly recommend using the time() function - it is much easier to manipulate later on (eg, is the session valid? current_time - old_time, and the like.), and to go back to your stamp, you simply add it as a parameter to the date("format", $timestamp). Anyway, onward!

Well do you see problem #1's issue? There's no topic ID in the URL, they are all ?id=[blank]. So whatever you have filling the IDs needs a little tweaking.

Problem #2: So it's adding the message to the database, just your code to display it isn't working? First off, I guess I'd have to ask if it has the proper ID - I guess you're storing it in the session as it's not in the form. If that's not the problem, it has to be wherever you're getting the messages, and I can't really say much without seeing the code. :freak: Maybe problem #1 will help this...the database could be defaulting to the first entry or something.
 
Status
Not open for further replies.
Back
Top Bottom