Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {include file='globalheader.tpl'}
- <div id="xx">
- <form action="handler.php" method="post" >
- <input type="number" name="barcode" value="1" />
- <input type="submit" value="Submit" name="submit" />
- </form >
- </div>
- {include file='globalfooter.tpl'}
- {require_once('c:/xxx/Smarty/Smarty.class.php');
- $smarty = new Smarty();
- $host = "xxx";
- $user = "xxx";
- $password = "xxx";
- $database_name = "xxx";
- $pdo = new PDO("mysql:host=$host;dbname=$database_name", $user, $password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
- $search=$_POST['barcode'];
- $query = $pdo->prepare("SELECT * FROM xxx WHERE xxx LIKE '$search' LIMIT 0 , 10");
- $query->bindValue(1, "$search", PDO::PARAM_STR);
- $query->execute();
- $results = $query->fetch();
- $smarty->assign('output', '$results');
- $smarty->display('results.tpl')
- {include file='globalheader.tpl'}
- <div id="xx">
- {$output}
- </div>
- {include file='globalfooter.tpl'}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement