English 中文(简体)
PHP等待一个职位。
原标题:PHP wait for a post.
  • 时间:2011-11-06 14:45:33
  •  标签:
  • php
  • post

我知道,购买力平价并非同步。 职能相互执行。

What I want to do is a post, then process the info and call procedures based on the post info. For instance multiple choice. if its "a" then process(a) if its "b" then process(b).

因此,我可以做些什么来做到这一点?

JavaScript? Ajax? Perl? Can someone point me to some examples?

感谢

问题回答

我看不到你的话,在职位价值之间开诚的转变!

<?php

$action = htmlentities($_POST[ action ]);

switch ($action) {
   case  a :
     handle_a();break
   case  b :
     handle_b();break
   default:
     menu();
}

如果你有:php >5.3(我的情况并非如此),你也可以使用匿名职能:

<?php

$action = $_GET[ action ];
$available_actions = array( a  => function () { echo "handling a"; },
                            b  => function () { echo "handling b"; });
if (array_key_exists($action, $available_actions))
{
        $available_actions[$action]();
}

你们总是能够公正使用

if (isset($_POST[ submit ]))
{
    // do stuff in there like add the switch
}

只有当该员额已经提交时,你才能增加阿尔夫的开关说明,以便把其他贴出的物品转换成不同的东西。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签