Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7473 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hello -

I've been developing a database solution for a nonprofit I volunteer for for a few years. I'm wondering how I would go about setting up a webpage on our main site so that a user can sign up for our mailing list. Right now, when they click send, it just shoots me an email with their info and then I manually enter it in FMP. Is there a way to make the website talk directly to FMP to create a new record with the user's information? THANK YOU in advance for any help you can provide! (Using FMP 6 and Apache)

Posted

CWP is the way to go to serve and gather FMPro db file data on the www. But I do believe there is a plug-in which will take email and parse the name,add, etc into FM. I just don't know the name of it. It's an option if that is all you need.

Posted

Hi, If you're starting out with your first FileMaker CDML link, here's a form page template that will give you the basics (with apologies to the old hands around here!).

change the suffix from 'txt' to 'html' and call it by:

http://mydomain.com/directorypath/FMPro?-db=mydatabase&-format=formpage.html&-View

Alternatively, as has been said already, if you need to continue using a mail form, get the

pop3/SMTP plug-ins from

http://www.smtpit.com

and email direct into the database.

regards, jeff

formpage.txt

Posted

I've got another less sophisticated approach. It wouldn't work for something really interactive like a web store, but is a viable alternative to the e-mail approach that Jeepboy is describing.

For cost reasons I'm not hosting my own site, and my ISP doesn't host FM. I have a web form that just sends data to a plain tab-delimited text file. At the end of the day I can just download the text file and import it into FM using the update and add new option. You can flag new records and sort these so they come to your attention. (By the way, does anyone know of a utility that will allow me to automate and schedule FTP commands?)

I also use the Troi URL plug in so users out there in the fild can send me data this way right from FM.

Cheap and easy. (Mama told you to stay away from solutions like this. smile.gif)

Dan

Posted

Hi Dan,

That sounds like a useable solution and I gotta confess to doing it myself to share data around between systems, but IMO the advantages that CDML pages have if you can use them is that;

1 after submitting, you can offer the user the chance to read and amend what they have just input, which looks nice and helpful

2 The data's available real time right after submiting

3 you don't have to run scripts on your web interface!!

regards, jeff

Posted

Hi Dan.

I have something a little more sophisticated:

1: a standard perl cgi which writes the data into a text file on the web server

2: a perl cgi which transforms the data into FileMaker xml, and after successful download via FileMaker XML import, deletes the entries.

Posted

>By the way, does anyone know of a utility that will allow me to automate and schedule FTP commands?

1) call a shell script with applescript (MacOs X)

2) call an ftp app or url access scripting with AppleScript (MacOS 9)

3) call a batch file exported from filemaker (Windows)

Posted

Hi Christian,

That's pretty close to what I'm doing. I have a Perl cgi writing the form data to a tab delimited text file. What's the utility of transforming it to xml? Can't I just import the text?

I like the batch file idea. Can you perform ftp commands right out of windows? I must admit I didn't know it was possible (if it is). I assumed that some other piece of software had to be in between. That could be really slick. How's it done? You're always pusing me to learn more! Thanks. smile.gif (My weekend adventures with WSH paid off, by the way.)

Thanks,

Dan

Posted

On Windows, you can use the "Send Message" script to send a command (message) to any application or script, along with parameters. Add the "Send Message" step to your script, double click the step to open the options for it, then select "Text", then enter the path name to the application or script you want to run.

For example, say you had a .bat script you wanted to run, located at c:scriptsmyScript.bat. To run this script, you would enter the following in the "Text" area:

c:scriptsmyScript.bat

Let's say that myScript.bat looks like this:

echo %1 > myScriptOutput.txt

This script takes in 1 parameter and writes it out to myScriptOutput.txt. To pass a parameter to this script, you would change the Send Message "Text" to:

c:scriptsmyScript.bat "this is my param"

After running the FileMaker script, you would have created a text file (c:scriptsmyScriptOutput.txt) containing a single line that reads "this is my param" (without the quotes).

You can do this with any program that exposes a command line API. For example, there is a command line API for WinZip. You could send a message to the WinZip EXE telling it to zip your back up files, and then to copy them to a certain location. Further, if your "Send Message" script uses a field instead of static text, you could dynamically tell WinZip which file to zip, and where to copy it to.

If your .bat script (or your command line EXE, or WSH script, or whatever program you have that exposes a command line API) is in a folder which is specified in your environment path variable, you don't need a fully qualified file path to the script. For example, "command.exe" and "cmd.exe" are both in a file such as c:winntsystem32, which is most likely in your path variable. So, to open the cmd.exe shell, you only need to specify the following in your Send Message step:

cmd dir > c:test.txt

