Go Back   Flash Flash Revolution > General Discussion > Chit Chat
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 07-7-2007, 04:52 PM   #1
xjohnieboyx
FFR Player
FFR Veteran
 
xjohnieboyx's Avatar
 
Join Date: Feb 2006
Location: negev
Age: 34
Posts: 1,630
Send a message via AIM to xjohnieboyx Send a message via MSN to xjohnieboyx
Default Kind of... template

So I'm just asking here since I don't know where to look for one of these:

I want to have comments after a certain article that users can write and have it right under the article when they submit. This involves some CSS/Javascript I assume but I'm almost positive there has to be a template somewhere.

To be clearer, imagine an article, followed with a link to a window where they type their name, e-mail, and the actual comment, after which they'll hit submit and be redirected back to the article. Then, they'll be able to see their comment sitting right under the article, as will every other reader.


Please reply if I'm being unclear or if you could aid me... something of that nature
xjohnieboyx is offline   Reply With Quote
Old 07-7-2007, 10:35 PM   #2
g4z33b0
Banned
 
Join Date: Mar 2006
Location: Apex, NC
Age: 33
Posts: 2,618
Send a message via AIM to g4z33b0
Default Re: Kind of... template

Just get a free Wordpress account, they should have one somewhere on their site. Wordpress is really reliable and efficient, probably your best bet.
g4z33b0 is offline   Reply With Quote
Old 07-13-2007, 08:26 AM   #3
xjohnieboyx
FFR Player
FFR Veteran
 
xjohnieboyx's Avatar
 
Join Date: Feb 2006
Location: negev
Age: 34
Posts: 1,630
Send a message via AIM to xjohnieboyx Send a message via MSN to xjohnieboyx
Default Re: Kind of... template

Here's a page for reference
http://sing365.com/music/lyric.nsf/I...2572D7001700C6

If you scroll to the bottom you'll find the Reviews. That's what I want to make.

The question is: How?
xjohnieboyx is offline   Reply With Quote
Old 07-13-2007, 11:32 AM   #4
g4z33b0
Banned
 
Join Date: Mar 2006
Location: Apex, NC
Age: 33
Posts: 2,618
Send a message via AIM to g4z33b0
Default Re: Kind of... template

a form that feeds to a mysql database, using php i think i have like a template of something like that, i'll edit it in
g4z33b0 is offline   Reply With Quote
Old 07-15-2007, 12:49 PM   #5
Summerschool
~
Retired StaffFFR Veteran
 
Summerschool's Avatar
 
Join Date: Feb 2012
Posts: 320
Default Re: Kind of... template

Here is a really simple "template" that I just wrote. I didn't test it, so I don't know if would even work. Commented most of the php...
This would require a MySQL database with a table containing the fields title, name, email, content, time.

Code:
<?php
//connect to MySQL server
//localhost = server address
//user = MySQL username
//pass = MySQL password
$connection = mysql_connect("localhost", "user", "pass");
//select DB to use
mysql_select_db("comments_db");
//has someone submitted a comment?
if(isset($_POST['submit_button'])) {
	//get post values from form
	$name = $_POST['name_value'];
	$email = $_POST['email_value'];
	$title = $_POST['title_value'];
	$content = $_POST['content_value'];
	//add the comment to the database
	$query = "INSERT INTO comments_table (title, name, email, content, time) VALUES('".$title."','".$name."','".$email."','".$content."', '".time()."')";
	//did comment get added successfully?
	if(mysql_query($query)) {
		$submit_text = "Comment Added<br />";
	//if not lets tell them it failed
	} else {
		$submit_text = "Comment Failed<br />";
	}
}
//select all the comments from the database
$query = "SLEECT * FROM comments_table ORDER BY time";
$result = mysql_query($query);
//loop through all the comments and display them
while($comment = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<?php print($submit_text); ?>
<div style="border:1px solid #000;background:#CCC;width:200px;margin:2px;padding:2px;color:#FFF;">
<?php print($comment['title']); ?> - <?php if(!empty($comment['email'])) { ?><a href="mailto:<?php print($comment['email']); ?>"><?php print($comment['name']); ?></a><?php } else { print($comment['name']); } ?><br /><br />
<?php print($comment['content']); ?>
</div>
<?php } ?>
<form method="post">
Name: <input name="name_value" type="text"><br />
Email: <input name="email_value" type="text"><br />
Title: <input name="title_value" type="text"><br />
<textarea name="content_value" cols="30" rows="4"></textarea><br />
<input name="submit_button" type="submit" value="Submit">
</form>
Edit: BTW, this has no security, and shouldn't be used in a real site without modification.

Last edited by Summerschool; 07-15-2007 at 12:52 PM..
Summerschool is offline   Reply With Quote
Old 07-15-2007, 01:23 PM   #6
xjohnieboyx
FFR Player
FFR Veteran
 
xjohnieboyx's Avatar
 
Join Date: Feb 2006
Location: negev
Age: 34
Posts: 1,630
Send a message via AIM to xjohnieboyx Send a message via MSN to xjohnieboyx
Default Re: Kind of... template

Thanks a lot, Summerschool. I'm definitely going to study that. Maybe I'll PM you later.

Again, thanks.
xjohnieboyx is offline   Reply With Quote
Old 07-20-2007, 01:15 PM   #7
g4z33b0
Banned
 
Join Date: Mar 2006
Location: Apex, NC
Age: 33
Posts: 2,618
Send a message via AIM to g4z33b0
Default Re: Kind of... template

Here's the simple form code:

Code:
<form id="contact" name="contact" method="post" action="">
  <table width="600" border="0" align="center" cellpadding="5" cellspacing="0">
    <tr>
      <td width="110" valign="top" >Full Name:</td>
      <td width="470"><input name="name" type="text" id="fullname" size="30" value=""/></td>

    </tr>
    <tr>
      <td valign="top" >Email Address:</td>
      <td><input name="email" type="text" size="30" value=""/></td>
    </tr>
    <tr>
      <td valign="top" >Subject:</td>
      <td><input name="subject" type="text" size="30" value=""/></td>

    </tr>
    <tr>
      <td valign="top" >Message:</td>
      <td><textarea name="message" cols="60" rows="10" id="message"></textarea></td>
    </tr>
  </table>
  <p align="center">
    <input name="contact" type="hidden" value="contact" />

    <input type="submit" name="Submit" value="Submit" />
  </p>
</form>
But you probably already have that hah
g4z33b0 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 05:52 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution