DISCUSSIONS

Find the answers to many of your expat questions here

View Latest Posts

You're missing out...

As a member you can enjoy exclusive info and offers.

REGISTER NOW

Need a webmaster's help automating a page w/MX

Posted by nicevictory - Created: 13 years ago
0 0

Hi, I need help automating a page with Dreamweaver MX.  I have created a database where I want to enter information.  Then I followed the instructions in the Dreamweaver MX manual to create a form to enter the information that will post in the database.  But, I'm having trouble making it all work (the results page, the form, posting the information, and then going back and editing it).  I'd like to design something that connects to a local database in my computer and enables me to enter data and then query and edit the records in the database.

Also, I'd like to create a function that sends an email using the email addresses that I place in the "Email" field of the form.  The email will be a standardized email that I already have in html format.

I have had a hard time finding webmasters in Nice that know about automating pages and ASP, so any help would be appreciated.  Please email me at nicevictory@hotmail.com

Thank you

Nicevictory

Sorry no image available

1 reply

Sorry no image available
Posted by JohnD-185075 - 13 years ago

Here's how I would do it if I just wanted a really basic system (N.B. personally I probably wouldn't use ASP or Dreamweaver, but the principles are the same). I would use several pages (although it could probably be done with just one or two):index.aspOn the left hand side there are 2 buttons labelled 'Insert' and 'Query'. The 'Insert' button links to a page called "enterdata.asp" and sends the HTTP request variable $action with the value 'insert' (i.e. it links to "enterdata.asp?action=insert". The 'Query' button links to a page called "viewdata.asp".On the right hand side of the page is just a welcome message.viewdata.aspThe 'Insert' and 'Query' buttons are on the left. A list of all records from the database is displayed on the right. This could be split over several pages using a $page_id variable or similar. Next to each record there is an 'Edit' button that links to "enterdata.asp" with a value of 'edit' for the $action variable, and another variable named $record_id containing the record id from the database (so it would link to "enterdata.asp?action=edit&record_id=69", for example).enterdata.aspThe 'Insert' and 'Query' buttons are displayed on the left. A form is displayed on the right. This form can either be used to add a new record to the database, or edit an existing one, depending on the value of $action:'insert': display a blank form ready to be filled in by the user.'edit': Do something like "SELECT * FROM mytable WHERE record_id = $record_id" and populate your form with the data that it returns (if $record_id doesn't exist, display an error).(neither): Display an error messageThere should be a hidden field containing the value of $action (and $record_id if $action == 'edit'). When the user clicks 'submit', it posts the form data to "submitdata.asp".submitdata.aspCheck that the values that the user has entered for each field are valid. If not, immediately go back to enterdata.asp with the errors highlighted in red. Remember that if $action == 'edit' then $record_id must have a value that already exists in the database otherwise you will get an error. If the data is all OK, perform a database insertion/update (depending on the value of $action), and display a message saying that the insertion/update was successful, with a link to go back to the main page.