close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Cannot populate email recipient from recordset

Thread began 3/13/2012 11:01 pm by chad407639 | Last modified 3/14/2012 6:41 pm by Jason Byrnes | 1466 views | 3 replies |

chad407639

Cannot populate email recipient from recordset

I have a form in which I pass to it a key value for a database table lookup. The form when opened will query the table from that passed key and return a name and an email address. This all works perfectly. It is when I try to send an email to that dynamically obtained email address that everything falls apart...

I used the dynamic button to populate the TO field in the email config part of the form wizard with the recordset value for the email address. But after sending the email nothing ever gets sent. Upon enabling error reporting I found the email address is not being sent to the email system as expected. In fact that TO field remains blank.

Using the dynamic button to populate the TO field with my recordset email address should work I would expect, but it is not. What do I need to do to fix this?

FYI I am using the most current version: 2.0.1

Sign in to reply to this post

Jason ByrnesWebAssist

the thing to understand with forms is that they reload the page.

you say:
"I have a form in which I pass to it a key value for a database table lookup."

I suspect this is a querystring value, right? for example:
pagename?id=4


when the form submits, it causes the page to reload.

the form uses the action attribute to tell the server what page to load, if the querystring variable is not included in the action attribute, it will cause the recordset to return an empty data set.

you can use the following code for the form action:

php:
 action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlspecialchars($_SERVER["QUERY_STRING"]):""?>"




this will automatically include any querystring values that are passed into the page when the form submits.

Sign in to reply to this post

chad407639

Issue solved, but...

First off, I do want to report my problem has been resolved.

While I greatly appreciate your very prompt response, I am puzzled as to why this was necessary in the first place. It seems this is a glaring defect in the code I hope will be fixed soon.

Sign in to reply to this post

Jason ByrnesWebAssist

this is not necessarily a defect in the code.

not all pages will have a query string passed in.

Not all pages that do have a query string passed in will require that the query string be passed with the form submission.

in actual fact server issues can arise from automatically assuming that the query string passed in should be included in the forms action. it's better to add the code that I posted for you on an as needed basis rather than automatically use it on every form, where it will only be needed in a small number of cases.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...