php当点击提交登录的时候,如果登录失败,跳出对话框

当点击提交登录的时候,如果登录失败,跳出对话框php代码:

echo "<script language=javascript>alert('密码错误');history.back();</script>";

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要实现在uni-app中点击漂流瓶后弹出一个对话框,你可以按照以下步骤进行操作: 1. 首先,在你的uni-app项目中创建一个自定义组件用于显示对话框。可以在项目的`components`目录下创建一个名为`Dialog`的文件夹,并在其中创建`Dialog.vue`文件。 2. 在`Dialog.vue`文件中,定义对话框的样式和内容,可以使用uni-app提供的组件如`uni-dialog`或自定义样式来实现。例如,你可以在`Dialog.vue`文件中添加以下代码: ```html <template> <view class="dialog-container" v-show="showDialog"> <view class="dialog-content"> <!-- 对话框内容 --> <text>{{ dialogContent }}</text> </view> <view class="dialog-btns"> <!-- 对话框按钮 --> <button @click="closeDialog">关闭</button> </view> </view> </template> <script> export default { data() { return { showDialog: false, // 控制对话框显示隐藏 dialogContent: "这是一个对话框", // 对话框内容 }; }, methods: { closeDialog() { this.showDialog = false; // 关闭对话框 }, }, }; </script> <style scoped> .dialog-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; } .dialog-content { background-color: #fff; padding: 20rpx; border-radius: 10rpx; } .dialog-btns { text-align: center; margin-top: 10rpx; } button { padding: 10rpx 20rpx; background-color: #007aff; color: #fff; border-radius: 4px; } </style> ``` 3. 在使用漂流瓶的页面中,引入并注册`Dialog`组件。例如,在`index.vue`文件中添加以下代码: ```html <template> <view> <!-- 漂流瓶 --> <view class="bottle" @click="showDialog"> 点击漂流瓶 </view> <!-- 引入对话框组件 --> <dialog ref="dialog"></dialog> </view> </template> <script> import Dialog from '@/components/Dialog/Dialog.vue'; export default { components: { Dialog, }, methods: { showDialog() { this.$refs.dialog.showDialog = true; // 打开对话框 }, }, }; </script> <style> .bottle { width: 100px; height: 100px; background-color: #007aff; color: #fff; border-radius: 50%; text-align: center; line-height: 100px; } </style> ``` 这样,在点击漂流瓶时,对话框就会弹出来显示内容,并提供关闭按钮。你可以根据需要自定义对话框的样式和内容。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值