duanlu1922 2016-10-01 07:20
浏览 61
已采纳

使用html表单更改函数的php echo消息?

I would like through a change the message html form a "php echo" I thought maybe there would be a way to edit the php file to display a message type or another as edit from the form. I would do it without having to make another request to a database.

The "echo" I want to change is this when you end the function that sends the data to the database.

if ($name){
$sql= "INSERT INTO box (name, mensaje) VALUES ('$name', '$mensaje')";   
mysqli_query($DB, $sql);

echo "All it uploaded correctly, but on Saturday, opening day,
 have to wait until an administrator validate the content. Thank you.";
}

Perhaps the question is silly, but I've never done something like and now I can not think how.

Would there be any way to edit the file "echo php" from a form? Is there any other way?

  • 写回答

1条回答 默认 最新

  • douxing6434 2016-10-01 07:27
    关注

    I'm pretty sure the short answer is no. And from a security point of view that's a good thing. That is, you do not want anyone to be able to come along and edit your website from without.

    If I understand you correctly, you want to be able to vary the message that is echoed after your query. You could set up another page with a form that let's you securely configure the message that is to be displayed. You'd need to persist the message and retrieve it in your function prior to displaying it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 阿里云python代码求解
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥15 统计大规模图中的完全子图问题
  • ¥15 使用LM2596制作降压电路,一个能运行,一个不能
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路