Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

table+form. help!!!!!!!!!

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Zan83
Smarty Rookie


Joined: 27 Oct 2006
Posts: 12

PostPosted: Fri Oct 27, 2006 11:34 am    Post subject: table+form. help!!!!!!!!! Reply with quote

how can I do a form into a table whit smarty?
Very Happy
Back to top
View user's profile Send private message
Hielke Hoeve
Smarty Elite


Joined: 06 Jan 2006
Posts: 406
Location: Netherlands

PostPosted: Fri Oct 27, 2006 1:00 pm    Post subject: Reply with quote

It has nothing to do with smarty, simply write the html tags. you can place the form outside or inside the table and its tr and td tags.
_________________
Debug XHTML Compliance
SmartyPaginate
Smarty License Questions
---
(About Unix) The learning curve is full of aha! moments, such as that glorious day that the full beauty of grep and, later, find is revealed in all its majesty. --- Robert Uhl <ruhl@4dv.net>
Back to top
View user's profile Send private message
Zan83
Smarty Rookie


Joined: 27 Oct 2006
Posts: 12

PostPosted: Fri Oct 27, 2006 1:23 pm    Post subject: Reply with quote

thank you of the advice.
Back to top
View user's profile Send private message
Zan83
Smarty Rookie


Joined: 27 Oct 2006
Posts: 12

PostPosted: Fri Oct 27, 2006 1:34 pm    Post subject: Reply with quote

IS IT RIGTH THIS?

nuovaAuto.php
<?
require "C:\Programmi\EasyPHP1-8\php\guestbook\setup.php";

$smarty = new Smarty_GuestBook();
$smarty->clear_all_cache();
$smarty->assign('casa','casa');
$smarty->assign('modello','modello');
$smarty->assign('km','km');
$smarty->assign('codice','codice');
$smarty-> assign('siono', array(
1=>"si",
0=>"no"
)
);

$smarty->assign('selezionato','1');
$smarty->display('nuovaAuto.tpl');
?>
---------------------------------

nuovaAuto.tpl:

<html>

<form method="GET" action="inserisci.php">

<b>Inserisci i dati della nuova auto</b>

<table>

<tr><td> {$casa|capitalize} </td><td><input type="text" name={$casa|capitalize}></td>
<tr><td> {$modello|capitalize} </td><td><input type="text" name={$modello|capitalize}></td>
<tr><td> {$km|capitalize} </td><td><input type="text" name={$km|capitalize}></td>
<tr><td> {$codice|capitalize} </td><td><input type="text" name={$codice|capitalize} size="3" MAXLENGTH=3 ></td>


<tr><td>Disponibile</td><td>{html_radios name="siono" options=$siono selected=$selezionato }</td>
</table>

<input type="submit" value=Inserisci>

</form>


</html>

------------------------
inserisci.php :

<?

require "C:\Programmi\EasyPHP1-8\php\guestbook\setup.php";
include("database.php");
$smarty = new Smarty_GuestBook();

$conn = new database;
$db = $conn->connetti();

?>

<html>

<?

print_r($HTTP_GET_VARS);
$casa = $HTTP_GET_VARS["Casa"];
$modello = $HTTP_GET_VARS["Modello"];
$km = $HTTP_GET_VARS["Km"];
$disponibile = $HTTP_GET_VARS["siono"];
$codice = $HTTP_GET_VARS["Codice"];

$sql = " INSERT INTO auto VALUES ('".$casa."','".$modello."','".$km."','".$disponibile."','".$codice."') ";

echo $sql;

$result = $db->query($sql);

if($result) { $smarty->assign('testo',"Inserimento completato");}
else {$smarty->assign('testo',"errore");}

$db->disconnect();


?>

</html>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP