restriction

How to restrict public email id for registration in PHP?

一曲冷凌霜 提交于 2019-12-01 01:45:46
I have a registration form that uses any kind of emails for registration. I want to restrict it to company mail id's only. In other words, no free email service provider's mail id would work for registration. Since you have not provided any additional information as to how E-mail addresses are being defined and/or entered into a form or not, am submitting the following using PHP's preg_match() function, along with b and i pattern delimiters and an array. b - word boundary i - case insensitive http://php.net/manual/en/function.preg-match.php The following will match against "gmail" or "Gmail"

Threaded importing while interpreter shuts down

不打扰是莪最后的温柔 提交于 2019-12-01 01:06:18
Python's threading documentation states: All import attempts must be completed before the interpreter starts shutting itself down. This can be most easily achieved by only performing imports from non-daemon threads created through the threading module. Daemon threads and threads created directly with the thread module will require some other form of synchronization to ensure they do not attempt imports after system shutdown has commenced. Failure to abide by this restriction will lead to intermittent exceptions and crashes during interpreter shutdown (as the late imports attempt to access

How to restrict public email id for registration in PHP?

非 Y 不嫁゛ 提交于 2019-11-30 21:04:17
问题 I have a registration form that uses any kind of emails for registration. I want to restrict it to company mail id's only. In other words, no free email service provider's mail id would work for registration. 回答1: Since you have not provided any additional information as to how E-mail addresses are being defined and/or entered into a form or not, am submitting the following using PHP's preg_match() function, along with b and i pattern delimiters and an array. b - word boundary i - case

Angular 2 restrict input field

本秂侑毒 提交于 2019-11-30 09:55:49
问题 I was wondering if it's possible to restrict an input field to a certain format like for example as many digits as you want then "." and then 2 digits? That's basically an input for a price... And I don't want a simple validation like the pattern attribute. I want the user to not be able to make a false input. 回答1: you need use a directive. In the directive add a hotListener about input and check if match with the regExpr indicated. I make a directive mask some time ago. The directive in the

In NHibernate, using a Disjunction gives double results

旧街凉风 提交于 2019-11-30 09:47:53
问题 I'm trying to make a select with DetachedCriteria, I want to add several conditions seperated by OR at runtime. If I use: Restrictions.Or( cond1, Restrictions.Or(cond2, Restrictions.Or(cond3, cond4)) ) I get the result I want. But if I use a Disjunction like so: var disjunction = Restrictions.Disjunction(); disjunction.Add(cond1); disjunction.Add(cond2); disjunction.Add(cond3); disjunction.Add(cond4); And I have entities that cond1 and cond2 are true for them, at the results I get them twice

Restrict File Type and size in PHP form upload

余生长醉 提交于 2019-11-30 09:33:01
问题 Hi all I have found some really good code over on http://apptools.com thats helped me create a form that allows users to enter there details upload a file and it then emails it to me automatically which is great. I just wondered if you knew how I could restrict the file types to doc, pdf, psd, ai, jpg, bmp and maybe a few more in the future and also restrict it to 5mb in size. The code I have is below: <?php if(!isset($_POST['Submit'])){ echo "error; you need to submit the form!"; } else {

How to restrict a column value in SQLite / MySQL

岁酱吖の 提交于 2019-11-30 06:46:49
问题 I would like to restrict a column value in a SQL table. For example, the column values can only be "car" or "bike" or "van". My question is how do you achieve this in SQL, and is it a good idea to do this on the DB side or should I let the application restrict the input. I also have the intention to add or remove more values in the future, for example, "truck". The type of Databases I am using are SQLite and MySQL. 回答1: Add a new table containing these means of transport, and make your column

Restrictons of Python compared to Ruby: lambda's

久未见 提交于 2019-11-29 20:35:30
问题 I was going over some pages from WikiVS, that I quote from: because lambdas in Python are restricted to expressions and cannot contain statements I would like to know what would be a good example (or more) where this restriction would be, preferably compared to the Ruby language. Thank you for your answers, comments and feedback! 回答1: I don't think you're really asking about lambdas, but inline functions . This is genuinely one of Python's seriously annoying limitations: you can't define a

In NHibernate, using a Disjunction gives double results

痞子三分冷 提交于 2019-11-29 16:25:54
I'm trying to make a select with DetachedCriteria, I want to add several conditions seperated by OR at runtime. If I use: Restrictions.Or( cond1, Restrictions.Or(cond2, Restrictions.Or(cond3, cond4)) ) I get the result I want. But if I use a Disjunction like so: var disjunction = Restrictions.Disjunction(); disjunction.Add(cond1); disjunction.Add(cond2); disjunction.Add(cond3); disjunction.Add(cond4); And I have entities that cond1 and cond2 are true for them, at the results I get them twice (the same exact entity is returned twice in the list result). I do not wish to use QueryOver because I

Restrict File Type and size in PHP form upload

不打扰是莪最后的温柔 提交于 2019-11-29 16:05:52
Hi all I have found some really good code over on http://apptools.com thats helped me create a form that allows users to enter there details upload a file and it then emails it to me automatically which is great. I just wondered if you knew how I could restrict the file types to doc, pdf, psd, ai, jpg, bmp and maybe a few more in the future and also restrict it to 5mb in size. The code I have is below: <?php if(!isset($_POST['Submit'])){ echo "error; you need to submit the form!"; } else { $to="my@email.com"; $subject="Subject header"; $enquiry = $_POST['message2']; $company = $_POST['company2