如何在电子邮件确认后将用户添加到数据库?(How to add user to database after email confirmation?)
我有一个使用PHP Codeigniter框架构建的网站。 它有一个用户管理系统。 通常,它所做的是,当用户注册时,它将他的信息添加到数据库并发送一个构造电子邮件(与其他系统一样)。
但现在一些垃圾邮件发送者正在创建大量帐户。 他们虽然不验证电子邮件。 只需将更多记录添加到数据库。 但是,我的数据库越来越重。 我怎样才能防止这一点?
是否有任何工作流程可以在他的电子邮件确认后添加用户?
提前致谢。
I have a website built with PHP Codeigniter framework. It has an user management system. Generally, what it does is, when an user registers, it add his information to database and sends a conformation email(like other systems).
But now some spammers are creating lots of accounts. They don't verify the email though. Just add more records to the database. However, my database is getting heavy for this. How can I prevent this?
Is there any workflow by which I can add an user after his email confirmation?
Thanks in advance.
原文:https://stackoverflow.com/questions/48822494
最满意答案
就Android的电话管理员而言,您无法以编程方式检测您的电话是否已被应答。
但对于传入呼叫,可以使用
PhoneStateListener
。 当你拿起电话时,状态变为CALL_STATE_OFFHOOK
。TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); tm.listen(mPhoneListener, PhoneStateListener.LISTEN_CALL_STATE); private PhoneStateListener mPhoneListener = new PhoneStateListener() { public void onCallStateChanged(int state, String incomingNumber) { try { switch (state) { case TelephonyManager.CALL_STATE_RINGING: // do something... break; case TelephonyManager.CALL_STATE_OFFHOOK: // you picked up the phone break; case TelephonyManager.CALL_STATE_IDLE: // do something... break; default: Log.d(TAG, "Unknown phone state=" + state); } } catch (RemoteException e) {} } };
As far as Android's telephony manager is concerned you cannot detect programmatically whether your call has been answered or not.
But for incoming calls it is possible, using
PhoneStateListener
. When YOU 'pick up' the phone, the state changes toCALL_STATE_OFFHOOK
.TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); tm.listen(mPhoneListener, PhoneStateListener.LISTEN_CALL_STATE); private PhoneStateListener mPhoneListener = new PhoneStateListener() { public void onCallStateChanged(int state, String incomingNumber) { try { switch (state) { case TelephonyManager.CALL_STATE_RINGING: // do something... break; case TelephonyManager.CALL_STATE_OFFHOOK: // you picked up the phone break; case TelephonyManager.CALL_STATE_IDLE: // do something... break; default: Log.d(TAG, "Unknown phone state=" + state); } } catch (RemoteException e) {} } };
相关问答
更多-
在Asterisk / SPA504G电话系统上模仿'拿起1号线'(Mimic 'Pick up Line 1' On Asterisk/SPA504G Phone System)[2023-08-05]
该功能称为呼叫停车,它已经存在于大多数星号系统中 或者也许你正在努力拨打接听(* 8) - 如果是这样的话,你已经在所有分机上放了相同的小组。 不幸的是,没有办法说明你拥有哪个系统以及如何在你的系统上启用它。 That feature called call parking and it already present in most asterisk system Or maybe you are reffering to call pickup(*8) - if so you have put same ... -
使用PC拿起电话线(Pick up a phone line using a PC)[2022-09-06]
从内存中你必须告诉调制解调器在电话响铃时自动应答。 发出 AT S0=1 将导致调制解调器在第一个环上应答。 如果您想在某些程序逻辑之后手动执行此操作,请尝试发出 AT A 当手机响个不停。 From memory you have to tell the modem to answer automatically when the phone rings. Sending AT S0=1 will cause the modem to answer on the first ring. If ... -
我也想这样做。 不可能。 Apple出于安全原因明确禁止它: 为防止用户恶意重定向电话或更改电话或帐户的行为,电话应用程序支持tel方案中的大多数但不是全部特殊字符。 具体来说,如果URL包含*或#字符,则电话应用程序不会尝试拨打相应的电话号码。 资源: Apple URL Scheme参考:电话链接 I wanted to do this, too. There's no way. It's explicitly disallowed by Apple for security reasons: To p ...
-
您可以使用 moment().add(Number, String); moment().add(Duration); moment().add(Object); console.log(moment().add(-7, 'days').format('DD.MM.YYYY')); You can use moment().ad ...
-
用他们的名字找到一个人的电话号码的合适的数据结构?(Suitable data structure for finding a person's phone number, given their name?)[2024-02-09]
下面的文字回答你的问题。 在计算机科学中,哈希表或哈希映射是使用哈希函数将称为键(例如,人的姓名)的标识值映射到其关联值(例如,他们的电话号码)的数据结构 。 因此,哈希表实现了一个关联数组。 散列函数用于将密钥转换为要查找对应值的数组元素(槽或桶)的索引(散列)。 该文本来自wiki:hashtable。 有一些进一步的讨论,如碰撞,散列函数......检查维基页面的细节。 the text below answers your question. In computer science, a hash ... -
如果你调用System.exit(0); 然后finally块不被调用,因为线程立即关闭。 在所有其他情况下,块finally被调用(假设它会) If you call System.exit(0); then finally blocks are not called as the thread is shutdown immediately. In all other cases finally is called when the block exits (assuming it does)
-
接受与否,但简单而可靠的答案是你做不到的。 我浪费了3天时间:P Accept it or not but simple and reliable answer is you can't. I have wasted my 3 days over it :P
-
如何知道被叫人拿起电话的时刻[复制](How to know the moment when the called person picks up his phone [duplicate])[2023-08-11]
就Android的电话管理员而言,您无法以编程方式检测您的电话是否已被应答。 但对于传入呼叫,可以使用PhoneStateListener 。 当你拿起电话时,状态变为CALL_STATE_OFFHOOK 。 TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); tm.listen(mPhoneListener, PhoneStateListener.LISTEN_CALL_STATE); private ... -
可能由一对尝试组成的数据结构可能运作良好。 一个特里将给你一个电话号码给出一个名字,另一个会给你一个电话号码的名字。 为您提供姓名电话号码的树的节点将具有标有名称的符号的边缘。 与每个顶点相关的值将是指向另一个trie中的节点的指针(用于给出电话号码的名称),该节点对应于名称从根到顶点的人的电话号码。 给定一个名称,您可以返回具有该名称的人员的相应电话号码(通过从链接节点遍历到根目录)。 实际上,您可以使用它来查找名称以特定前缀开头的所有人及其相应的电话号码。 以下是名称到电话号码的示例: J A ...
-
你可以做一些比你目前使用NSCharacterSet更简单的事情。 就是这样: NSCharacterSet定义了一组字符。 有一些标准的,例如decimalDigitsCharacterSet和alphaNumericCharacterSet 。 还有一个名为invertedSet的简洁方法,它返回一个字符集,其中包含当前未包含的所有字符。 现在,我们只需要一点信息。 NSString有一个名为componentsSeparatedByCharactersInSet:的方法,它为你提供了一个字符串部分的N ...