Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/247.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
php中的更改值_Php - Fatal编程技术网

php中的更改值

php中的更改值,php,Php,如何通过表单向php代码添加标记。我想在表单中输入一个值,然后它将被添加到$tags中,然后它必须将我重定向到另一个页面?在表单操作页面上 // $tags can be a string with comma separated values, such as: // $tags = 'first, second, third'; 您希望如何通过重新加载来存储$tags的初始值。是否将其放入表单字段?是否存储$tags?你有什么?你试过什么?看,我不应该问这些问题,你需要包括更多的细节。要

如何通过表单向php代码添加标记。我想在表单中输入一个值,然后它将被添加到$tags中,然后它必须将我重定向到另一个页面?

在表单操作页面上

// $tags can be a string with comma separated values, such as: 
// $tags = 'first, second, third';

您希望如何通过重新加载来存储$tags的初始值。是否将其放入表单字段?是否存储$tags?你有什么?你试过什么?看,我不应该问这些问题,你需要包括更多的细节。要查找的术语:表单、方法post/get、会话、标题。
$next_value = $_POST['fildvalue'];
$tags .=','.$next_value;
header('location:url') ;
<?php
$tags=array();
$tags[]="first";
$tags[]="second";
$tags[]="third";

array_push($tags,$_GET["tag"]);
$nTags=implode(",",$tags);
$nTags=urlencode($nTags);
header("Location : http://example.com/?tags=$nTags");
?>