I have been trying to find a way to collect customer email addresses when customers connect to free wifi.

So basically they would connect without having to specify a password and a web page would then open asking them to agree to the terms and conditions and specify their email address. If they have not connected before it wold then proceed to ask for their name and maybe ask them to tick a box to subscribe to a mailing list.

I did wonder about being able to verify the email address but this may be too difficult and I could instead use some Javacript to just check that the email address is correctly formatted or maybe add some code to check that the domain part exists.

After researching which routers should work with I have purchased the Netgear WNR3500L which was supposed to work with DD-WRT but it only works with a mini version as it is the v2 revision so is not compatible. The cut down version does not include a captive portal.

I have now tried the Tomato firmware and whilst I have enabled the captive portal and it does now show some generic terms and conditions which need to be accepted, it seems that the built in web server cannot run php as if I try to upload a .php file from the web interface it tells me it has an invalid extension and that the extension must be a .html. Then if I try to upload a .html file I get a Server 500 error.

I have spent hours trying to get this to work and don't want to waste money purchasing additional routers if what I want to do is not even possible. I am a programmer (although not with this kind of thing) so should be able to follow instructions if someone could point me in the right direction.

I was hoping to just be able to write a PHP web page to collect the email and add it to a database.

The idea was to ask people to give their email address in order to use the free wifi and then they could be sent special offers to try to entice them to come back again.
There would need to be an option to unsubscribe as well on the emails as the last thing this should do is send spam to people and annoy them and put them off coming back as this would be the opposite to what this is trying to achieve.

This seems to be the way most large organisations do it but I'm sure they have a lot more money to invest in custom solutions.
We have benefited from a few free coffees etc, from using free wifi at different locations so did not consider the emails as spam.

So the idea is not specifically to make money although the hope is that it would help. Also I am not the owner of the company but am a programmer who was asked to look into this for them. It seems a bit harder to do than I expected.

No spammers will every consider their own emails as spam because their supposed "benefit" for recipients. Just like thieves will never consider stealing as a crime because of very "good" reasons to do so.

The point is if a customer wants to use a service then they make the call whether to provide their email and use the service.
If you don't want to be spammed then either don't tick the box when logging into the wifi for the offers or to be doubly sure don't use it and just use 3G.

The restaurant is not going to want to upset people as what would be the point in that? It would be important for the marketing team to respect people's choices.

I would not be doing the "spamming" anyway and was just looking into it for someone else.

In the end whilst I could get the captive portal working I was unable to customise it.
As I was unable to get any help with this here I gave up and they just provide open access with a password of "customers" but are looking at using The Cloud across their venues who do offer this service and it is popular in large companies along with O2 in the UK.