You are here: Using arrays « PHP Programming Language « IT news, forums, messages
Using arrays

Posted by phill.luckhurst@googlemail.com on 09/13/07 09:42

I'm quite new to PHP so please spoone feed me here.

I'm trying to generate a list of URLs from a directory to feed into a
slideshow but I'm completely stumped as to how to do it. I've been
given the following code to generate a list of 15 URLs with the right
extension but what do I do with it now?

[code]
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$xml = '<image_folder></image_folder>';
if ($FORBIDDEN_SET != "") $FORBIDDEN_SET = "AND $FORBIDDEN_SET";
$result = mysql_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} AS p
WHERE filename LIKE '%.jpg' $FORBIDDEN_SET ORDER BY RAND() LIMIT 15");
while ($row = mysql_fetch_array($result))
{
$type = 'normal';
$xml .= "".get_pic_url($row, $type) ."";
}
echo $xml;



?>
[/code]

That bit displays a nice list of URLs for me but I need to feed them
into this second script where $URL would be the one of the URLs
selected in order from the list generated from the first script.

[code]
<?php

//include slideshow.php in your script
include "slideshow.php";

//add 15 slides
for ( $i=0; $i<15; $i++ ){
$slideshow[ 'slide' ][ $i ] = array ( 'url' => $URL );
}

//send the slideshow data
Send_Slideshow_Data ( $slideshow );

?>
[/code]

As I said, I'm very new to this so I m probably barking up totally the
wrong tree.

I'm also running out of hair trying to work out how to do this.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация