|
||||
|
Hello,
i have little problem. When i use and little edit "get started" script on my Web ... and use <form> with metod POST ... after send is IsPost() as true, but $_POST vars dont exist ... (empty array). With GET (getQuery or getParam) params istn problem. when i try <form action"some_URL/?test=ABC" metod POST> and send it ... $_GET -> array(['test'] = "ABC") $_POST -> array () here is source code Index of /code, and compressed whole aplication .... : http://temp.ujak.cz/code/res.txt its result after i SUBMIT form SYSTEM: Version ZF: 1.5.1 PHP: 5xx Apache 2.0.x Server: Linux Fedora Core 5 Zend Optymalizer: Yes ------------------------------------------------------------------- I view : <form action="<?php echo $this->baseUrl ?>/whitelist/del/" method="POST"> <p>Opravdu smazat <?= $this->whitelist[0]["sender"]?>?</p> <div> <input type="hidden" name="id" value="<?php echo $this->whitelist[0]["id"]; ?>"> <input type="submit" name="del" value="Ano"> <input type="submit" name="del" value="Ne"> </div> </form> ------------------------------------------------------------------------ in controllers: if ($this->_request->isPost()) { ********* HERE IT IS OK AFTER SUBMIT ... Zend_Loader::lo*adClass(‚Zend_Fil*ter_Alpha‘); $filter = new Zend_Filter_Al*pha(); $id = (int)$this->_request->getPost(‚id‘); $del = $filter->filter($this->_request->getPost(‚del‘)); if ($del == ‚Ano‘ && $id > 0) { $db->query(„DELETE FROM whitelist WHERE id = ?“, $_GET[„id“]); $this->_redirect(‚/whi*telist‘); return; } else if ($del == ‚Ne‘) { $this->_redirect(‚/whi*telist‘); return; } } else { $id = (int)$this->_request->getQuery(‚id‘); if ($id > 0) { $dotaz = $db->query(„SELECT * FROM whitelist WHERE id=?“, $id); $this->view->whitelist = $dotaz->fetchAll(); } } -------------------------------------------------------- sorry, my english is not good Thanks Mischa Last edited by Mischa : 04-04-2008 at 03:52 PM. |
|
|||
|
Hello,
I'm facing the same problem, right now. I have this form declaration: <form name="loginForm" method="post" id="loginForm" action="login/authenticate"> and in my index action for index controller, if user is not authenticated is redirected to login page wich is showing up well, but when I submit the form, in the authenticateAction i'm not able to get the post parameter, this is the code of the action (I've already try the above suggestion) but the same, not autheticated because I get redirected to the same page: public function authenticateAction() { include_once MODELS_HOME.'Factory.php'; $auth = Factory::newInstance(AUTH); $result = $auth->authenticate( $this->getRequest()->getPost('username'), $this->getRequest()->getPost('password') ); if($result->isValid()) $this->_forward('index', 'index'); else { $error = ''; foreach ($result->getMessages() as $message) { $error .= $message."\n"; } $this->_setParam('error', $error); $this->_forward('login','login'); } } Any idea on what's going on, Thank in advance. |
|
||||
|
Nobody dont know what it is ?
here is source code, and compressed whole aplication .... : Index of /code there is http://temp.ujak.cz/code/res.txt its result after i SUBMIT form System : Linux Fedora Core 5 PHP: 5 ZF: 1.5.1 Thanks Mischa |
![]() |
| Thread Tools | |
| Display Modes | |
|
|