This command would start up the cmd.exe program, pass it the parameter "dir", and then redirect the output ">" to "c:test.txt". In this example, the cmd shell remains open even after it's done with its commands. To have it automatically close itself, you add the /c switch, like so:

cmd /c dir > c:test.txt

Posted

Hi Christian, I have written a short Perl script which communicates directly with FileMaker, which could help you eliminate the use of an intermediary XML file which you import into FileMaker. This is just a "quick and dirty" example and NOT an abstraction class like FX.php. None the less, you may find it useful smile.gif

You can download the sample script, readme, and FileMaker file at:

http://mariano.petersonpages.com/demo/fmp/fmp_perl.zip

Posted

Hey,

That all makes sense. But my real question is, can you actually execute ftp commands right from the shell, or do you need another piece of ftp software that is called with parameters. If the former, then what is the command? If the latter, then are there any suggestions for such a utility?

Thanks,

Dan

Posted

Hi Dan!

Consider also using

Import/Export Records From File: ftp://user:pass@SERVER:port_NO

it's an alternative to "Batch Image Upload/Download" and baypassing the need for user to use FTP software....

software (win) WS_FTP has the ability to schedule file transfers as well!

shell sounds tempting as well smile.gif

Posted

Cool! But one problem. This works when I do it manually, but not when I script it. I'm specifying the file the same way, and unchecking the relative path feature. Any ideas what's wrong?

Posted

ur right Dan!

I am nost sure why it would not save as Aboslute path...perhaps absolute paths are only "saved" when connection is 'physical'....

I'll have to look at it more....in the meant time, I was thinking more about shell and Send Message.....I wonder if there is a way to incorporate Custom Dialog Box with Shell login.....

command or cmd into C:>ftp help

will return info on commands in shell...Honestly I have not explored it but I am sute that that sript+shell can create a "true" absolute path to your local machine at which you could have (by now) transferd the docs into a pre-determined folder = the one created by shell script!

Now, this would be trully "your" solution.....the other way arround it is to use FM scrfipt to fire an File.exe....

1- if ur using some FTP softwre

2 - IF NO FTP software is at disposal then consider using http://www.AutoIt.com freeware that will allow you to script any key-mouse action...so if u like make a script that will "simulate" your shell command and save it as File.exe...which can then be executed from FM by SendMessage.

I am still working on this...but those were my initial thouhgts!

All the best!

Posted

Thanks. This is making the case for what Christian originally suggested. Instead of having the cgi write a tab delimited file, have it write xml and import that directly. I know that can be done from a web site. But it would be a pain to set up. My other option is to script the ftp download of the file via the command line and a Send Message step, and then import to FM from the downloaded file. The article Mariano pointed out helps clarify that. Yeah, I think I'll mess with that...

As for the custom dialog box, yes that would work. Have a CDB with an input field as the first script step. The next step would be a send message step of a field that would concatenate 'command /c ' & input field. This would send whatever you entered in the CDB's input field to the command prompt.

Thanks,

Dan

Posted

yes yes Mariano definetly 'has something behing those snowbaording googles' laugh.gif

Also, Dan, consider this point as an add-on to the PeachTree isues with data mining and scedhuled export of reports to an FTP (or even better yet SSL)accesible location and then an Import based on SQL and groupings and sums and....so on.

Good posts!

Thanx for sharing!

Posted

cjaeger said:

Hi Dan.

I have something a little more sophisticated:

1: a standard perl cgi which writes the data into a text file on the web server

2: a perl cgi which transforms the data into FileMaker xml, and after successful download via FileMaker XML import, deletes the entries.

Ah, Christian, I should have listened to you at the outset. I screwed around with trying to script an ftp download of the text file for about 3 days. Countless problems ensued. I just couldn't find a way of keeping FM, Windows, and my ISP's machine all in sync. FTP logins would fail, data would get dropped, etc. etc. I decided the xml solution was probably less complicated than I originally imagined.

I tweaked the cgi that was writing the data to the text file so that it would then turn the text file into xml. Now I just open my FM file, it retrieves the xml, and off I go. nothing could be easier.

Thanks. Next time advise me to take your advice straight away. blush.gif

Dan

Platform: / Version:

FileMaker Version:

Platform: / Version:

FileMaker Version:

  • 3 months later...
  • Newbies
Posted

Hi Mariano,

I have downloaded and got your script working (thanks).

Next question...

Updating defined fields in the database is relatively easy (now that I know how smile.gif ). What happens if I want to add more passwords to the database and set the permissions for that password?

Just so you understand what I am trying to achieve... I want to be able to sell subscriptions to a database (not mine, a friends and he has less computer skills than me). I thought about using paypal with their instant payment advice system coupled with a perl script and then sending back the generated password to the new subscriber (out of the perl process).

Is it possible?

Thanks for any help.

Kind regards

This topic is 7473 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.