批准项目 [英] Approving Items

查看:80
本文介绍了批准项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近用PHP设置了我的大部分新网站,我很高兴

但是现在我遇到了问题。我现在正处于制作

管理员的生活更容易的阶段,因此他们可以使用一个漂亮的界面和

而不是phpMyAdmin来欺骗网站的子网站。


我创建了一个页面,其中尚未通过身份验证的子目录

显示给管理员,每个子目录旁边有三个单选框

一个禁止用户(ip地址)一个批准submision和

另一个是删除submition。我还有一个按钮,

将表格提交给自己。


但现在我需要知道如何处理,因为我不知道如何做

循环可以选择无线电选项,并采取相应的

操作。因为管理员可以留下一个必须允许的选项,因为他们可能需要向另一个管理员询问它,所以它可以

是id 50,54,55, 56,57,60等,我不知道如何允许。


所以,如果有人能帮我解决这个问题我真的很棒

欣赏它。


PS


要允许评论已批准字段必须设置为1而不是2

并删除它从整个数据库中删除并禁止将用户的ip

放入另一个禁止列表db 。


但是我可以做那个代码,我只需要循环部分,如果可能的话,

if语句。


哦,顺便说一句选项是由submition的id命名的...但是

如果需要可以改变它。


谢谢你,詹姆斯。

I have recently set up most of my new site in PHP which i''m very happy
about but now i have hit a problem. I am now at the stage of making
admin''s lives easier by making it so they can use a nice interface and
not phpMyAdmin to aurhorise submisions to the site.

I have created a page whereby the yet to be authenticated submitions
are shown to the admin with three radio boxes next to each submition
one to ban the user (ip address of) one to approve the submision and
the other is to delete the submition. I also have a button which
submits the form to itself.

But now I need to know how to process that as I dont know how to do a
loop that chceks what the radio option is and takes the appropriate
action. Because an admin could leave an option that must also be
allowed for as they may need to ask another admin about it so it could
be id 50, 54, 55, 56, 57, 60 etc and I dont know how to allow for that.

So if any of you could please help me with this matter I wouold really
appreciate it.

P.S.

To allow a comment the "approved" field has to be set to 1 instead of 2
and to delete it gets erased from the whole db and ban would put the ip
of the user into another ban list db.

But I can do that code, I just need the loop part and if possible that
if statement.

Oh and btw the options are named by the id of the submition ... but
this can be changed if necessary.

Thanks, James.

推荐答案

James54321写道:
James54321 wrote:

我最近成立了PHP的新网站大部分我很高兴

但是现在我遇到了问题。我现在正处于制作

管理员的生活更容易的阶段,因此他们可以使用一个漂亮的界面和

而不是phpMyAdmin来欺骗网站的子网站。


我创建了一个页面,其中尚未通过身份验证的子目录

显示给管理员,每个子目录旁边有三个单选框

一个禁止用户(ip地址)一个批准submision和

另一个是删除submition。我还有一个按钮,

将表格提交给自己。


但现在我需要知道如何处理,因为我不知道如何做

循环可以选择无线电选项,并采取相应的

操作。因为管理员可以留下一个必须允许的选项,因为他们可能需要向另一个管理员询问它,所以它可以

是id 50,54,55, 56,57,60等,我不知道如何允许。


所以,如果有人能帮我解决这个问题我真的很棒

欣赏它。


PS


要允许评论已批准字段必须设置为1而不是2

并删除它从整个数据库中删除并禁止将用户的ip

放入另一个禁止列表db 。


但是我可以做那个代码,我只需要循环部分,如果可能的话,

if语句。


哦,顺便说一句选项是由submition的id命名的......但是

这可以在必要时更改。
I have recently set up most of my new site in PHP which i''m very happy
about but now i have hit a problem. I am now at the stage of making
admin''s lives easier by making it so they can use a nice interface and
not phpMyAdmin to aurhorise submisions to the site.

I have created a page whereby the yet to be authenticated submitions
are shown to the admin with three radio boxes next to each submition
one to ban the user (ip address of) one to approve the submision and
the other is to delete the submition. I also have a button which
submits the form to itself.

But now I need to know how to process that as I dont know how to do a
loop that chceks what the radio option is and takes the appropriate
action. Because an admin could leave an option that must also be
allowed for as they may need to ask another admin about it so it could
be id 50, 54, 55, 56, 57, 60 etc and I dont know how to allow for that.

So if any of you could please help me with this matter I wouold really
appreciate it.

P.S.

To allow a comment the "approved" field has to be set to 1 instead of 2
and to delete it gets erased from the whole db and ban would put the ip
of the user into another ban list db.

But I can do that code, I just need the loop part and if possible that
if statement.

Oh and btw the options are named by the id of the submition ... but
this can be changed if necessary.



如果没有你显示你的代码和HTML,你就很难帮助你。


这里是一个HTML文件


< html>

< head>< title> title< / title>< / head>

< body>

< form action ="" method =" post">

提交1

< label>< input type ="复选框"名称= QUOT; ID1"值= QUOT; 0"选中>无更改< / label>

< label>< input type ="复选框"名称= QUOT; ID1" value =" 1">禁止< / label>

< label>< input type ="复选框"名称= QUOT; ID1" value =" 2">批准< / label>

< label>< input type ="复选框"名称= QUOT; ID1" value =" 3">删除< / label>

< br>

提交42

< label><输入类型= QUOT;复选框"名称= QUOT;&ID42 QUOT;值= QUOT; 0"选中>无更改< / label>

< label>< input type ="复选框"名称= QUOT;&ID42 QUOT; value =" 1">禁止< / label>

< label>< input type ="复选框"名称= QUOT;&ID42 QUOT; value =" 2">批准< / label>

< label>< input type ="复选框"名称= QUOT;&ID42 QUOT; value =" 3">删除< / label>

< br>

< input type =" submit">

< / form>

< / body>

< / html>


当服务器收到此信息时表格它将

Without you showing your code and HTML it''s a bit hard to help you.

Here''s an HTML file

<html>
<head><title>title</title></head>
<body>
<form action="" method="post">
submission 1
<label><input type="checkbox" name="id1" value="0" checked>No change</label>
<label><input type="checkbox" name="id1" value="1">Ban</label>
<label><input type="checkbox" name="id1" value="2">Approve</label>
<label><input type="checkbox" name="id1" value="3">Delete</label>
<br>
submission 42
<label><input type="checkbox" name="id42" value="0" checked>No change</label>
<label><input type="checkbox" name="id42" value="1">Ban</label>
<label><input type="checkbox" name="id42" value="2">Approve</label>
<label><input type="checkbox" name="id42" value="3">Delete</label>
<br>
<input type="submit">
</form>
</body>
</html>

When the server receives this form it will have


_POST [''id1'']和
_POST[''id1''] and


_POST [''id42'']设置为1 0,1,2或3(除非客户选择

骗到服务器)。

你可以用
<检查键和值br />
<?php

foreach(
_POST[''id42''] set to one of 0, 1, 2, or 3 (unless the client chose to
lie to the server).
You can check the keys and values with

<?php
foreach (


这篇关于批准项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