Retrieving data from database and mail them

J

Jari Dolberg

Hi,

I am looking for a solutions for the following problem,
I need to access at database from within a website, from where I can
retrive a specific document in the database and mailing it to someone
else. Of course I cut crab the document from the database and save it on
my harddrive, and then send it. But this process don't fit into our
busy days.

I thought that javascript might be an idea?

Can anyone help?
 
J

Joakim Braun

Jari Dolberg said:
Hi,

I am looking for a solutions for the following problem,
I need to access at database from within a website, from where I can
retrive a specific document in the database and mailing it to someone
else. Of course I cut crab the document from the database and save it on
my harddrive, and then send it. But this process don't fit into our
busy days.

I thought that javascript might be an idea?

Can anyone help?

There is no Javascript-intrinsic, cross-browser database connectivity
mechanism (though very possibly some technology that is IE-only). However,
client-side you might find the "new Image()" technique useful, like so:

var newImage = new Image();
newImage.src =
"mailRecordFromDatabase.php?recordid=12345&[email protected].

This would have the effect of triggering a server-side page (PHP in this
case), which can harvest the query string, contact the database, retrieve
the data, format it and email it. Depending on the complexity of the
database interaction, I'd say this might take maybe 20 lines of server-side
PHP code.

Joakim Braun
 
P

Philip Ronan

However,
client-side you might find the "new Image()" technique useful, like so:

var newImage = new Image();
newImage.src =
"mailRecordFromDatabase.php?recordid=12345&[email protected].

Good grief, don't put anything like that on your web pages. Not unless you
want a bunch of bored teenagers emailing your database all over the place.
 
J

Joakim Braun

Philip Ronan said:
Good grief, don't put anything like that on your web pages. Not unless you
want a bunch of bored teenagers emailing your database all over the place.

Well, demo code doesn't preclude some additional application of brains for
real-world deployment.

Joakim Braun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top