why is wordpress redirecting to home page after form submit? - forms

I am using 'get' method submit the form, but instead of form being submitted to the same page, it redirects to homepage.
<form id="myform" name="myform" action="<?php echo get_permalink( $post->ID ); ?>" method="get">

Related

How to solve this form action problem in code igniter?

CodeIgniter form action causes problem.
When I write below action URL without index.php it runs fine on Chrome and not on firefox
<form method="POST" action="Login/Loginme">
But When I write below action URL with index.php it does not run on chrome and run on firefox.
<form method="POST" action="index.php/Login/Loginme">
use site_url();
<form method="POST" action="<?php echo site_url('Login/Loginme'); ?>">
Using base_url() followed by the controller is best practice. eg. base_url('myController/myFunction')

Submit form in Magento only if already logged in

I would like to create a form in Magento with some extension. At the bottom of the form , when the user pushes the submit button, if he is not registered and logged in yet, it should redirect him to the "Create New Account" page. But if he is already logged in, he should be able to submit the form and the form should automatically include some details of his account (e.g. username, name, etc). How could I achieve this and which extension should I use for the form?
Please check below form action
<?php $custmlogin= new Mage_Customer_Block_Form_Login();?>
<form action="<?php echo $custmlogin->getPostActionUrl() ?>" method="post" id="login-form">
Email:<input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" title="<?php echo $this->__('Email Address') ?>" />
Password:<input type="password" name="login[password]" id="pass" title="<?php echo $this->__('Password') ?>" />
<button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
</form>

Display multiple adminForm's in joomla

When creating a custom view in joomla with multiple forms, there is a conflict because each form has the id="adminForm" name="adminForm".
Renaming the form causes incompatibility with joomla.
How can I display multiple adminForm's on a single view?
Restructure the form elements into a single page-encompassing form
and remove the &task=controller.task portion from the form action
URL, e.g.
<form
action="<?php echo JRoute::_(''); ?>"
name="adminForm" id="adminForm" class="form-validate"
method="post" enctype="multipart/form-data">
On each submit button use the joomla method: onclick="Joomla.submitbutton('controller.task')" e.g.
<button type="submit"
onclick="Joomla.submitbutton('group.join')">Join</button>
Joomla will automatically update a hidden field with the name="task" and value="controller.task" which will get submitted with the form.
You need to have this element in your form for it to work, e.g.
<input type="hidden" name="task" value="" />
</form>

Codeigniter form_open_multipart() displays blank

Been trying out codeigniter and wanted to create a very simple single file upload using the upload class. However I keep getting a blank page when trying to create a form using form_open_multipart. I've been looking around, but I can't seem to find out how to make this work.
The HTML uploadPage.php
<body>
<?php echo form_open_multipart('upload/theUpload');?>
<input type="file" name="userfile">
<input type="submit" name="submit" value="Upload File">
</form>
</body>
The controller upload.php
<? if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class upload extends CI_Controller{
function index(){
$this->load->view("uploadPage");
}
function theUpload(){
}
}

Why is JBoss Post Form sending parameters in URL?

Our JBoss form is posting the parameters in the URL instead of in the request despite being a POST form. I have confirmed that the form is post in the actual page using Firebug. Note that this is within a portlet.
We are submitting the form using javascript like:
function submitForm(action, time)
{
document.getElementById("pageActionInputID").value = time;
document.getElementById("timeSpanFormInputID").value = action;
document.getElementById("formID").submit();
}
<form action="<portlet:actionURL></portlet:actionURL>" method="POST" id="formID">
<input type="hidden" name="pageAction" id="pageActionInputID" />
<input type="hidden" name="timeSpan" id="timeSpanFormInputID" />
</form>
where 'portlet' is from
<%# taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
Any ideas why we are getting the inputs in the URL?
Here is what the resulting markup looks like:
<form id="formID" method="post" action="/portal/auth/portal/myTab?action=1">
<input id="pageActionInputID" type="hidden" name="pageAction"/>
<input id="timeSpanFormInputID" type="hidden" name="timeSpan"/>
</form>
Though it would be great if someone could confirm it. I think the JBoss Portlet throws out post/get and uses action URLs instead.
A descriptive article about render and action URLs