No $_POST data - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: No $_POST data (/showthread.php?tid=19357) |
No $_POST data - El Forum - 06-04-2009 [eluser]BenInBlack[/eluser] New to codeigniter, actually have to use it for this project. Ok, I'm working with a situation where there will be dynamic number of input fields in a form so i need to use $_POST to iterate thru them Code: //Set post arg to vars my form action is Code: <form action="<?php $_SERVER['SERVER_NAME'];?>/index.php/pdf/write" method="POST" enctype="text/plain"> I need $_POST to work or I need a codeignter method. i tried calling $this->input->post() with out param hoping that it would return an array of the post args Please help! No $_POST data - El Forum - 06-04-2009 [eluser]Colin Williams[/eluser] So just iterate over $_POST like in your first example. What's wrong with that? No $_POST data - El Forum - 06-04-2009 [eluser]BenInBlack[/eluser] it's empty, non of the post args are getting thru codeigniter this is codeigniter blocking this because I have other project running on this server that are not CI No $_POST data - El Forum - 06-04-2009 [eluser]gtech[/eluser] to itterate what Colin has said.. here is an example test controller (which I have tested): Code: <?php result after submitting form Code: Array ( [testp] => datatypedin ) No $_POST data - El Forum - 06-04-2009 [eluser]BenInBlack[/eluser] let me re-iterate ;-) $_POST is empty No $_POST data - El Forum - 06-04-2009 [eluser]gtech[/eluser] have you tried cut and pasting my example? it works here. No $_POST data - El Forum - 06-04-2009 [eluser]slowgary[/eluser] And if you want the added security of the input class, do this: Code: foreach($_POST as $key => $value) P.S. "Having" to use CodeIgniter is not a punishment, it's a privilege ;-) No $_POST data - El Forum - 06-04-2009 [eluser]Thorpe Obazee[/eluser] [quote author="BenInBlack" date="1244180370"]let me re-iterate ;-) $_POST is empty[/quote] Then there must be another problem with your code. You probably need to show more code. No $_POST data - El Forum - 06-04-2009 [eluser]BenInBlack[/eluser] first off, thanks for the responses. Controller Code: class Pdf extends Controller { pdf_form.php produces a basic form (for now) Code: <form action="/index.php/pdf/write" method="POST" enctype="text/plain"> This form is to post to the write function which calls pdf_write.php at the top of pdf_write.php is the code to iterate through the $_POST array but it is empty No $_POST data - El Forum - 06-04-2009 [eluser]Thorpe Obazee[/eluser] Can you ensure that you're 'POST'-ing to the correct location? |