Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在PHP中向随机用户显示html内容_Javascript_Php_Jquery_Html - Fatal编程技术网

Javascript 在PHP中向随机用户显示html内容

Javascript 在PHP中向随机用户显示html内容,javascript,php,jquery,html,Javascript,Php,Jquery,Html,我正在尝试为在php中具有特定id的用户启用web表单的输入元素,下面是动态html内容: <input type="text" name="you" placeholder="only user with the following id can see this, sorry." disabled> 我并不是特别选择一个用户,我只是尝试选择一个随机的用户。基本上,数据库中有一个表或某种形式的代码,它随机选择一个用户并为激活上述代码的用户分配“yourtheone”id。如何创建

我正在尝试为在php中具有特定id的用户启用web表单的输入元素,下面是动态html内容:

<input type="text" name="you" placeholder="only user with the following id can see this, sorry." disabled>

我并不是特别选择一个用户,我只是尝试选择一个随机的用户。基本上,数据库中有一个表或某种形式的代码,它随机选择一个用户并为激活上述代码的用户分配“yourtheone”id。如何创建此表/代码,将id随机分配给用户?

putid您要显示的用户的textarea

假设

$array_id = [12,14,15,18,19,22,25];

if(in_array($current_user_id,$array_id)){
    <input type="text" name="you" value="your text">
} else {
    <input type="text" name="you" placeholder="only user with the following id can see this, sorry." disabled>
}
$array_id=[12,14,15,18,19,22,25];
if(在数组中($current\u user\u id,$array\u id)){
}否则{
}

为您要显示的文本区域放置该用户的id

假设

$array_id = [12,14,15,18,19,22,25];

if(in_array($current_user_id,$array_id)){
    <input type="text" name="you" value="your text">
} else {
    <input type="text" name="you" placeholder="only user with the following id can see this, sorry." disabled>
}
$array_id=[12,14,15,18,19,22,25];
if(在数组中($current\u user\u id,$array\u id)){
}否则{
}

为您要显示的文本区域放置该用户的id

假设

$array_id = [12,14,15,18,19,22,25];

if(in_array($current_user_id,$array_id)){
    <input type="text" name="you" value="your text">
} else {
    <input type="text" name="you" placeholder="only user with the following id can see this, sorry." disabled>
}
$array_id=[12,14,15,18,19,22,25];
if(在数组中($current\u user\u id,$array\u id)){
}否则{
}

为您要显示的文本区域放置该用户的id

假设

$array_id = [12,14,15,18,19,22,25];

if(in_array($current_user_id,$array_id)){
    <input type="text" name="you" value="your text">
} else {
    <input type="text" name="you" placeholder="only user with the following id can see this, sorry." disabled>
}
$array_id=[12,14,15,18,19,22,25];
if(在数组中($current\u user\u id,$array\u id)){
}否则{
}

数组id也是我可以分配给当前用户的可能id列表,为什么不能是“=[12]”甚至“=[YourEtherne]”?这段代码如何从数据库中随机选择一个用户?数组id也是我可以分配给当前用户的可能id的列表,为什么不能是“=[12]”甚至“=[YourEtherne]”?这段代码如何从数据库中随机选择一个用户?数组id也是我可以分配给当前用户的可能id的列表,为什么不能是“=[12]”甚至“=[YourEtherne]”?这段代码如何从数据库中随机选择一个用户?数组id也是我可以分配给当前用户的可能id的列表,为什么不能是“=[12]”甚至“=[YourEtherne]”?这段代码如何从数据库中随机选择一个用户?