Morning,
I'm trying to integrate SMARTY with my script, I've done most of it except my registration page if I used smarty the php code can't identify the info from my smarty tbl
Here's my php file :
require('libs/Smarty.class.php');
$smarty = new Smarty();
$smarty->setTemplateDir('libs/templates');
$smarty->setCompileDir('libs/templates_c');
$smarty->setCacheDir('libs/cache');
$smarty->setConfigDir('libs/configs');
$smarty->assign('usern', 'Username:');
$smarty->assign('userp', 'Password:');
$smarty->assign('userm', 'E-Mail:');
$smarty->assign('userrp', 'Re-Enter Your Password:');
$smarty->assign('usersiteurl', 'Site URL:');
$smarty->display('register_form.tpl');
}
Here's my template :
<form name="form1" method="post" action="register.php">
<table width="600" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="196">{$usern}</td>
<td width="388"><label for="username"></label>
<input type="text" name="username" id="username"></td>
</tr>
<tr>
<td>{$userm}</td>
<td><label for="email"></label>
<input type="text" name="email" id="email"></td>
</tr>
<tr>
<td>{$userp}</td>
<td><label for="password"></label>
<input type="password" name="password" id="password"></td>
</tr>
<tr>
<td>{$userrp}</td>
<td><label for="password_confirm"></label>
<input type="password" name="password_confirm" id="password_confirm"></td>
<tr><td>{$usersiteurl}</td>
<td><label for="site_url"></label>
<input type="text" name="site_url" id="site_url"></td>
</tr></tr>
<tr>
<td><input name="ip" type="hidden" value="<?php echo $_SERVER["REMOTE_ADDR"]; ?>"></td>
<input name="date" type="hidden" value="<?php echo date('d M Y - H:i'); ?>"></td>
<td><input type="submit" name="register" id="register" value="Register"></td>
</tr>
</table>
</form>
If I added this code directly to register_form.php the registration is working fine, But If I integrated it with SMART it doesn't make the register.php file able to read the post method so the file can't write to the database.