Benjamin Oats Benjamin Oats - 9 days ago 6
HTML Question

write a POST button in codeigniter

I have a simple HTML post with a php variable included as the value, I wish to use this in my codeigniter project what is the best way to do this.

here is my correct code (I do have the form helper)

<form action="https://www.mysite.co.uk/1/" method="POST">
<input id="start-test" type="hidden" name="userid" value="<?php echo htmlspecialchars($userID); ?>;
<input class="btn btn-primary" type="submit" role="button" id=""></input>
</form>

Answer

I may have misunderstood your question with my first answer.

If all you want is a post button, then you can write this

<input type="submit" class="btn btn-primary" role="button" value="Send" />

Or use the form helper

 <?php echo form_submit('BtnName', 'Send'); ?>
// Would produce:<input type="submit" name="BtnName" value="Send" />

http://www.codeigniter.com/user_guide/helpers/form_helper.html#form_submit