Jump to content

smarty-> submit form


cybernet

Recommended Posts

i would like to create a posting page just like this form i'm writing now

including return ( <br/> ) pagination, and language codes ( php mysql c++ c# ... etc  without affecting site security )

 

are there any good tutorials i can follow or any advice ?

i'm very new to smarty and i have only basic php knowledge

 

to prove that i'm not lazy and i read the documentation this is what i got so far

 

<?php


require('../dev0_inc/smarty/Smarty.class.php');
require('../dev0_inc/config/ride_mysql.php');


$smarty = new Smarty;
$smarty->error_reporting = E_ALL & ~E_NOTICE;

// $smarty->debugging = true;
$smarty->caching = false;
$smarty->cache_lifetime = 120;
// setConfig for *.conf files
$smarty->setConfigDir('../dev0_inc/config');

// $smarty->

// sqL

$result = mysql_query("SELECT * FROM posts ORDER BY `id` DESC LIMIT 0 , 50") or die(mysql_error());
// For each result that we got from the Database
while ($line = mysql_fetch_assoc($result))
{
$value[] = $line;
}

// Assign this array to smarty...
$smarty->assign('posts', $value);

$config['cyber_date'] = '%d %b %y, %T';

$smarty->assign('config', $config);


$smarty->display('index.tpl');

?>

 

and i'm using phpmyadmin to insert data

 

so far i read from documentation that i have to escape the assign values, but i don't know if it's secure :shy:

using smarty 3.1.1, thanks for reading - cybernet

Link to comment
https://forums.phpfreaks.com/topic/247980-smarty-submit-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.