Login   Register  
PHP Classes
elePHPant
Icontem

File: create_static_form.sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Uwe Stein  >  autoformBQ  >  create_static_form.sample.php  >  Download  
File: create_static_form.sample.php
Role: Example script
Content type: text/plain
Description: a example how to generate static forms via http-download
Class: autoformBQ
Generate Web forms from MySQL query results
Author: By
Last change:
Date: 2005-01-29 12:04
Size: 1,301 bytes
 

Contents

Class file image Download
<?php
header
("Content-Type: application/octet-stream");
header("Content-Disposition: ".(strpos($HTTP_USER_AGENT,"MSIE5.5")? "" "attachment;")."filename=static_form.html.txt");
?>


<html>
<head>
  <title>autoformBQ-Sample</title>
  <link rel="stylesheet" type="text/css" href="autoformBQ.css">
</head>
<body>
<?

require_once("autoformBQ.php");

/* Add your values here */
  
$db_server "localhost";
  
$db_database "serv";
  
$db_user "root";
  
$db_password "";

$conn = @mysql_connect($db_server,$db_user,$db_password);
if (
$conn)
   
mysql_select_db($db_database);

// define and execute your query
 
$sql 'SELECT test.* , test2.ggg, test2.id FROM test , test2  WHERE test.id = test2.id2';


$query "select * from test limit 1";
$result mysql_query($sql);
if (!
$result)
{  echo 
"kein ergebnis";
    exit;
}

// create the form-object
$form = new autoformBQ($conn,$result,"sample.action.php");
$form->headline("<h3 align=\"center\">Form with default settings:<br></h3>");
$form->set_style("checkbox");
// print the form
$form->bFormEdit TRUE;
$form->print_form();
//$form->print_form_data();
/*
$form->bFormEdit = TRUE;

echo "<br>";
$form2->bFormEdit = TRUE;
$form2->set_style("checkbox");
$form2->lang("de");

$form2->print_form();
$form2->print_form_data();

*/

?>

</body>
</html>