need help finding a script or tool to use for a news update program.

Reply

Join Date: Mar 2005
Posts: 6
Reputation: jilly is an unknown quantity at this point 
Solved Threads: 0
jilly jilly is offline Offline
Newbie Poster

need help finding a script or tool to use for a news update program.

 
0
  #1
Mar 20th, 2005
I made a basic website for my sons' garage band, and they want on the front page to have a box that the four of them can update with the 'latest news' - so I want it to be something they's have to log in to use, or at least enter a password to get into, and then have the 'news' they post show up on the front page of their site. Right now the page is an index.html page. I am thinking that PhP can probably do this pretty easily, but I dont know where to find a script about it, or how to configure it so that it will show the latest news articles on the home page.. Any directions or ideas?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 348
Reputation: paradox814 is an unknown quantity at this point 
Solved Threads: 4
paradox814's Avatar
paradox814 paradox814 is offline Offline
Posting Whiz

Re: need help finding a script or tool to use for a news update program.

 
0
  #2
Mar 20th, 2005
do you have access to a database? if so then i wouldn't bother with loggin in, as that would be too much work for the sole purpose of adding latest news.
Create a new php page with a form use that has everything you want, and then just put a password field as one of the inputs, if the password isn't correct then don't update. if the password is correct then add it to the database.
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 234
Reputation: PoA is an unknown quantity at this point 
Solved Threads: 8
PoA PoA is offline Offline
Posting Whiz in Training

Re: need help finding a script or tool to use for a news update program.

 
0
  #3
Mar 20th, 2005
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 6
Reputation: jilly is an unknown quantity at this point 
Solved Threads: 0
jilly jilly is offline Offline
Newbie Poster

Re: need help finding a script or tool to use for a news update program.

 
0
  #4
Mar 21st, 2005
woohoo, thanks!

Paradox, what you have posted is a bit beyond my current ability without some handholding - I will probably try the links in the next post, if not I may come back and ask you to hold my hand while walking through the php page!!
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 50
Reputation: barnamos is an unknown quantity at this point 
Solved Threads: 0
barnamos's Avatar
barnamos barnamos is offline Offline
Junior Poster in Training

Re: need help finding a script or tool to use for a news update program.

 
0
  #5
Mar 22nd, 2005
Database is really made for this but if you have no db, you can get pretty creative and use fopen & fwrite to write a text file to your server. The password dealy mentioned above would help as a simple authentication, nothing happens if password isn't right. So if you have a form input named mytext...

$file_name = fopen("/path/to/homedir/myfile.txt","w+");
$file = $HTTP_POST_VARS["mytext"];
fwrite($file_name,$file);
fclose($file_name);

Then your page could include the text file.
<? include 'myfile.txt'; ?>

You might make a blank file on the server to get started. Also make sure apache can write to it!!!

Good luck
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 6
Reputation: jilly is an unknown quantity at this point 
Solved Threads: 0
jilly jilly is offline Offline
Newbie Poster

Re: need help finding a script or tool to use for a news update program.

 
0
  #6
Mar 23rd, 2005
I have access to mysql databases, so I could do that, but the problem is that the only database and php I know so far came from admin'ing my vbulletins and hacking them.. LOL - I don't really know how to do one from scratch. Also the main home page is an index.html file, and I need to turn it into an index.php file I think - and I am not sure how to do that... D'oh! Any more advice??
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 50
Reputation: barnamos is an unknown quantity at this point 
Solved Threads: 0
barnamos's Avatar
barnamos barnamos is offline Offline
Junior Poster in Training

Re: need help finding a script or tool to use for a news update program.

 
0
  #7
Mar 23rd, 2005
Originally Posted by jilly
I have access to mysql databases, so I could do that, but the problem is that the only database and php I know so far came from admin'ing my vbulletins and hacking them.. LOL - I don't really know how to do one from scratch. Also the main home page is an index.html file, and I need to turn it into an index.php file I think - and I am not sure how to do that... D'oh! Any more advice??
Aha, you're in good shape then. You can just rename your page index.php and you won't know any difference until you start to add some actual php tags.

you'll need to do 2 things...

1) Put data in

As far as getting the data in, you'll need make a database table to store this data. Hopefully you have access to phpMyAdmin or a Webmin/UserMin access to MySQL. Get there, and make a table. Something simple, say name it content and have one field called text and use another as the id. You probably can do that through whatever web interface or find a place to give a SQL command of:

CREATE TABLE `content` (
`id` INT( 4 ) NOT NULL AUTO_INCREMENT ,
`text` TEXT NOT NULL ,
PRIMARY KEY ( `id` )
);

Then make a new php page on your site, say called input.php. This page will have the form and also the action part of inputting the text.

input.php would look something like this.
<?
if ($submit && ($password == "kidspassword)) {
// let me talk to the database using my mysql username and mysql password
$myconnect = mysql_connect("localhost","username","password");
mysql_select_db("databasename",$myconnect); // not tablename but db name

mysql_query("REPLACE INTO content ('id','text') VALUES ('1','$text')
or die(mysql_error());

echo "Did it!";?>
<html><body>
<form>
Input the text for the page:
<textarea name="text" cols="20" rows="5"></textarea>
Password: <INPUT type="password" name="password">
<INPUT type="submit" name="submit"></form>
</body></html>

You can add additional areas by duplicating and changing the 1 to a 2 or whatever.

2) Get data out

On index.php..

<? // again let me talk to the database
$myconnect = mysql_connect("localhost","username","password");
mysql_select_db("databasename",$myconnect); // not tablename but db name
?><html><body>

etc etc
<? // Pull text out and make purty
$my_text = mysql_result(mysql_query("SELECT text FROM content
WHERE id = '1' "),0);
echo nl2br(stripslashes($my_text));
?>
etc </body></html>

The nl2br will put <br/> tags in on each line break and the stripslashes will take out any \' or \" that find their way in.

Untested and untried but worth every penny you paid for it!









Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 6
Reputation: jilly is an unknown quantity at this point 
Solved Threads: 0
jilly jilly is offline Offline
Newbie Poster

Re: need help finding a script or tool to use for a news update program.

 
0
  #8
Mar 25th, 2005
Thanks barnamos - I am going to try this this weekend and see if I can get it to work!!
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 13
Reputation: kiwisites is an unknown quantity at this point 
Solved Threads: 0
kiwisites kiwisites is offline Offline
Newbie Poster

Re: need help finding a script or tool to use for a news update program.

 
0
  #9
Jan 17th, 2008
Oh My my.. why use PHP, Database and do so much truble...

HOw about getting it using Javascript AJAX script.. with a simple TEXT FILE...
yes...

Check this site http://www.inspiringourchildren.info/

And the source code is available at
http://www.dynamicdrive.com/dynamici...ajaxticker.htm

Regards
Kiwi
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,738
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 330
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: need help finding a script or tool to use for a news update program.

 
0
  #10
Jan 17th, 2008
You bumped into a 2.5 yr old thread !
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC