21
Apr 12

How to grab an ip address and put it into a MySQL table

I recently tried to add some back end PHP code to grab the ip address of a person signing up to www.INRtracker.com and put that ip address into one of our MySQL tables. However, I ran into some trouble. When I used $_SERVER, the code would run, but it wouldn’t put anything into the MySQL table. Then I thought, maybe it’s because I’m using varchar for the MySQL column structure. So instead I decided to change the structure of the column to an unsigned integer. But, I had to convert the ip into an integer, so I did a quick search on Google before I started coding away – and I found this post: http://daipratt.co.uk/mysql-store-ip-address/ that shows how to do this with a PHP function called ip2long.

The purpose of keeping track of the ip address of registered users on INR Tracker is to learn how they are using our website when they are on our website and how often. Google Analytics in my opinion is pretty inaccurate and can never compare to server side analytics. Veronica, my business partner (CEO) came up with this as part of our product management strategy. This way we can figure out what parts of the site we should dedicate our time toward and what parts we should possibly drop.

If everyone’s using one part of the site, then we know we should improve that more. Consequently, if everyone’s not using another part of the site, then we know we shouldn’t waste our time on improving that part of the site.

Anything you do to learn more about your users? Please share it below :) .


16
Apr 12

How I Learned to Code For My Start Up

After failing with three web startup Companies, I realized what I had to do to make it. I needed to learn how to code. It’s too hard to get a technical co-founder to see your vision and join you, because either they’re working for a Company making six figures or working on their own start up, so you’re either left to spend a lot of money on a prototype or code it yourself. I’ve done the whole spend lots of money on building your prototype thing and it sucked, because you can’t pivot fast enough and your money goes down the drain. When you learn to code, you can pump out features fast, launch quickly, save almost all your money and if you’re successful, convince awesome developers to work with you.

When I decided to learn how to code, I was hell bent on figuring things out. I wanted to learn everything I needed to. I spent hours, all day and sometimes all night. I knew this wasn’t for some stupid grade or personal enrichment – this was for my dreams and goals. This was for my start up. Nothing was going to hold me back. That’s why I learned so quickly. If you recognize this kind of passion in yourself, then you can learn to code too. I don’t have an Ivy League degree, I don’t have experience working for Google, I don’t have much money, but what I do have is an extreme work ethic and the vision to change things for the better.

I decided to learn PHP, because of the following reasons:

  1. PHP is the easiest one to learn. It’s not restrictive to being object oriented, so it’s pretty easy to get started.
  2. Two of my friends knew PHP well so I knew I could go to them for questions. I ended up getting good advice from them on database scheme strategy and how to approach certain programming problems.
  3. I had a book on PHP (it had some dust on it though lol). Somehow I lost it and don’t even know what it’s called. Don’t worry though –  it kind of sucked – and you can probably find a better book out there somewhere.
  4. WordPress uses PHP and WordPress is cool.

I first started with the video tutorials on Lynda.com, and reading my PHP book simultaneously, however I felt they both didn’t explain complicated things well and were slow, so I started using phpacademy.org, which helped me tremendously. I also coupled that with doing all the exercises at phpexercises.com. I was also constantly going to the php.net site to look up functions and read the comments on each page. I still do that to this day, and I’m sure everyone who codes in PHP does too.

One of the most frustrating things about PHP is the error notification. The line that PHP tells you your error is on – is usually not where the error is at. Don’t worry though, somehow you’ll get used to this and figure all your errors out quickly. I never thought I’d be able to debug things quickly, but I managed to, and if I can – you can too.

If you don’t have a PHP book on hand, these are great places to go to: http://devzone.zend.com/6/php-101-php-for-the-absolute-beginner/ and http://net.tutsplus.com/tutorials/php/20-ways-to-save-kittens-and-learn-php/.

PHP is pretty useless unless you know how to work with a database. I learned MySQL, because it came with WAMP (the package I used to install PHP on my computer) and I was accustomed to using phpMyAdmin which works with MySQL specifically I think.

Working with databases seems a bit daunting at first, but then I realized it’s pretty much Microsoft Excel for the internet – and it became a whole lot easier.

This is a great site to learn the nuisances of SQL: http://www.1keydata.com/sql/sqlin.html.

In addition, I read books about JavaScript, object oriented programming, used Lynda.com’s javascript tutorial and did the jQuery tutorials on PHP Academy.

I got help from Stackoverflow.com and phpfreaks.com, but sometimes no one could help me. Not my friends, no one on a forum and I was stuck to figure things out by myself, which was good, because it made me a better coder in the end.

The most important part that led me to become a coder is the goal I had. I’m not the kind of person that likes to code for fun. I only code if I have a bigger goal.

That bigger goal was to build INRtracker.com. It’s my newest start up and it cost me less than 60 bucks to launch the beta product. Not bad considering that it was about 150 times less expensive to launch than my past startups. I spent some money on the domain name and some pre made PHP classes from codecanyon.net.

If you can use pre made code – then go for it as long as the documentation is good and the author of the code is communicating with all of his customers’ questions. I say this, because I guarantee things will break and you’ll have a hard time fixing them without the help of the code’s author.

Never let anyone or anything stop you. Go code and make your minimum viability product for your start up. It’s the only way to truly influence your startup’s path.


03
Oct 11

How to Create a Hyper Local Craigslist for Your Community

Craigslist is awesome, but let’s say you want a hyper local craigslist for your community. When I say community it could mean your high school, college, church, temple, gym, company, neighborhood or in my case – my Apartment Complex.

I know it sounds a little weird, but it’s genius. It’s genius because I’m busy and I don’t have time to drive around 25 miles looking for things, but if things and services are near me (like literally right next door) then i’m totally willing to take 15 minutes out of my day to walk over and show my neighbor how to do sit ups (for $20/hr) or buy some furniture (I don’t have a truck, so I’d pretty much be dragging it out to my apartment).

Step 1.

You don’t need a hosting account, you just need to go to AdCommunities.com, sign up for free and make a hyper local craigslist there. I made mine. You can check it out here: http://springgarden.adcommunities.com/.

Step 2.

Market the hell out of the url. www.AdCommunities.com makes it easy – by letting you print out pre made fliers with a click of a button (you can see ones I printed out and posted around my apt complex below). I’m also going to talk to my neighbors about it too, and my property manager so she can get her staff to slip fliers under people’s doors of the buildings. Her benefit is that she’ll have a centralized location to post announcements quickly to her community.

fliers on mail boxes
fliers in laundry rooms

fliers on apartment building doors

A little tip:

Tear off a slip or two on the bottom of each flier before posting them up to make it look like people have been looking and tearing the slips off by themselves. This way it’ll encourage people to look, read and tear off more slips. I know it’s sneaky, but isn’t that life?

Step 3.

I’d jump start the community with some stuff. I posted some ads for my community – you can check them out at this URL: http://springgarden.adcommunities.com/

I’d totally encourage you to start one. It’s really empowering to help facilitate your own community’s hyper localization.

The Bottom Line:

AdCommunities.com is a community classifieds site where anyone can launch a classifieds site easily (like craigslist). If you’re a college student then this is the ultimate site to launch a college classifieds site made specially for your college, which you can manage or not manage (whatevs bro).