|
-
May 4th, 2003, 10:12 PM
#1
Thread Starter
Fanatic Member
News script, how?
I want to make a news script, simple, it just gets the news, and username and add's it, right now it works fine but I have to feed it the info, how do I make it so the admin can update it without touching the php/html files? (updating by logging in and filling out forms).. this is what I have so far:
on the main page, it has include('news.php'); and news.php is here
Code:
<?php
//The new content will normally be sent from the user.
$NewContent = <<<NC
<pre>
Yo I'm getting way too good with PHP
son, If I make **** it actually wErks now.
I'll try to like, make a **** to add news
dynamically, without editing files, still
working on how the format of the news will
be.. also need to get soMe things fixed up.
</pre>
NC;
$nick = 'scr0p';
$name = "<a href=\"mailto:[email protected]\">$nick</a>";
$date1 = date ("l F Y h:i A");
$table_head = <<<TH
<tr>
<td width="352" height="11"><font size="2" face="Fixedsys">Posted by: $name on $date1
</font>
</tr>
<tr>
<td width="352" height="139" valign="top" bgcolor="#E6E6E6">
TH;
$table_tail = <<<TT
</tr>
TT;
//Ok ok, we got all the info we need to add the news, now lets add it-_-
print '<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="352" height="154">';
print $table_head;
print $NewContent; //This will be what the user puts..
print $table_tail;
print '</table>';
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|