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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.