Home > General > Affiliate Marketing Forum

How Hard Is It To Code A Form In PHP And Make It Work With A Database? (22)


04-02-2013 03:39 AM #1 paycoguy (Member)
How Hard Is It To Code A Form In PHP And Make It Work With A Database?

I have a couple of lead forms that need PHP coding but I'm sick of paying these guys a lot of money to code them for me every time I want to make a new LP with a new DB.

Is the PHP/MySQL really that hard to do? If you take a standard lead form of Name, Email, Phone...is it possible for a layman to get a PHP script that can be used over and over again with other lead forms and implement that to work with a DB so a guy like me can save some money?


04-02-2013 05:10 AM #2 kyuss (Member)

I've recently been learning php and other languages off youtube, its real interesting and rewarding to learn. It isn't as hard as it seems to write your own custom code with a db.

This thread has a lot of good suggested resources:
http://stmforum.com/forum/showthread...ny-suggestions

These youtube channels are awesome:
Bucky Roberts - http://www.youtube.com/user/thenewboston
Adam Khoury - http://www.youtube.com/user/flashbuilding


04-02-2013 06:48 AM #3 localdentist (Member)

You can start by doing some google queries such as: php form generator

http://www.phpform.org/


04-02-2013 01:21 PM #4 caurmen (Administrator)

It's not terribly difficult. Capturing output from a form is trivial - just use

Code:
$variable=@$_GET['NAME OF FORM FIELD'];
Opening a connection to a database is a bit more of a pain in the ass in PHP, but still only about 8 lines of code. Here's a decent code snippet that would do most of what you need.

Overall, there's no reason for you to hire someone for a task like this.

QUESTION: would people be interested in some simple PHP/Javascript/JQuery lessons focused on affiliate marketing? Obviously, there's a lot of "learn to code" info out there, but not much of it focuses on the stuff that we, specifically, need to do.


04-02-2013 02:09 PM #5 kyuss (Member)

Quote Originally Posted by caurmen View Post
question: Would people be interested in some simple php/javascript/jquery lessons focused on affiliate marketing? Obviously, there's a lot of "learn to code" info out there, but not much of it focuses on the stuff that we, specifically, need to do.
Yes sir! That would be AWESOME and much appreciated!


04-02-2013 02:26 PM #6 paycoguy (Member)

Quote Originally Posted by caurmen View Post
It's not terribly difficult. Capturing output from a form is trivial - just use

Code:
$variable=@$_GET['NAME OF FORM FIELD'];
Opening a connection to a database is a bit more of a pain in the ass in PHP, but still only about 8 lines of code. Here's a decent code snippet that would do most of what you need.

Overall, there's no reason for you to hire someone for a task like this.

QUESTION: would people be interested in some simple PHP/Javascript/JQuery lessons focused on affiliate marketing? Obviously, there's a lot of "learn to code" info out there, but not much of it focuses on the stuff that we, specifically, need to do.
Yeah, if you say there's no reason that I should have to hire someone to do this for me...then I assume that you could teach this in a tute. If that's true, I'd love to learn how to do this on my own.

How much time is involved in a task like this where you're coding a 3 field lead gen form and hooking it up to the DB on your server?


04-02-2013 02:40 PM #7 caurmen (Administrator)

How much time is involved in a task like this where you're coding a 3 field lead gen form and hooking it up to the DB on your server?
If you know what you're doing, about 15 minutes plus another 10 minutes' testing. If you're a bit rusty, double that. If you already have the code snippet around (which is one of the big advantages of writing this stuff yourself), about 5 minutes.

Yes sir! That would be AWESOME and much appreciated!
Right - I'll run it by the guys and put it on the list of things to do tutorials on!


04-02-2013 03:39 PM #8 polarbacon (Moderator)

why does the data need to be in a db anyways.....why not send it to a CSV....chances are if your selling it or having it monitized its gonna go to CSV anyways.....so I am not really sure why a DB is needed....but maybe their is a part of your funnel I don't understand.....but tbh even if your firing off API leads in real time still no need to really have a DB.....


04-02-2013 03:52 PM #9 caurmen (Administrator)

