The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Using GET to display five specific entries on my website - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: Using GET to display five specific entries on my website (/showthread.php?tid=1291)



Using GET to display five specific entries on my website - alexh - May 10th, 2011

Here's my next project, and I'm looking for input on how to do it:

I've created a form, and would like to do display five of the form entries on an html page.

My idea is that I will create a php page that will pull the specific fields from five entries, and format the fields with CSS/HTML, to display them the way I want.

I would like a user to be able to log in and select which entries display, and which do not... maybe with a checkbox.

So I would imagine I would need to write a page that would pretty much say 'if that checkbox is checked, then show on this page.. in this format'. That php page would then be used as php-include on the main page of our website.

Is that even possible?

If so, does anyone have some example code I could use that at least displays form fields on a php page? I looked at the tutorial but couldn't get it to work.

Thanks!
Alex


RE: Using GET to display five specific entries on my website - alexh - May 12th, 2011

So here is what I have figured out so far. I set up the form with formtools. I created an additional field that is a checkbox. The checkbox is not on the form, just editable from the backend when editing the results in formtools.

I then created a php page with the following attached code. Basically it says that if a certain field is equal to "1" (the checkbox), then show the data. (In other words, when the checkbox is checked, the data appears on the below page) The problem is, I'd like it to display each set of data in a different html table.. not as another row in the table.

Any ideas?

PHP Code:
<html>
<
body>
<?
php
$username
="USERNAME";
$password="PASSWORD";
$database="DATABASE";

mysql_connect(localhost,$username,$password);
@
mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM ft_form_12 WHERE col_24='1'";
// $query="SELECT * FROM ft_form_12";
// SELECT * FROM ft_form_12 WHERE col_24='1'
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();
?>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<th><font face="Arial, Helvetica, sans-serif">Value1</font></th>
<th><font face="Arial, Helvetica, sans-serif">Value2</font></th>
<th><font face="Arial, Helvetica, sans-serif">Value3</font></th>
<th><font face="Arial, Helvetica, sans-serif">Value4</font></th>
<th><font face="Arial, Helvetica, sans-serif">Value5</font></th>
</tr>

<?php
$i
=0;
while (
$i $num) {

$f1=mysql_result($result,$i,"col_1");
$f2=mysql_result($result,$i,"col_2");
$f3=mysql_result($result,$i,"col_3");
$f4=mysql_result($result,$i,"col_4");
$f5=mysql_result($result,$i,"col_5");
?>

<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f4?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f5?></font></td>
</tr>

<?php
$i
++;
}
?>
</table>
</body>
</html>