带有变量的php表单操作路径
我真的在想,在开始的时候,我一定有一个格式错误的php echo语句,但Dreamweaver告诉我,我没有语法错误。我的process.php永远不会被调用带有变量的php表单操作路径,php,wordpress,Php,Wordpress,我真的在想,在开始的时候,我一定有一个格式错误的php echo语句,但Dreamweaver告诉我,我没有语法错误。我的process.php永远不会被调用 $file = dirname(__FILE__) . '/customBook-index.php'; $plugin_path = plugin_dir_path($file); $plugin_url = plugin_dir_url($file); <?php echo '<form method
$file = dirname(__FILE__) . '/customBook-index.php';
$plugin_path = plugin_dir_path($file);
$plugin_url = plugin_dir_url($file);
<?php
echo '<form method="post" action="'.$plugin_url.'process.php" />';
echo'<select name="clients">';
foreach($clientsArray as $client){
echo'<option value="'.$client.'">'.$client.'</option>';
}
echo'</select>';
echo '</form>';
?>
$file=dirname(_文件)/php';
$plugin\u path=plugin\u dir\u path($file);
$plugin\u url=plugin\u dir\u url($file);
您不必回显所有HTML。你也可以写:
<?php
$file = dirname(__FILE__) . '/customBook-index.php';
$plugin_path = plugin_dir_path($file);
$plugin_url = plugin_dir_url($file);
?>
<form method="post" action="<?=$plugin_url?>process.php" />
<select name="clients">
<?php
foreach($clientsArray as $client){
?>
<option value="<?=$client?>"><?=$client?></option>
<?php
}
?>
</select>
</form>
表格是如何提交的?我没有看到任何提交按钮或javascript。还有@Bruno Vieira的观点——那个随机的“a”字符在右大括号之前做了什么?随机的“a”字符是我帖子中的一个打字错误,而不是我的代码。如果可能的话,我想用php处理表单。