hi all
I am writing a small templating instruction and so far have everything
working neatly. I have a few queries I would like to run by you guys as
I'm having trouble finding the answer, I have looked in the usual places
and found nothing that helps.
each template sits in its own folder i.e.. themes/template1 or
themes/default. I am using a mysql row to define the template, which is
set at default to begin with and is outputted like so
-----------------------------------------------
function gl_header()
{
$sql = 'SELECT * FROM theme;';
$result = mysql_query($sql) or die('');
while ($row = mysql_fetch_assoc($result)){
$filename = "themes/".$row['theme']."";
if (file_exists($filename)) {
include "themes/".$row['theme']."/header.php";
} else {
include "themes/default/header.php";
}
}
}
-----------------------------------------------
this is where I'm getting slightly stuck. I have a small script that
will read the folder names from the template directory and output the
folder name as a url
-----------------------------------------------
function gl_themechooser()
{
$handle=opendir('./themes');
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && $file="<a href=\"$file\">$file</a>\n")
{
echo ".$file.";
}
}
closedir($handle);
}
-----------------------------------------------
I would like to know how to make this url update the mysql row when
clicked. I tried outputting them into a drop down box but a separate box
was created for each folder in the template directory and ii was unable
to solve this. any pointers on that would be great.
Thanks in advance
Mark M...
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/php-list/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/