Bob Dylan
Bob Dylan

Reputation: 91

send post request in joomla 2.5

I create a new module that send user information to the data base. But i have trouble with post request!

<form action="send.php" id="send_c" method="post" >
<p>1</p>
<input type="text" name="pib_u" />
<p>2</p>
<input type="text" name="email_u" />
<p>3</p>
<input type="text" name="phone_u" />
<p>4</p>

<select>
<?php
foreach ($list as $item) {
    echo '<option>'.$item->cat_name.'</option>';
}
?>   
</select>

<p></p>
<input type="submit" value="Go" />

</form>

when i trying to send information from the form i get the 404 error with send.php PS: send.php in module folder

please help me to resolve this problem! Thx!

Upvotes: 0

Views: 1305

Answers (2)

Rakesh Sharma
Rakesh Sharma

Reputation: 13738

try

<form action="<?php echo JURI::root().'modules/your_modname/send.php';?>" id="send_c" method="post" > 

get request your with

$_POST['var_name'] or JRequest::getVar ('var_name');

Upvotes: 2

Stoyan Dimov
Stoyan Dimov

Reputation: 5549

If you send the request to the same page where the module is loaded leave the action attribute empty.

<form action="" id="send_c" method="post" > 

The way you wrote it it looks for {current url}send.php and it doesn't find it.

Upvotes: 1

Related Questions