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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"mail pic to friend" feature needs pseudocode critique 1

Status
Not open for further replies.

costarica1

Programmer
Mar 22, 2004
9
CR
We have a report where we post 12 daily pictures on our site everyday. These pictures are overwritten so they are in the same place each time. I want to make a way to do this: allow people to select which pictures ( from 1 to 12 ) they would like to send to a friend and then enter their email and friends email into a form and it would send their buddy the pictures. I just am curious to the actual steps I should take here to send the email out. This is what I figure:

USER selects picture 1,2,3 to send to FRIEND's email. USER and FRIEND emails both have to be input into the form. When submitted, the form will send an email to USER with the REPLY-TO field set to FRIENDS email.

Thats it .. I just want to make sure that it would be the best way to go about doing this, so that the FRIEND doesn't get a bunch of emails if we have a BADUSER trying to mess up the system. Is this the right way to go here?
--
Michael
 
Ok, thoughts..

1.) You'll want each picture in two places.. The "today's images" folder and another folder where none are overwritten but each picture is added to it.

The pictures in today's folder are named p1.jpg, p2.jpg, p3.jpg, p4.jpg, p5.jpg etc.

The pictures in the common folder are named p_#DateFormat(dateVar,"mmddyyyy")#_1.jpg etc.

And then on your form for selecting pictures use checkboxes.. each checkbox has a value from 1 to 12..

<input type="checkbox" name="imgsel" value="1">

Make sure to include a hidden variable with the date in this format "mmddyyyy"

<input type="hidden" name="imgdate" value="#DateFormat(dateVar,"mmddyyyy")#">

And then when cycling through your submitted output you might use:

<cfmail...type="html">
<cfloop list="#imgsel#" index="i">
<img src="</cfloop>
</cfmail>

That should help.. I hope

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
<cfmail...type="html">
<cfloop list="#imgsel#" index="i">
<img src="</cfloop>
</cfmail>

I think this is what I am looking for here. I will let you know how it goes, we also already have an archive of pages so I might be able to build a CFM component to insert into each of these directories.. I think I have a way. Like always, can ask when I get stuck : ) Thanks Webmigit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top