Home News Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Any php coders out there?


You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion

Any php coders out there?
Reply
 
Thread Tools
Old 21-11-2009, 14:21   #1
Mr Angry
Angry is as angry does..
 
Mr Angry's Avatar
 
Join Date: Jan 2006
Location: Belfast
Posts: 2,594
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Any php coders out there?

Can anyone recommend a ready made "news" script?

One that shows a list of headlines which once clicked opens up the relevant story.

Any tips / pointers much appreciated.
__________________

"Exercising the right to exorcise the right".

Mr Angry is offline   Reply With Quote
Old 21-11-2009, 14:47   #2
punky
Eric Cartman Wannabe
 
punky's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 28
Services: c:\> net start punky
Posts: 13,728
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
Re: Any php coders out there?

I've never used a 3rd party one, so I can't recommend one in particular. I'm sure there are a few about if you Google, just see which works best.

If you want to tweak one or build your own, gimme a shout.

If you did want to build your own, the direction you should be looking at is parsing XML: http://uk.php.net/manual/en/book.xml.php

Headlines generate a RSS feed which is in XML (specially formatted text). You load this and parse the information you want out of it.
__________________
"We're not here for a long time, we're here for a good time" - (Mike Ness / Social Distortion)

Last edited by punky; 21-11-2009 at 14:50.
punky is offline   Reply With Quote
Old 21-11-2009, 16:20   #3
Mr Angry
Angry is as angry does..
 
Mr Angry's Avatar
 
Join Date: Jan 2006
Location: Belfast
Posts: 2,594
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Re: Any php coders out there?

Quote:
Originally Posted by punky View Post
I've never used a 3rd party one, so I can't recommend one in particular. I'm sure there are a few about if you Google, just see which works best.

If you want to tweak one or build your own, gimme a shout.

If you did want to build your own, the direction you should be looking at is parsing XML: http://uk.php.net/manual/en/book.xml.php

Headlines generate a RSS feed which is in XML (specially formatted text). You load this and parse the information you want out of it.
Punky, dependable as ever!!

PM* en route.


* This is not meant to infer that I am sending Gordon Brown round to Punky's - it's interweb "shorthand" for "private message".
__________________

"Exercising the right to exorcise the right".

Mr Angry is offline   Reply With Quote
Old 21-11-2009, 16:44   #4
punky
Eric Cartman Wannabe
 
punky's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 28
Services: c:\> net start punky
Posts: 13,728
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
Re: Any php coders out there?



Lemme try and knock up something for ya.

---------- Post added at 15:44 ---------- Previous post was at 15:34 ----------

BTW, what version PHP do you use?
__________________
"We're not here for a long time, we're here for a good time" - (Mike Ness / Social Distortion)
punky is offline   Reply With Quote
Old 21-11-2009, 17:07   #5
Mr Angry
Angry is as angry does..
 
Mr Angry's Avatar
 
Join Date: Jan 2006
Location: Belfast
Posts: 2,594
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Re: Any php coders out there?

Blue?
__________________

"Exercising the right to exorcise the right".

Mr Angry is offline   Reply With Quote
Old 21-11-2009, 17:14   #6
punky
Eric Cartman Wannabe
 
punky's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 28
Services: c:\> net start punky
Posts: 13,728
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
Re: Any php coders out there?

Create a .php file which says this:

PHP Code:
<?php

phpinfo
();

?>
open it and read what it says at the top.
__________________
"We're not here for a long time, we're here for a good time" - (Mike Ness / Social Distortion)
punky is offline   Reply With Quote
Old 21-11-2009, 18:56   #7
Mr Angry
Angry is as angry does..
 
Mr Angry's Avatar
 
Join Date: Jan 2006
Location: Belfast
Posts: 2,594
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Re: Any php coders out there?

5.2.10

Like I said, "Blue".
__________________

"Exercising the right to exorcise the right".

Mr Angry is offline   Reply With Quote
Old 21-11-2009, 19:50   #8
punky
Eric Cartman Wannabe
 
punky's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 28
Services: c:\> net start punky
Posts: 13,728
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
Re: Any php coders out there?

PHP 5 makes life a lot easier.

Have you tried this, it looks pretty good.

http://www.scriptol.com/rss/rss-reader.php
__________________
"We're not here for a long time, we're here for a good time" - (Mike Ness / Social Distortion)
punky is offline   Reply With Quote
Old 21-11-2009, 20:28   #9
Mr Angry
Angry is as angry does..
 
Mr Angry's Avatar
 
Join Date: Jan 2006
Location: Belfast
Posts: 2,594
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Re: Any php coders out there?

Certainly looks "dinky" but I'm looking something which lists headlines as links which open news story pages when clicked.

A simple admin interface where the admin types in the date, headline and content. submits it and hey presto! a link appears.