True dat, and writing to a file is a) quicker (usually) and b) easier than writing to a database. Although of course there may be good reasons to send it to a db.

FWIW, I'm lashing together a new tracking system for some of my campaigns right now, and it's talking to flat files, not a database. You can always import into a database later.


04-02-2013 03:58 PM #10 paycoguy (Member)

Quote Originally Posted by polarbacon View Post
why does the data need to be in a db anyways.....why not send it to a CSV....chances are if your selling it or having it monitized its gonna go to CSV anyways.....so I am not really sure why a DB is needed....but maybe their is a part of your funnel I don't understand.....but tbh even if your firing off API leads in real time still no need to really have a DB.....
You may be right. I'm really not sure what goes on behind the scenes. I was under the impression it had to be saved to a DB. The one I'm using right now, when the lead comes in, it's mailed to me from the server with the lead info as a table inside the email. That's what I need.

BTW, if I were to pay someone to do this on Odesk, what should I be charging them? Some coders say it will take 2 hours but if I give them the other PHP pages I'm using for another site and just have them edit the info, I would think it would take a fraction of the time they're quoting me at.


04-03-2013 10:57 AM #11 caurmen (Administrator)

To be honest, whilst it won't take that long for the job, I'd not bother trying to push a contractor under 2 hours for a gig like this (or pretty much any gig). Communication will eat up the rest of those 2 hours anyway, and you don't want them to rush the job and end up giving you something that isn't what you asked for.

The one I'm using right now, when the lead comes in, it's mailed to me from the server with the lead info as a table inside the email.
Right - that's something that could easily be done using a flat file.

You'd need two scripts:

1) Captures the data from the form and stores it in a day-stamped file. (About 10 lines of code, maybe some more for security).
2) Runs on a cron job, slurps in the data from the file and sends it to you using the mail() command. (About 30 lines of code.)


04-03-2013 11:07 AM #12 paradise (Member)

You can write which fields you have and i will write you a PHP code, it is very easy..


12-27-2013 10:47 PM #13 bravenewworld (Member)

Was this tutorial ever made?


12-27-2013 11:15 PM #14 keepitsimple (Member)

I would be interested in this as well if it was


12-28-2013 02:17 AM #15 redhill (Member)

I am also interested!


12-28-2013 10:13 AM #16 caurmen (Administrator)

JasperP wrote a tutorial for something similar to this a whle ago: http://stmforum.com/forum/showthread...ghlight=Survey

Does that cover what you're looking for?

If not, I shall add this one to the list for 2014!


12-28-2013 09:43 PM #17 weekendwarrior (Member)

Jasper's code does the trick.

The approach I've taken with PHP:
1. Hire Dev guys once to do things I don't understand
2. Hack the code when I need to repurpose for something else -> Studying up on anything that's new

I've taken this approach from understanding nothing and now I get by. PHP developers can take a lot of supervision time up + the usual risks of hiring people who aren't very good, so it's an investment of time that pays off substantially.

The other approach is to find a good PHP guy and use him all the time so he gets to understand your needs and its more time efficient.


12-28-2013 10:05 PM #18 redhill (Member)

JasperP's tutorial is all i need.

Cheers


12-29-2013 12:30 AM #19 marinhogomes (Member)

It's not hard at all.

I've been coding PHP for 15 years.

And done more than 10 complex applications with it... so I'm here for whatever you need.

I prefer database than CSV... but that's just me.


12-29-2013 05:59 AM #20 hd2010 (Member)

Yup it is not hard at all, I prefer mysql, much easier to deal with compared to text file.


12-29-2013 07:33 AM #21 kamaleon (Member)

Hey guys, to add more options to the list, what about these form builders? You can have up to 3 forms for free and 100 entries per month, if you need more, you have to pay

http://www.wufoo.com/

Here are some examples http://www.wufoo.com/examples/ and you can embed them in a web page.

And that seems a good plugin for wordpress

http://www.gravityforms.com/


01-02-2014 05:30 PM #22 weekendwarrior (Member)

This website has free lessons for PHP, jquery, javascript - invest a few hours to get up and running - literally. I'm using it to get Jquery handled for forms etc.

http://www.codecademy.com/


Home > General > Affiliate Marketing Forum