participatesearch

PHP: Validate an IP Address

March 13th, 2010 Andrew No comments

So you need to check if some string is a valid IP address. You could simply test it against a regular expression:

1
2
3
4
5
6
7
function is_valid_ipv4($ip)
{
    return preg_match('/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
        '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
        '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.'.
        '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/', $ip) !== 0;
}

Regular Expression obtained here

This will actually work for most situations, but it’s lacking in a few ways. Suppose you want to exclude private or reserved IP addresses. Maybe you want to validate IPv6 addresses too; not just IPv4.

Enter PHP’s Data Filtering Extension. It just works, and you don’t have to worry about maintaining (or properly applying) complex regular expressions.

Read more…

blog
  • Share/Bookmark

Nancy Pelosi is a liar, and I can prove it (stop the health care bill)

March 12th, 2010 Andrew No comments

Nancy PelosiSpeaker of the House, Nancy Pelosi, has been at the center of this very heated controversy about health care. She has relentlessly pushed this legislation trying to “make history.”

For those that don’t know the history of this bill, I’ll break it down for you:

  • November 7, 2009 – The House – under enormous pressure from Pelosi – passed The Affordable Health Care for America Act H.R. 3962
    • This included the Stupak-Pitts amendment which enforced long-standing law banning federal funding of abortion except in cases of rape, incest, or danger to the life of the mother.
  • December 24, 2009 – The Senate passes their version of the bill – The Patient Protection and Affordable Care Act H.R.3590
    • This did not include the Nelson-Hatch amendment which contained the same language as the Stupak-Pitts amendment.
  • February 25, 2010 – President Obama holds his “Health Care Summit” in which nothing is really accomplished. Well… almost. More on that later.
  • The current strategy is to pass the Senate version of the bill through the House, which is supposed to happen in a vote on March 18, 2010

Nancy Pelosi is – of course – putting huge pressure on pro-life Democrats that voted for the Stupak-Pitts amendment to now support the Senate bill without the anti-abortion language included.

Now it starts to get ridiculous. The one thing that was accomplished at the Health Care Summit? The country got to see first-hand just how corruptly this entire proceeding has been handled.

At the Health Care Summit, Pelosi had this to say:
Read more…

information
  • Share/Bookmark
site-map

Senator Nelson Responds to Health Care Concerns

December 16th, 2009 Andrew 2 comments

Senator Nelson (D-FL) has finally responded to my e-mail about his vote on the Nelson-Hatch-Casey Amendment.

Since this is an open letter, I’m copying his entire response below (minus the “don’t reply to this e-mail, etc.” message).

From: Bill@billnelson.senate.gov
To: Andrew Ensley
Sent: Mon, Dec 14, 2009 at 8:49 AM
Subject: RE: Your response from Senator Bill Nelson

Dear Mr. Ensley:

Thank you for contacting me regarding the health care reform process as it relates to abortion.

On December 8, I voted against Senator Ben Nelson’s amendment to the Patient Protection and Affordable Care Act that would have imposed further restrictions on abortion, making it virtually impossible for a woman to purchase an insurance policy that covers abortion, even if she pays entirely with her own money. The health care bill now under consideration in the Senate follows the precedent set by the Hyde Amendment, that no Federal funds shall be used to provide abortions except in the case of rape, incest, or to protect the life of the mother. This compromise has been the law of the land since 1976, and I see no need to make any changes to this policy as a part of health care reform.

I believe in a woman’s constitutional right to choose and in reducing the number of abortions in America by encouraging adoption. The Senate bill represents a reasonable compromise, crafted in good faith by both sides. As the bill makes its way through the legislative process, I will keep your views in mind.

Sincerely,
Senator Bill Nelson

Today, I sent my reply.

Read more…

forum
  • Share/Bookmark
careers

Sen. Bill Nelson did NOT represent us today

December 8th, 2009
tour
Andrew No comments

Some of you may know already that today, the Nelson-Hatch-Casey Amendment (which bans federal funding of abortion in the new health care bill) was tabled and thus defeated by a vote of 54 to 45.

You may also know that our distinguished senator Bill Nelson (D-FL) was one of those 54.

He has not responded to my first e-mail yet, but I sent him another one to let him know what I think of his actions today.

I would encourage you to contact him by e-mail and do the same.

Mr. Nelson,

I am extremely disappointed in your action today as you voted to table the Nelson-Hatch-Casey Amendment. I am dumbfounded by your inability to represent your constituents.

Why did you choose not to stand up for life? Why did you choose to ignore the wishes of the majority? You were not elected to do whatever you want, sir. You were elected to represent the views of the citizens of Florida.

If Sen. Reid’s health care bill passes with the CAPPS language as it is now, I will do everything in my power to show fellow voters in Florida how you were directly responsible.

Please, stop ignoring the citizens. Do not vote for this health care reform bill. Do not vote for the 2000-page bill that will cost our weakened economy over 1 TRILLION dollars and 5.5 MILLION jobs. I’m not stupid. I know that this bill WILL increase taxes and premiums and cut benefits for everyone.

Health care reform is needed. But this bill is wrong in every way.

Thank you for your time,

Andrew Ensley

It was difficult to be this polite.

  • Share/Bookmark
faq

My Open Letter to Senator Bill Nelson

December 7th, 2009 Andrew No comments

This is an open letter that I sent to Senator Bill Nelson (D-FL) about the Nelson-Hatch-Casey Amendment which would ban federal funding of abortions in any new health care bill passed.

You can contact him yourself by calling (202) 224-5274
(Note: when I called it went straight to voicemail and the mailbox was full)

You can also contact him by e-mail here.

Dear Senator Bill Nelson,

I know from your history on the issue of abortion that you will probably oppose the Nelson-Hatch-Casey amendment, but I urge you, as a constituent in your state, to consider that a November CNN poll found that 61% of Americans reject federal funding of abortions.

It is a violation of the taxpayers’ consciences to force us to fund elective abortions or plans that cover elective abortions.

All the Nelson-Hatch-Casey Amendment does is ensure that the long-standing language of the Hyde Amendment remains consistent in our nation’s health care.

I must inform you that the respect for life is the most important issue to me when I vote. I will not support any politician that believes it is acceptable to end an innocent life in any situation. I personally know many other voters who would agree. I am sharing this letter (along with your response) with them and urging them to contact you as well.

Please respect the wishes of your constituents and the lives of the defenseless.

Please vote yes on the Nelson-Hatch-Casey Amendment.

Sincerely,

Andrew Ensley

  • Share/Bookmark
international
participate