Hey guys, I know a couple ways of doing this but they aren't pretty. Was thinking there might be an easier method than I've thought of. Basically I created a pager system that submits to a pager company's tool on their site with the number and message associated with it. I'd like to create a log of what pages are made through this tool and I'm not sure how to accomplish this easily. The purpose of this is so they can track what pages are being made through the system and not have to look at 125 seperate pager records.Ideas?[Edited on December 14, 2006 at 3:47 PM. Reason : Clarrification]
12/14/2006 3:46:18 PM
uhyeahopen a filewrite to itthe end
12/14/2006 5:54:58 PM
It has to happen when someone hits submit on the form. So either I can send it to one page and have it redirect or do some javascript magic. Opening a file and writing to it kinda defeats the purpose of making a database log. However I guess i didn't specific where the log would be.
12/14/2006 7:38:31 PM
form to enter data submits to local pagelocal page logs data and submits to pager site
12/14/2006 11:11:50 PM
^ yup. I guess what I was hoping was there was something I could to the form that would allow it to submit to two places at the same time. No biggie.
12/15/2006 7:25:12 AM
You can trap the submit with javascript and do all your logging operations then allow it to submit like normal.For example:In your header:<SCRIPT language="javascript"> function saveClick() { //all your logging shit //then tell the form to submit Form1.submit(); }</SCRIPT>Your form button:<input type="submit" name="btnSave" value="Save" id="btnSave" onClick="saveClick()">Obviously this is psuedo code, but I have this running in several sites.[Edited on December 15, 2006 at 8:07 AM. Reason : .]
12/15/2006 8:03:05 AM
12/15/2006 10:09:51 AM
you know, instead of making threads like thiswhy don't you look at the HTML, JavaScript, and DOM specs and figure out what the fuck you're doing
12/18/2006 1:37:48 PM
12/18/2006 1:50:04 PM
ya know, that stuff would work, and i've done it a few times myself, but i get real uneasy anytime i have javascript doing any heavy lifting. do it all on the php/asp/whatever side, at least you will know that the php will do what you want, and not have to worry about some browser's wack javascript implementation screwing your stuff up[Edited on December 18, 2006 at 2:06 PM. Reason : scrager and noen are correct, as usual]
12/18/2006 1:57:42 PM
12/18/2006 2:53:41 PM
12/18/2006 3:19:00 PM
i'm with qntmfred and scrager on this though i don't really know shit about the Prototye library
12/18/2006 3:37:32 PM
Thanks for the ideas. I knew how to do it with javascript, but I really don't have any php experience so I'm not sure how to code that. I didn't realize Ajax could be used like that though. Good call.[Edited on December 18, 2006 at 4:54 PM. Reason : verbs are good!]
12/18/2006 4:53:30 PM
well what language are you using? you're not crafting the whole site with javascript, right
12/18/2006 5:01:55 PM
Avoid javascript like the plague for something like this.[Edited on December 18, 2006 at 5:41 PM. Reason : Do it all server side.]
12/18/2006 5:40:42 PM
no no. It's an html page, that's hosted on an apache box with php support. I'm probably just going to move the entire app over to a Cold Fusion box and do it there. No, I have no plans of doing this all in javascript. I thought I'd throw myself at the wolves for a better idea before i did it in CF.
12/18/2006 7:54:05 PM