对于想了解php–$_POST可以区分具有相同名称的两个元素吗?的读者,本文将提供新的信息,我们将详细介绍phppostget区别,并且为您提供关于2个具有相同名称的iOS开发者证书、angularj
对于想了解php – $_POST可以区分具有相同名称的两个元素吗?的读者,本文将提供新的信息,我们将详细介绍php post get区别,并且为您提供关于2个具有相同名称的iOS开发者证书、angularjs – 两个不同的模块可以在角度js中具有相同名称的控制器吗?、delphi – 可以有两个具有相同名称的属性吗?、delphi – 如何实现两个具有相同名称的方法的接口?的有价值信息。
本文目录一览:- php – $_POST可以区分具有相同名称的两个元素吗?(php post get区别)
- 2个具有相同名称的iOS开发者证书
- angularjs – 两个不同的模块可以在角度js中具有相同名称的控制器吗?
- delphi – 可以有两个具有相同名称的属性吗?
- delphi – 如何实现两个具有相同名称的方法的接口?
php – $_POST可以区分具有相同名称的两个元素吗?(php post get区别)
该示例是一个非常简单的添加记录/删除具有多个输入的书籍记录.这是代码:
if (isset($_POST['delete']) && isset($_POST['isbn'])) { $isbn = get_post('isbn'); $query = "DELETE FROM classics WHERE isbn='$isbn'"; if (!MysqL_query($query,$db_server)) echo "DELETE Failed: $query<br />" . MysqL_error() . "<br /><br />"; } if (isset($_POST['author']) && isset($_POST['title']) && isset($_POST['category']) && isset($_POST['year']) && isset($_POST['isbn'])) { $author = get_post('author'); $title = get_post('title'); $category = get_post('category'); $year = get_post('year'); $isbn = get_post('isbn'); $query = "INSERT INTO classics VALUES" . "('$author','$title','$category','$year','$isbn')"; if (!MysqL_query($query,$db_server)) echo "INSERT Failed: $query<br />" . MysqL_error() . "<br /><br />"; } echo <<<_END <form action="sqltest.PHP" method="post"><pre> Author <input type="text" name="author" /> Title <input type="text" name="title" /> Category <input type="text" name="category" /> Year <input type="text" name="year" /> ISBN <input type="text" name="isbn" /> <input type="submit" value="ADD RECORD" /> </pre></form> _END; $query = "SELECT * FROM classics"; $result = MysqL_query($query); if (!$result) die ("Database access Failed: " . MysqL_error()); $rows = MysqL_num_rows($result); for ($j = 0 ; $j < $rows ; ++$j) { $row = MysqL_fetch_row($result); echo <<<_END <pre> Author $row[0] Title $row[1] Category $row[2] Year $row[3] ISBN $row[4] </pre> <form action="sqltest.PHP" method="post"> <input type="hidden" name="delete" value="yes" /> <input type="hidden" name="isbn" value="$row[4]" /> <input type="submit" value="DELETE RECORD" /></form> _END; } MysqL_close($db_server); function get_post($var) { return MysqL_real_escape_string($_POST[$var]); } ?>
当您使用if(isset($_ POST [‘delete’])&& isset($_ POST [‘isbn’]))引用$_POST中的元素时,其中delete和isbn被多次用作名称,$_POST知道要引用哪个元素删除?我假设由于您一次只能删除一条记录,因此数组中的元素将自动指向已设置的记录.但是,isset的第二个条件($_ POST [‘isbn’])如何知道要检查哪个“isbn”元素?和&&让$_POST [‘isbn’]“继承”正确的行?
谢谢您的帮助!并且对任何可能滥用词汇表示道歉.仍然习惯于一切.
解决方法
for ($j = 0 ; $j < $rows ; ++$j) { $row = MysqL_fetch_row($result); echo <<<_END <pre> Author $row[0] Title $row[1] Category $row[2] Year $row[3] ISBN $row[4] </pre> <form action="sqltest.PHP" method="post"> <input type="hidden" name="delete" value="yes" /> <input type="hidden" name="isbn" value="$row[4]" /> <input type="submit" value="DELETE RECORD" /></form> _END; }
看到< form action =“sqltest.PHP”method =“post”>?并看到关闭< / form>?请注意,每次for($j = 0; $j< $rows; $j)循环发生时,它们都会被渲染?每行有一个单独的表单元素.这是一个混乱的代码,但它的工作原理.当一个人点击每个列表上的提交时,包装表单会响应&解析嵌套在其中的变量. 就像我说的,邋code的代码.但是有效.这是因为如果您列出了30个ISBN,则此程序将吐出30个独立包装的< form>项目. Uggh!说真的,如果这本书后来没有以一种解决这个问题混乱的方式来解决数组的问题,那就找到一本新书.
2个具有相同名称的iOS开发者证书
情况:
我们注册了Apples开发人员计划(用于在App Store中分发应用程序).自上周以来,我们还参加了企业计划(用于内部应用程序分发).
问题:
我们继续开发和构建应用程序.但我们不知道我们必须为不同的程序使用两个不同的开发人员证书.我们现在有2个具有相同名称的证书,每次我们要构建应用程序时,XCode都会生成错误消息“无法准确分配证书”.
题:
我们如何更改其中一个开发人员证书的名称?
非常感谢您的帮助!
解决方法
例如一个证书路径……… / login / …..
对于另一个证书更改路径…….. / mynewkeychain / ……
angularjs – 两个不同的模块可以在角度js中具有相同名称的控制器吗?
我有一个三个标签网站.
那么如何定义角度模块呢?
每页一个,一个主模块控制所有三页?
我想问一下这是否可行?
解决方法
如果您想在另一个项目中重用部分应用程序,或者拥有一个包含大量服务,过滤器等的真正大型应用程序,则角度模块系统是有意义的.由于您的小三个标签网站不是这种情况,我建议您在此模块中为您的应用程序和三个不同的控制器使用一个模块.
angular.module('app',[]) .controller("tab1",function() { }) .controller("tab2",function() { }) .controller("tab3",function() { });
delphi – 可以有两个具有相同名称的属性吗?
property Cell [Cl,Rw: Integer]: string read getCell write setCell; property Cell [ColName: string; Rw: Integer]: string read getCellByCol write setCellByCol;
嗯,我试过,编译器不会让我这样做,但也许有一个诀窍?
解决方法
function getP1(Cl,Rw : integer) : string; procedure setP1(C1,Rw : integer ; const s : string); function getP2(const Cl : string ; Rw : integer) : string; procedure setP2(const C1 : string ; Rw : integer ; const s : string); property P1[Cl,Rw : integer] : string read getP1 write setP1; default; property P1[const Cl : string ; Rw : integer] : string read getP2 write setP2; default;
诀窍是将属性命名为相同,并使用“default”子句标记.然后,您可以使用各种参数访问相同的属性名称:
P1['k',1]:=P1[2,1]; P1[2,1]:=P1['k',1];
编译好,不知道这是否被非常支持,或者还有其他一些问题,但是它编译得很好,调用正确的getter / setter(在Delphi 2010中测试).
这当然只有在您没有为您的类使用默认属性时才起作用,因为我能够使其工作的唯一方法是通过默认子句.
delphi – 如何实现两个具有相同名称的方法的接口?
这是一个简化的例子:
ICustomInterfaceList = interface procedure Add(AInterface: IInterface); function GetFirst: IInterface; end; TCustomInterfaceList = class(TInterfacedobject,ICustomInterfaceList) public procedure Add(AInterface: IInterface); function GetFirst: IInterface; end; ISpecificInterface = interface(IInterface) end; ISpecificInterfaceList = interface(ICustomInterfaceList) function GetFirst: ISpecificInterface; end; TSpecificInterfaceList = class(TCustomInterfaceList,ISpecificInterfaceList) public function GetFirst: ISpecificInterface; end;
TSpecificInterfaceList将无法编译:
E2211 Declaration of ‘GetFirst’ differs from declaration in interface ‘ISpecificInterfaceList’
我想我理论上可以使用TCustomInterfaceList,但我不想每次使用时都要使用“GetFirst”.我的目标是拥有一个特定的类,它继承基类的行为并包装“GetFirst”.
我怎样才能做到这一点?
谢谢!
解决方法
procedure Add(AInterface: IInterface); function GetFirst: IInterface; function GetFirst: ISpecificInterface;
因为您的两个函数共享相同的名称,所以需要帮助编译器识别哪个函数是哪个.
使用method resolution clause.
TSpecificInterfaceList = class(TCustomInterfaceList,ISpecificInterfaceList) public function GetFirstSpecific: ISpecificInterface; function ISpecificInterfaceList.GetFirst = GetFirstSpecific; end;
今天关于php – $_POST可以区分具有相同名称的两个元素吗?和php post get区别的分享就到这里,希望大家有所收获,若想了解更多关于2个具有相同名称的iOS开发者证书、angularjs – 两个不同的模块可以在角度js中具有相同名称的控制器吗?、delphi – 可以有两个具有相同名称的属性吗?、delphi – 如何实现两个具有相同名称的方法的接口?等相关知识,可以在本站进行查询。
本文标签: