http://superstickphase.com/notify.php
http://superstickphase.com/contact.php
For the first one, notifications.
What I want to have happen (what seems best anyway) is when people fill out the form to get notifications and hit submit.. have php do the following:
- See what they chose to fill in. Whatever they left blank use a dash (-) for the variable.
- Check that the email is in fact an email (or at least something@something.something)
- Append that data into an existing file on my server. The file entries look just like this:
nickname|first|last|email|
I don't plan to use nicknames, so probably just use a dash for that. So I imagine say, five sign-ups, the file could look something like this
-|-|-|someone@gmail.com|
-|-|-|someoneelse@yahoo.com|
-|Deirdre|-|deirdres@email.com|
-|-|Bob|Bobster|bobbobster@comcast.net|
-|-|-|raiztlin@youknowyouwanttosignuponmysite.com|
this file isn't in my web dir so I guess I'll have to give apache rights to it or make a symlink to it but I'm not too worried about that.
As for the second part of notify.. removing an email. I think automating that might not be worth the trouble it would probably be to get php to read the whole file and pull out the line with the input'd email. (or would that be easy?) So I was figuring I'd just have that append to some other file that'd I'd just periodically check and manually remove the people.
((SEE EDIT BELOW)) The second page, the contact me. I'd like to have my mail server email that to my mail account, but I'm not sure how simple that would be. I bet it'd be easier to have it toss that into a sql database and make a page I use to view it all. Like a little mini webmail page. That shouldn't be hard. I'll just have to brush (way) up on my mysql skillz.
So. There's my plan. Whatcha think?
Edit: Ok! Well the contact me was easy! Following this for guidance: http://www.visn.co.uk/form-mail.html and doing a little tweaking, and works pretty well. I've got it emailing to two accounts, and also making sure there is something actually in the note field before it accepts the submission. Rockin'! However.. it puts slashes before quotes and apostrophes. It sorta sucks but I can certainly live with that. It's functional and that's all I really care about. So, onto the notification list...
Edit 2: Alright, have the notify page sending the add form variables to one php page for processing, and the remove part sending to a second php page for processing. I have both set to reject submission with no email filled in. Working on the submitting for notifies, this is what I've got that isn't ((EDIT: is now!) working:
$first = $_REQUEST['first'];
$last = $_REQUEST['last'];
$email = $_REQUEST['email'];
$entry = "-" . "|" . "$first" . "$last" . "|" . "$email" . "|" . "\n";
$fp = fopen('/path/to/file', 'a'
;fwrite($fp,$entry);
fclose($fp);
Man I rock.
I'd like though, for it (just like the contact me form) to check that it's at least in correct email format before accepting it, and I'd also be cool with it checking for duplicate addresses.
But it works! On to auto removal..
Edit 3..how would I do this? file_get_contents.. then remove the line with the address, then file_put_contents?
Alright no more edits tonight I promise! Imma get some sleep right quick.
-----signature-----
Every forum should have a Phases.
Bringing SSP back to life at http://www.superstickphase.com !
Retired AC/AC2 - Phases Og'Maxim - Leafcull
Bringing SSP back to life at http://www.superstickphase.com !
Retired AC/AC2 - Phases Og'Maxim - Leafcull



. But, the last two ^^ I think I might need help with..

It's driving me nuts.