English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i'm writing a code below of php plz let me know the meaning of this stepwise,this also includes javascript, function SetAction(action,frm)
{
var i=0;
var check=false;
if(frm['items'],length)
{
for(i=0;i {
if(frm.items[i].checked==true) {
check=true;
break;
}}}else {
if(frm.items.checked==true)
check=true;}
if(check==false)
document.getElementbyId("Error").innerHTML="Error:plz check any checkbox
";
else{
frm.Action.value=action;
frm.submit();}
$rec_id=$_GET['rec'];
$action=$_POST['Action'];
$arr_id=$_POST['items'];
$fld_id='fld_newsData';
if($action){switch($action){ case'Delete':del_records($arr_id,$fld_id); header("Location:index.php?query_str&msg=delete");
break;case'Activate':..........function del_records($arr_id,$fld_id){foreach($arr_id as $key=>$val){$sql=musql_query("DELETE FROM'tbl'WHERE$fld_id=$val'")

2007-06-08 03:18:54 · 5 answers · asked by Dine 1 in Computers & Internet Programming & Design

5 answers

$action : is the variable in php
$_POST : is the method of the form
['ACTION'] : is the field of the form

The expression $action=$_POST['ACTION'] will get the value from Action field on the form and will store to a varible $action. The form method is Post so when it will be submitted it will not show the value of the field Action on addressbar unlike Get.

Hope this helps.

2007-06-08 03:28:43 · answer #1 · answered by Vic 3 · 0 0

What I find rather odd (but not necessarily wrong), is that the script fetches from the $_GET, AND $_POST.
So all I can figure is that sometimes the form(s) that call this PHP file has the form type set to "GET", and sometimes set to "POST".

In the browser,
- GET variables are typically displayed in the URL
- POST variables are not displayed but are still sent to the web page.

2007-06-08 06:50:46 · answer #2 · answered by Chris C 7 · 0 0

When this code is requested from a browser it expects some POST arguments which were sent by the browser in the request. This happens when you submit a form.

The $_POST['action'] contains the value that the Form item name="action" contains. for instance






$_POST["action"] will contain the value I enter into the text box on the form after I press submit.

2007-06-08 03:27:49 · answer #3 · answered by Anonymous · 0 0

it simply means that $action is a variable whose value is from the form from another page.
Im sure you can figure it out... hope this helps..

2007-06-08 09:05:32 · answer #4 · answered by aizar7 2 · 0 0

It sounds self-explanatory doesn't it?

2007-06-08 03:21:29 · answer #5 · answered by Anonymous · 0 1

fedest.com, questions and answers