close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Errors in sending forms

Thread began 11/17/2009 11:48 am by balexander389215 | Last modified 11/18/2009 4:48 pm by balexander389215 | 1621 views | 8 replies |

balexander389215

Errors in sending forms

After 3 days of creating and recreating a form and trying to send it through UE I finally got it to work. I used the php script offered in the tutorial to dump the contents of the form into the email. Again success except for one part. The form is an Appointment Request. There is a list of times that one selects. The email has the work, array, in place of the selected time. Is there any fix for this?

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

Change the code for outputting the contents of the form:

php:
<?php foreach( $_POST as $pkey => $pval ) { ?>

<?php  
echo(str_replace("_"," ",$pkey).": ".($pval)); ?>
<?php 
?>






to:

php:
<?php foreach( $_POST as $pkey => $pval ) { ?>

<?php 
if(is_array($pval)) { ?>
<?php  
echo(str_replace("_"," ",$pkey).": ".(implode(", ",$pval))); ?>
<?php 
} else { ?>
<?php  
echo(str_replace("_"," ",$pkey).": ".($pval)); ?>
<?php 
?>
<?php 
?>
Sign in to reply to this post

balexander389215

Next step

Thank you, now where do I enter this script. Do I have to go through the whole UE setup again or can I just replace the old script with the new. I am not really a coder but I can cut and replace with the best of them. The thing is I cannot find the location of the PHP code that I need to replace. If you can tell me which file it is in I can take it from there.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

Go to Window -> Server Behaviors to bring up the list of Server Behaviors that have been added to the page.


In the list, double click the Universal Email server behavior to edit it.


On the body Tab, replace the code you had entered originally with the modified code in my previous response.

Sign in to reply to this post

balexander389215

Thank you Jason, that did the job and I'm learning something as I go. I have one minor thing with this, I have two arrays, Best Day and Second choice and a time array with each. The email comes showing Best Day and Second Choice Day then the two times under that. Is is possible to switch the order so I get Best Day then the time from that array followed by second choice of day and the time selector for that. This just cleans it up and makes it easier to read but I can live with it as it is if there is no easy fix.

Also I was wondering if the two lines on the end can be deleted:

AppointmentRequest submit x: 99

AppointmentRequest submit y: 18

Once again they are only a minor annoyance but if you have a way to get rid of them I would like to know it.

Thanks for your help.

Brian

Sign in to reply to this post

Jason ByrnesWebAssist

sure, change that code to:

php:
<?php foreach( $_POST as $pkey => $pval ) { ?>
<?php 
if ($pval != "" && strpos($pkey,"AppointmentRequest") !== && $pkey != "x" && $pkey != "y")  { ?>
<?php 
if(is_array($pval)) { ?>
<?php  
echo(str_replace("_"," ",$pkey).": ".(implode(", ",$pval))); ?>
<?php 
} else { ?>
<?php  
echo(str_replace("_"," ",$pkey).": ".($pval)); ?>
<?php 
?>
<?php 
?> 
<?php ?>
Sign in to reply to this post

balexander389215

That got rid of the:

AppointmentRequest submit x: 99
AppointmentRequest submit y: 18

Which is great, thank you very much. It did not change the order of the information presented, I don't know if you were trying to do that or if it is even possible. If not I can live with it the way it is.

Thanks for your help.

Sign in to reply to this post

Jason ByrnesWebAssist

Sorry, it is not possible to change the order they are displayed in.

Sign in to reply to this post

balexander389215

No problem, thanks for your assistance.

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...