Ok, got my templates all made in Dreamweaver 4, they look snazzy, now, I got a nice empty middle spot between two great menus, under a lovely header with an additional menu (menu's are in this time of year, you can never have too many!), and a great old fasioned text only footer (some java scripting to shnazzy it up down there a bit, but no images... just legal beagle bs and easy links).
I want that afformentioned nice empty middle part (named "center" in the template) to be filled with a news poster.
I've found several codes that half work before crashing, or are too insecure that it leaves things open to tampering. Without resorting to PHP Nuke (*shudder*, all the same identical sites with different colors and graphics... scary stuff!!!), or taking some code off of a website (which is lamer than anything in the world). I would love to create a news poster, with administrative functions and user comments. I dont want any free open source, pre-fab news posters... I want to know how to make one my self, and, seeing as some of the best programmers out there flock to this place (as I've seen from other lacksidasical forums) I thought it would be the most logical and educationally profitable thing to do and post my needs and questions here...
So...
In a brief tutorial with good explanations and database creation instructions I would like a PHP News Poster. You can direct me to tutorials, but I'm sure, beyond sureness that I've seen them all before...
Thanks in advance, and hopefully I wont be asking newbie questions much longer...
Cheers,
-=(v)=-
Newbie Question: Templates - How Do I get A News Post?
Moderator: General Moderators
-
Mephisto Nightbane
- Forum Newbie
- Posts: 3
- Joined: Wed Jan 08, 2003 2:20 am
- Location: The Nightlands
- Contact:
then it's like the sesame street story where someone bringing a unique item the evil overlord does not possess' could free the land 
My unique item is: http://www.tutorialfind.com/tutorials/d ... submit.y=0
My unique item is: http://www.tutorialfind.com/tutorials/d ... submit.y=0
-
Mephisto Nightbane
- Forum Newbie
- Posts: 3
- Joined: Wed Jan 08, 2003 2:20 am
- Location: The Nightlands
- Contact:
>.>
<.<
Luke (You)... Thank you for slaying the evil dark sith overlord (Stupidity) and freeing the people (Me) from the Empire's (Ignorance) grip!
^_-
Thanks... Really helped meh!
However...
I need to know how to impliment an administrative part, this tells me how to load the news and what not, but not how to input it through an admin panel.
If you or anyone can help with this problem... I would much appreciate it.
<.<
Luke (You)... Thank you for slaying the evil dark sith overlord (Stupidity) and freeing the people (Me) from the Empire's (Ignorance) grip!
^_-
Thanks... Really helped meh!
However...
I need to know how to impliment an administrative part, this tells me how to load the news and what not, but not how to input it through an admin panel.
If you or anyone can help with this problem... I would much appreciate it.
what do you have so far?
One (very simple) approach is to put each post into its own form with the post-id (from the db), the message in a textarea and two submit buttons (one for edit, one for delete) when in admin mode (+ an empty form with no id-field for new posts, maybe on top of the 'list'). e.g.in this example the login information ship within the forms as hidden fields (aU and aP), but hey, it's only a simple example 
Only the value of the submit-button pressed will be transmitted so you can decide which action to take
$_POST['mode']=='edit'
"UPDATE news set msg='$_POST[message]' WHERE id=$_POST[postId]"
$_POST['mode']=='delete'
"DELETE FROM news WHERE id=$_POST[postId]"
a look at
http://www.php.net/manual/en/function.htmlentities.php
http://www.php.net/manual/en/function.m ... string.php
is madatory, too
One (very simple) approach is to put each post into its own form with the post-id (from the db), the message in a textarea and two submit buttons (one for edit, one for delete) when in admin mode (+ an empty form with no id-field for new posts, maybe on top of the 'list'). e.g.
Code: Select all
<?php
...
while($row = mysql_fetch_row($result))
{ ?>
<form action="news.php" method="POST">
<input type="hidden" name="postId" value="<?php echo $row[0]; ?>" />
<input type="hidden" name="aU" value="<?php echo $_POST['aU']; ?>" />
<input type="hidden" name="aP" value="<?php echo $_POST['aP']; ?>" />
<textarea name="message"><?php echo $row[1]; ?></textarea>
<input type="submit" name="mode" value="edit" />
<input type="submit" name="mode" value="delete" />
</form><?php
}
...
?>Only the value of the submit-button pressed will be transmitted so you can decide which action to take
$_POST['mode']=='edit'
$_POST['mode']=='delete'
a look at
http://www.php.net/manual/en/function.htmlentities.php
http://www.php.net/manual/en/function.m ... string.php
is madatory, too