sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
Does the new owner have any exciting plans for the site?
-
Well, thanks for all of your replies. We ended up going with TextMarks, and total monthly cost should be $89.00. They make it extremely simple to do what we need to do, and the cheaper price was important.
-
I'll check into it, but a quick look makes it seem really expensive for the custom short code. $3K to $4.5K for three months + per text fee. I wasn't given a budget, so I'm not sure what to expect when I tell my boss about it. I found one that would be nice, textmarks.com, because they have a perfect API. The problem is that they use a shared shortcode. Because of that, we could only choose a "group" name that isn't already in use, and it's highly unlikely that we could find a great group name that was available, such as "help", "info", etc, etc.
-
I've been given the task to find a few solutions to what we want to do, and wondering if any of you have used services that you recommend. We basically need potential clients to send a text message to a short code, then we would want the service to send an automated response and send our web server the details of the inbound text message: 1) Person is told to text message us, and we would like to have a short code, but we don't have one now. So, for instance, they text "KEYWORD" to 13245 2) Service then sends them an automated response, like "Thank you. We will call you soon". 3) Service uses some sort of web hook (Simple HTTP request) with query params or post data to let our web server know of the details of the inbound text message, the phone number that it was sent from, and the contents of the message, in this case "KEYWORD". That's it. It doesn't seem like much, but there's a lot of crap to wade through on a Google search, and hoping somebody would have some advice or recommendations.
-
Trigger causes insert to say column doesn't exist.
sKunKbad replied to sKunKbad's topic in MySQL Help
It sounds like you are saying this is better suited for a procedure, but even so, what is wrong with my trigger? At this point, I would like the learning experience to know the answer. -
Trigger causes insert to say column doesn't exist.
sKunKbad replied to sKunKbad's topic in MySQL Help
I ended up a solution that doesn't use a trigger, but would still like to know what was wrong. While "dumbed down", the proposed trigger was a good representation of the real trigger. -
I've been using branches a lot more since I created this thread, and I think this scenario is explained as follows: When a local repo is fetching from origin, if origin has a repo that local has not yet had, when checking out that new branch for the first time, the branch is automatically current with origin/"branch".
-
Yes, and they were not merged with master.
-
Well, maybe our versions are different or something. Fetch followed by merge seems to be updating my local develop, even when I'm on the master branch. My git version is 2.7.0, and I'm on Ubuntu 14.04.
-
Interesting. I thought it would be normal to have a bunch of different branches, so that different things could be worked on separately from other things. For my own purposes, a single branch is fine. One thing that seems strange to me is that I am noticing that commits on develop that are not merged with master seem to be automatically merged with the local develop branch when I fetch/merge the master branch. For instance, right now develop is ahead of master by one commit, and when I fetched/merged local master with origin master, local develop was magically merged. So, it would seem that fetch/merge on master automatically brings all of the other branches up to date.
-
I use git every day, but don't do much with branches because I work alone. I'm curious about something related to the branches, when a new branch is on a remote, and then it needs to be fetched and merged separately from the master branch. So pretend I'm on the master branch on my machine: git checkout -b develop # I make changes to files on develop git add . git commit -am "I have made changes to develop" git push origin develop Now there is a develop branch on the remote. Somebody else now fetches and merges (they are on master): git fetch origin # git shows that there is a new branch develop, and merge is also required for origin/master Normally without the develop branch, I would run this command from master: git merge origin/master Do I also need to checkout develop and merge origin/develop? # Do I need to do this too? git checkout develop git merge origin/develop Is there a way to merge all branches with their remote counterparts, all in one command?
-
I have a table named d_records: +--------------+-----------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-----------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | user_id | int(10) unsigned | NO | | NULL | | | msg_datetime | datetime | NO | | NULL | | | msg | text | YES | | NULL | | | status | enum('open','closed') | NO | | open | | +--------------+-----------------------+------+-----+---------+----------------+ I have a trigger that is supposed to do an insert on another table, the h_records. On insert into d_records, I need to look up the user's full name, but that requires also looking up their user level in another table. So I tried this: DELIMITER $$ DROP TRIGGER IF EXISTS cks_trigger ; $$ CREATE TRIGGER cks__trigger AFTER INSERT ON `d_records` FOR EACH ROW BEGIN DECLARE uLevel tinyint(2); DECLARE fullName varchar(120); SELECT user_level FROM users WHERE user_id = NEW.user_id INTO uLevel; IF uLevel = 1 THEN SELECT CONCAT( p.first_name, " " , p.last_name) FROM basic_users p WHERE p.user_id = NEW.user_id INTO fullName; ELSEIF uLevel = 2 THEN SELECT CONCAT( p.first_name, " " , p.last_name) FROM employees p WHERE p.user_id = NEW.user_id INTO fullName; ELSEIF NEW.user_id = 123456 THEN SET fullName = 'skunk'; END IF; IF fullName IS NOT NULL THEN INSERT INTO `h_records` ( user_id, full_name ) VALUES ( NEW.user_id, fullName ); END IF; END;$$ DELIMITER ; But when I do that, MySQL throws an error on insert into d_records, claiming that user_id column doesn't exist in d_records. As soon as I drop the trigger I can do an insert again. The actual tables and trigger are more complex, but I've simplified the code to make the problem easier to see. What am I doing wrong with the trigger?
-
I don't think anyone can help you if you can't provide more information about the differences between the two servers. Since LAMP can be installed on different linux distros, with different versions of PHP, different PHP configurations, etc., trying to answer your question would be like grasping the wind.
-
I've got a working delete query that removes rows where there is no match in another table. It works fine, but the example I found online made me wonder about something. DELETE a FROM table_a a LEFT JOIN table_c c ON c.id = a.id WHERE c.id IS NULL My question is about the first line, "DELETE a". Does that "a" make the query functionally different than leaving it out, like this: DELETE FROM table_a a LEFT JOIN table_c c ON c.id = a.id WHERE c.id IS NULL Are these two delete queries exactly the same for the intended use? I've just never seen somebody write a delete query like that (including that "a") before.
-
What I found out the hard way was that by using fake SMTP that I did not see SMTP related errors, and thereby did not have adequate error handling. In your experience, can MailHog or mailcatcher be set up so that it will throw actual errors for testing purposes?
-
The server requirements for this application allow for PHP 5.3+. Also, password_hash is just a wrapper for crypt, so this shouldn't be an issue.
-
I've been using PHP's crypt function to hash passwords, and specifically using the CRYPT_BLOWFISH hash type. I see where it is the salt, delimited by dollar signs that tells PHP how to hash the password. $2y$ at the beginning of the salt says to use CRYPT_BLOWFISH, unless on an older version of PHP, and then it's $2a$ or $2x$. The cost parameter comes next, and setting that is easy, just a number between 04 and 31. Next the docs say to have a string that is 22 characters, from the alphabet "./0-9A-Za-z". It does mention that characters outside this range will cause crypt to return a zero length string. What it doesn't say is if more than 22 characters can be supplied. It also doesn't mention if the dollar sign at the end is mandatory. Oddly enough, the example that the PHP docs gives has more than 22 characters (26): if (CRYPT_BLOWFISH == 1) { // usesomesillystringforsalt is actually 26 characters echo 'Blowfish: ' . crypt('rasmuslerdorf', '$2a$07$usesomesillystringforsalt$') . "\n"; } So, what is the deal here? Can I supply 32, 64, etc.? Is it just truncated by PHP? It isn't returning a zero length string when I use 32.
-
I mostly work from home, and ISP blocks outbound email servers. I did find a decent solution though. Thunderbird has a .eml import add-on, so after I've "sent" some emails to fakeSMTP, I can just import them in Thunderbird. The downside is that Thunderbird expects an actual email account, so I had to link up to one of my gmail accounts.
-
For a long time I've been logging emails to the filesystem on dev so that I can make sure they look right. I actually log them as HTML files, which is cool because I can open them up in a browser and see the display. Only thing is, I can't open any attachments, and see if the attachments were good. So, then I found FakeSMTP, which is a little java program, and it listens for emails and stores them as .eml files. I can look at the .eml files and get an idea if things were good, but still can't open the attachments. So I'm wondering what others are doing. It would be awesome if there was a way to send emails out and have a program listening that put them in Thunderbird, so I could actually see the HTML and open the attachments. I don't use Thunderbird for normal email, so it could just be dedicated to dev if that matters. What do you do? How do you do it?
-
Well, the advice that I was following is in relation to the autocomplete attribute on login form fields, and specifically setting them to "off". For whatever reason, it seems like the browsers don't want to obey when autocomplete is off. So the advice is to set a readonly attribute, and then clear in on focus. It really does seem to work, but I don't want to load jQuery just for this.
-
I've got a form element that has an onfocus attribute, and I want to convert it to non-jQuery: onfocus="$(this).removeAttr('readonly');" It looks like I can just change removeAttr to removeAttribute, yes? What about $(this)? What is the plain JS way? Thanks.
-
If these are user passwords to a site where the login is an email address w/ password, then there really is no harm in deleting everyone's password as long as there is a password reset feature. You'd really want to enforce the new stronger passwords anyway.
-
Sorting and/or grouping so certain status always at end
sKunKbad replied to sKunKbad's topic in MySQL Help
Thanks for explaining. Do you know of any good MySQL books? I've read basic ones that relate to PHP, and I have another MySQL book. They don't go over cool stuff like this. -
Sorting and/or grouping so certain status always at end
sKunKbad replied to sKunKbad's topic in MySQL Help
I'd never guess that was possible. Thanks Barand.