Jump to content

smarty $_POST help


cybernet

Recommended Posts

$postlist = new Smarty;
...
case 'submit':
foreach(explode(":","desc:title") as $v) {

      if (!isset($_POST[$v]))

        $postlist->display('no_posted_data.tpl');

    }

 

post.tpl

<form action="post.php?action=submit" method="post">
<legend>..title..</legend>
  <table border="1">
    <tr>
      <td>{$post_form.title}:</td>
      <td>
        <input type="text" name="title" size="40">
      </td>
    </tr>
    <tr>
      <td valign="top">{$post_form.desc}:</td>
      <td><textarea name="desc" cols="80" rows="10"></textarea></td>
    </tr>
    <tr>
      <td colspan="2" align="center">
        <input type="submit" value="Submit">
      </td>
    </tr>
  </table>

 

the only problem is that if i submit the form empty is still get processed

 

any help please ? :D

 

i have even tried in a template

{if !isset($_POST['title']) }
   die?
{/if}

Link to comment
https://forums.phpfreaks.com/topic/248438-smarty-_post-help/
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.