473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

fasttemplate with drop down box

HI

I am trying to build a page using the fasttemplate class.

I am having problems getting it to populate a drop down menu using the templating

I read words from a text file and I read them into array, which I loop around and set to the template

all i am gettin is multiple drop down boxes being printed out, with a single word in each


anyhelp would be greatly appreciated

cheers
boyindie


here is my html
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <title>Forum Engine</title>
  6. </head>
  7. <body>
  8. <div id="contentdiv">
  9. <table border="0" id="tblWords">
  10.     <tr>
  11.         <td>
  12.  
  13.             {LIST}
  14.  
  15.         </td>
  16.  
  17.         <td align="center" valign="middle">
  18.             <image />
  19.             <br />
  20.             <image src2();"/>
  21.         </td>
  22.  
  23.         <td>
  24.         <select id="acceptWords" name="sel2" size="10" multiple="multiple"></select>
  25.         <input type="button" value="Create Links" onClick="createLinks();">
  26.         </td>
  27.  
  28.     </tr>
  29. </table>
  30.  
  31. </div>
  32. </body>
  33. </html>
Expand|Select|Wrap|Line Numbers
  1. <select id="wordlist" name="sel1" size="10" multiple="multiple">
  2. <option value="{OPTIONS}">{OPTIONS}</option>
  3. </select>

and my PHP code is as follows

[PHP]<?php
include_once ("class.FastTemplate.php");
class getFile
{

public function getFile()
{
$this->TPL= $tpl;
}


public function getWords()
{
$this->TPL = new FastTemplate("./tpl");
$this->TPL->define(array("file_name"=>"getfile.html",
"word" =>"table_Words.tpl.html"));
// Get URL and div
if (!isset($_GET['file']))
{
echo "File not specified.";
}
else
{
if (!isset($_GET['url']))
{
echo "url not specified to return to";
}

else
{
$file =urldecode($_GET['file']);echo"<br>";
$url = urldecode($_GET['url']);

if (substr($url, 0, 4) != 'http')
{
// Set error
echo 'Invalid File - '.$file;
return false;
}
else
{
$text = file_get_contents($file);
$array = split(";",$text);
for($i=0; $i<=count($array);$i++)
{
$this->TPL->assign(OPTIONS,$array[$i]);
$this->TPL->parse("LIST",word);
}
$this->TPL->parse(PAGE,file_name);
$this->TPL->FastPrint(PAGE);
}
}
}
}
}
?>[/PHP]
Feb 12 '08 #1
1 1209
dlite922
1,584 Expert 1GB
HOW 'BOUT SMARTY ?

You're using a oblique class written by some fella that is not so popular.

At times like this, If you can't ask the guy who wrote it, you're out of luck.

Smarty, however, has an incredible manual and many people are familiar with it.

Let us know what you decide,



Dan
Aug 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Useko Netsumi | last post by:
Where can I download? Is it in active development? Thanks
0
by: Piotr | last post by:
I have just uploaded page based on FastTemplate to my virtual server. Page generate data from MySQL base. Everythink is OK on my and several my friend's machines. But one of my friend has error on...
6
by: PT | last post by:
I got a form with many text boxes, checkboxes and 3 drop downs. From that 3, 2 are dependant. I can choose one drop down, and the next drop down should display the dependant values of the first...
2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
3
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.