PM (not Gordon Brown) en route.
__________________

"Exercising the right to exorcise the right".


Last edited by Mr Angry; 21-11-2009 at 20:32.
Mr Angry is offline   Reply With Quote
Old 21-11-2009, 21:16   #10
Callumpy
Killed You
 
Callumpy's Avatar
 
Join Date: Jul 2007
Location: Chavy Derbyshire
Age: 15
Services: Dell XPS 420..... Internet: Be* Pro 24Mbps Phone: HTC Touch Diamond 2 TV: 32" + Xbox 360 Elite
Posts: 1,468
Callumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant futureCallumpy has a brilliant future
Send a message via MSN to Callumpy Send a message via Yahoo to Callumpy Send a message via Skype™ to Callumpy
Re: Any php coders out there?

Quote:
Originally Posted by Mr Angry View Post
Certainly looks "dinky" but I'm looking something which lists headlines as links which open news story pages when clicked.

A simple admin interface where the admin types in the date, headline and content. submits it and hey presto! a link appears.

PM (not Gordon Brown) en route.
Wordpress? (like my site)
__________________
Gamertag - Callumpy
Callumpy is offline   Reply With Quote
Old 21-11-2009, 23:14   #11
webcrawler2050
Bored much?
 
webcrawler2050's Avatar
 
Join Date: Feb 2008
Location: Swindon
Services: 10MB V XL TV iPhone 3GS
Posts: 2,913
webcrawler2050 has reached the bronze age
webcrawler2050 has reached the bronze agewebcrawler2050 has reached the bronze agewebcrawler2050 has reached the bronze agewebcrawler2050 has reached the bronze agewebcrawler2050 has reached the bronze agewebcrawler2050 has reached the bronze age
Send a message via MSN to webcrawler2050
Re: Any php coders out there?

http://cutephp.com/ is pretty decent. Been around for a long time aswell, i've used it in the past and has worked a treat.
__________________
What to put here?- http://www.facebook.com/webcrawler2050
webcrawler2050 is offline   Reply With Quote
Old 22-11-2009, 00:45   #12
punky
Eric Cartman Wannabe
 
punky's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 28
Services: c:\> net start punky
Posts: 13,728
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
Re: Any php coders out there?

Quote:
Originally Posted by Mr Angry View Post
Certainly looks "dinky" but I'm looking something which lists headlines as links which open news story pages when clicked.

A simple admin interface where the admin types in the date, headline and content. submits it and hey presto! a link appears.

PM (not Gordon Brown) en route.
Ahh I see what you mean.

I was taking the "news" bit too literally. I thought you wanted to stream headlines from BBC News or something.

Easiest way is to do this:

Create a database table (with phpMySql is easiest) . You need the following fields (as a minimum) with the data type in brackets.

Quote:
id (int) & auto increment
headline (varchar)
content (longtext)
date (datetime)
Or import this SQL:

