I'm developing a module which grabs contents from an external page authored in Macromedia Dreamweaver, and inserts it into the body of a new node. I have a form which allows me to enter the path to the page, the start and end delimiters, and a couple other things. Once the data is entered, I submit it, and it creates the node. What I'd like it to do is run the import code snippet when I click on preview or submit, so that the page is sucked in and stored in the database.
The two problems I have right now are (and I'm sure this reveals my ignorance of PHP :-):
1. When the node is created, the page grabbing php code snippet needs to use the path, delimiters and other variables I've entered in to the form before it's been written to the database.
2. The page grabbing code needs to run and update the body every subsequent time that the preview or submit button is clicked.
I'm working from the node_example.module code. Here's my module code.
<?php
// $Id: mmcontrib.module,v 1.153 2006/02/21 18:46:54 binky Exp $
/** Database definition:
* @code
* CREATE TABLE mmcontrib_data (
* nid int(10) unsigned NOT NULL default '0',
* path varchar(255) NOT NULL default '',
* subpath varchar(255) NOT NULL default '',
* startdelim varchar(255) NOT NULL default '<--starthere-->',
* enddelim varchar(255) NOT NULL default '<--endhere-->',
* updinterval int(10) unsigned NOT NULL default '0',