Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How best to deal with contact information

Status
Not open for further replies.

hondaman2003

Programmer
Mar 3, 2008
202
US
I have a general question and I hope I'm in the right place. I have a very small website at this point. I have a contact page that allows someone to enter contact information and it will put the information into an access database. I know MS access is not the best way to do this. I am learning MYSQL and until I am ready I am going to be stuck with the access database.

How do people usually handle retreiving information out of a database (either access or MYSQL)? I'm hosted with godaddy and an told that it's not possible to link a backend MYSQL (or ms access database on the server) to a frontend access database where I can view the contact information. I basically want to be able to either just mark the contact complete so it will not show up anymore or just delete it.

What do you guys know about this?
 
I am hosted on GoDaddy. You can have an Access database (which will be fine for this) and interact with it...

If you are talking about somehow linking databases directly then I don't have a clue. If you are talking about just building a basic Web front end (HTML-ASP-CSS) allowing you to minipulate a database backed (Access) there is no problem with that.

Yes you can FTP a database up and down.

 
Would you have this "interactive" page directly on the website or would you build something on a local computer that just links over to the database server?
 
I personally would build an ASP front end hoted at GoDaddy right alongside the database that would allow me to retrieve, edit, add, and delete info from the Access database. I would put it all behind a login page and let it just be a contact database you could hit from anywhere.
 
Is there some sort of notification that could happen like an email that a contact is available in the database or something like that? Rather than just having to check blindly for contacts periodically?
 
Oh I see. Other people will be adding stuff.

Yes. I think one could make the page that accepts the form data and adds it to the database also send you an email with whatever info it is adding.

Page 1:
Form with action=page2

Page 2:
Grab form info
Insert form info in database
Send you form info in email notification
Provide feedback to visitor

Somewhere in there you will want some sort of validation or data cleaning so that you don't insert unsanitized user input directly into your database.

Can you do all that or do you need some help? If you might need some help, where do you want to start?

 
If you are willing, I would very much appreciate that! I suppose I could redesign the form that does the entry into the database. I don't believe there is any cleaning to prevent junk from going into the database.
 
You have two basic approaches to data cleaning, client side and server side. Other variations are possible I am sure.

Client side is usually a javascript affair. Server side is done in whatever server language you speak- I speak a little classic ASP so I use that. As with most anything, you can make your validation way simple or way hard. Obviously there are benefits and drawbacks to each approach.

Ok. You have a form:

<form id="registration_form" name="registration_form" method="post" action="form_ar_test3.asp" onSubmit="return validate_form( );">

<fieldset>
<legend>Personal information</legend>
<label for="fname"> First name:</label>
<input name="fname" id="fname" type="text" />
<br>
<label for="lname"> Last name:</label>
<input name="lname" id="lname" type="text" />
</fieldset>

</form>

Notice the javascript on the action line. I use this script I got from
<script type="text/javascript">

function validate_form( )
{
valid = true;
if (document.registration_form.fname.value == "" )
{ alert ( "Please fill in the 'First Name' box." );
valid = false;
}

if ( document.registration_form.lname.value == "" )
{ alert ( "Please fill in the 'Last Name' box." );
valid = false;
}

return valid;
}

</script>


Obviously you can expand the scheme to check as many elements as you want. If I knew how to write cool javascript I could condense the javascript so that it was a function or something that checked all form elements. I don't know how to do that so I haven't.

You can get javascript stuff on the web that will help you check phone numbers or whatever. All the above does is check that a form element isn't blank- no assessment of the content.

Put that or something like that in place and then we will talk about ASP and server side checking which is what this forum is supposed to be about.
 
BigRed1212,
I'm starting to learn a lot of about this stuff. One thing I cannot figure out is, what stops the form submission from continuing if false is returns for the valid?
 
That is just the way javascript works. If the validate_form function returns false then the form is not supposed to be submitted. I think that is what you are asking.

 
That is exactly what I was asking thank you! Does it work that way for all "events" for submit buttons?
 
Do you know enough asp to do the validation server side, will work for all users even those who has javascript turned off
 
Server side is a great idea! I didn't know enough ASP a few weeks ago but I can now. Thank all very much for everything!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top