Code:
CREATE TABLE IF NOT EXISTS `headlines` (
  `id` int(11) NOT NULL auto_increment,
  `headline` varchar(100) NOT NULL default '',
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `content` longtext NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
Then you need to create 3 files:

connect.php - This stores the database username/password and makes the connection

PHP Code:
<?php

$username 
"your_username";
$password "your_password";
$database "your_database";

mysql_connect("localhost",$username,$password)
    OR die(
mysql_error());

mysql_select_db($database);
?>
admin.php - This allows you to add new news articles.

PHP Code:
<html>
    
<h1>Admin page...</h1>

<?php

// Connect to database
include("connect.php");

// Check if you are submitting a new headline
if (isset($_POST['submit']))
{
    
    
// Build the INSERT query
    
$sql "INSERT INTO headlines (`date`, `headline`, `content`) VALUES('" date("Y-m-d H:i",time()) . "','" mysql_real_escape_string($_POST['headline']) . "','" mysql_real_escape_string($_POST['content']) . "')";
    
    
$result mysql_query($sql);
    
    if (
mysql_affected_rows() > 0)
    {
        echo (
"<h2>Headline submitted.</h2><br /><br />");
    }
    else
    {
        echo (
"Headline NOT submitted because: " mysql_error());
    }
    
        
}

// Otherwise create a new headline

// Create form to submit to back to this page
?>
<form action="<?php echo($SERVER['PHP_SELF']); ?>" method="post">
<table>
    <tr><td>Headline</td><td><input type="text" name="headline" id="headline" size="100" /></td></tr>
    <tr><td>Content</td><td><textarea name="content" id="content" cols="100" rows="20"></textarea></td></tr>
    <tr><td colspan="2" style="text-align:center;"><input type="submit" name="submit" id="submit" value="Add headline" /></td></tr>
</table>
</form>
</html>
headlines.php - This shows all the headlines if no parameter is passed or a specified headline if one is.

PHP Code:
<html>
    <head>
        <!-- You need this bit to wrap the headline content properly -->
        <style>
            pre {
                font-family:Times New Roman;
                white-space: pre-wrap; /* css-3 */
                white-space: -moz-pre-wrap /* Mozilla, since 1999 */
                white-space: -pre-wrap; /* Opera 4-6 */
                white-space: -o-pre-wrap; /* Opera 7 */
                word-wrap: break-word; /* Internet Explorer 5.5+ */
            }
        </style>
    </head>
    
    <h1>List of headlines</h1>
<?php

// Connect to database
include("connect.php");

// Check whether to view a single news story or a list of headlines
if (isset($_GET['h']))
{
    
// Show headline
    
$sql "SELECT * FROM headlines WHERE id = " $_GET['h'];
    
    
$query mysql_query($sql);
    
    
$row mysql_fetch_array($query);
    
    echo (
"<div style=\"width:500px;\"><h2>" $row['headline'] . "</h2></a>Published: " date("d/m/Y G:i"strtotime($row['date'])) . "<br /><pre>" $row['content'] . "</pre></div>");
        
    
}
else
{
    
// Show headlines
    
$sql "SELECT * FROM headlines ORDER BY date DESC;";
    
    
$query mysql_query($sql);
    
    while(
$row mysql_fetch_array($query))
    {
        echo (
"<a href=\"headlines.php?h=" $row['id'] . "\"><h2>" $row['headline'] . "</h2></a>Published: " date("d/m/Y G:i"strtotime($row['date'])) . "<br />");
        
        
// Handle preview (first 100 characters)
        
if (strlen($row['content']) > 100)
        {
            echo (
substr($row['content'],0,100) . "...");
        }
        else
        {
            echo (
$row['content']);
        }
        
        echo 
"<hr />";
        
    }
    
}


?>

</html>
Bear in mind this is the bear minimuim you would need with no style formatting. You'll probably want to add in author and paging but this will get you going.

Anything else you need or anything explaining, lemme know.

Edit: As Callumpy said you can use Wordpress or similar. They can be hard work to merge into an existing site so might not gain any time savings.
__________________
"We're not here for a long time, we're here for a good time" - (Mike Ness / Social Distortion)

Last edited by punky; 22-11-2009 at 00:54.
punky is offline   Reply With Quote
Old 22-11-2009, 01:13   #13
Mr Angry
Angry is as angry does..
 
Mr Angry's Avatar
 
Join Date: Jan 2006
Location: Belfast
Posts: 2,594
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Mr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny starMr Angry has a nice shiny star
Re: Any php coders out there?

Sex on a stick.

I'll have a blast at these later today.
__________________

"Exercising the right to exorcise the right".

Mr Angry is offline   Reply With Quote
Old 24-11-2009, 02:49   #14
Hiroki
- Israel's Son -
 
Hiroki's Avatar
 
Join Date: Feb 2008
Location: Newcastle
Services: Freeview, Freesat, Virgin. 10mb broadband/3gb 3 dongle.
Posts: 780
Hiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant futureHiroki has a brilliant future
Send a message via MSN to Hiroki
Re: Any php coders out there?

As you guys are talking about php I was wondering if someone would be able to help me as I am a total novice when it comes to php/html.

I was wondering if it would be possible to make a page on my website where people can upload a file using my ftp details (which is pre-entered into the coding) and then once it’s done get transferred to a page (in folder view) of all uploaded files?

I have no idea in the slightest how to do this (or even if it can be dones) so does anyone know how to do it? Or can anyone point me in the direction of a pre-made script that I can use?

Thanks

Hiroki is offline   Reply With Quote
Old 24-11-2009, 08:54   #15
Strzelecki
Programming Monkey
 
Join Date: Jan 2004
Location: Between Somerset and Essex
Age: 27
Services: 8MB Office MAX on Freeola, Freeview, Freesat
Posts: 860
Strzelecki has reached the bronze age
Strzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze ageStrzelecki has reached the bronze age
Re: Any php coders out there?

Yes that can be done using the built in FTP functions PHP has. However you would be much better using the HTTP Post method but this may restricted as to the size of files you can upload. Depending on what level of access to the server you have this may be adjustable.
There are also free Java file uplad applets out there that can display the local and remote folder tree and upload over FTP or HTTP POST. These can be embedded into a HTML page.
__________________
www.strzelecki.co.uk
www.sagemhelp.info Help, advice and discussion about Sagem mobiles.
Exmoor Explorer On yer bike!
Strzelecki is offline   Reply With Quote
Reply


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

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Links
Google
 
Web www.cableforum.co.uk


All times are GMT +1. The time now is 06:57.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2
Copyright © 2003 - 2010, Cable Forum.
(server1.cableforum.co.uk)