homepage Welcome to WebmasterWorld Guest from 54.211.97.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Offline information collection
pillageTHENburn

10+ Year Member



 
Msg#: 71 posted 7:59 pm on Jun 5, 2003 (gmt 0)

Hey, as usual I have a question that may get laughed at by the brains that frequent this board...
My story is this: I have a form on a clients website that is used to collect email addresses. It is a simple form with a PHP page that sends an e-mail to the clients address and signs the user up for the mailing list. It works great. They want to be able to have a Laptop running offline do the same thing (well almost the same).

I created the HTML and form and all the easy stuff and I thought that I could simply host my PHP on the hard drive (ie. target="C:\signedup.php") then change the code to save a file somewhere (like in a given notepad file). Everything was great until I actually tried to do it. With my very limited knowledge of this sort of thing I quickly found myself lost beyond belief; as usual when I find myself in those situations I come running here! Please help! I am getting desperate. I would love to learn something new!
Thanks in advance.
-Linus

 

dingman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 71 posted 9:03 pm on Jun 5, 2003 (gmt 0)

does the laptop actually have a php interpreter? For that matter, to activate the form from a web browser, you'd need to be running a web server on the laptop. I've used PHP commend-line scripts independant of a browser, but if you want them to be called from a browser, you need a web server.

Once you have that, you can just change the form to have 'action="http://localhost/form-processor.php"'. Exactly where on the hard drive that is will depend on where the web root for your web server is.

Doing something like this for a stand-alone laptop seems excessive. I certainly wouldn't want to run a web server on my laptop. Are you sure they wouldn't be just as well off with a quickie program in VB/Python/Perl to take the data and write it to a file for them? Possibly even just a spreadsheet with the column names labeled, and processing the data later by exporting to a CSV file or such?

willybfriendly

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 71 posted 10:50 pm on Jun 5, 2003 (gmt 0)

"Doing something like this for a stand-alone laptop seems excessive."

Hey now, I do virtually all of my development on my laptop. It is nice to be able to show clients exactly hwat things look like and how they work in an offline environment (where "borrowing" the code/markup is never an issue).

I run apache and php on XP. Works great.

WBF

dingman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 71 posted 2:31 am on Jun 6, 2003 (gmt 0)

Oh, if the laptop is a development machine, it makes *perfect* sense - I wouldn't have a development machine *without* Apache+PHP. But if I were developing an app with the intent to use it on a non-networked machine, I wouldn't bother with the overhead of running a web server and generating HTML for a browser instead of, say, linking against GTK+ (or Qt, or whatever Windows people use) to provide an interface.

pillageTHENburn

10+ Year Member



 
Msg#: 71 posted 11:43 am on Jun 6, 2003 (gmt 0)

Well doing a spreadsheet was actually my first suggestion but they really want the look of a website and the interactivity of a website. This will not be merely a "sign yourself up for a newsletter" form, it is more like a website with some exclusive content and a mailing list signup option.

"Are you sure they wouldn't be just as well off with a quickie program in VB/Python/Perl to take the data and write it to a file for them? "
- Can any of that be run via HTML in a browser?

I was thinking there may be an extremely simple way of getting around this...maybe something with the form action only? Could I do a method="get" then somehow use hidden values to write a file with the input information? I didn't know what I was getting into here...

Oh yeah and the laptop they are using has win98 and it doesn't look like it has anything too fancy on it, but I have been given limited permission to install neccasary things.
Thanks for the responses! I'll keep working on it...does anyone know where else I could look for something like this?

-Linus

Timotheos

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 71 posted 4:23 pm on Jun 6, 2003 (gmt 0)

If you need help setting up the web server then I'd suggest going to HotScripts and looking up Installation Kits. I've personally used the firepages one on a win98 machine with no problems. It even sets up mySQL but using that seems a bit much for what you're storing. If you want to write to a file then look at the "fopen" (in append mode) and "fwrite" functions on php.net.

pillageTHENburn

10+ Year Member



 
Msg#: 71 posted 4:46 pm on Jun 6, 2003 (gmt 0)

Awesome! I'll check it out! Thank you for the input.
I'll let you all know how it turns out...
-Linus

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved