Dynamically filling content with data from CMS Builder.

4 posts by 3 authors in: Forums > CMS Builder
Last Post: September 27, 2010   (RSS)

By gadefgaertgqe - September 24, 2010 - edited: September 24, 2010

I have a page (contact.php) with an email form.

When the form is filled out and the send button clicked it calls a php script (sendmail.php) to proccess it.

To configure the destination email address in the php script (sendmail.php) I have to edit the following:

$address = "email@yourwebsite.com";

However I want to be able to fill the destination address dynamically.

I know the dynamic address is generated fine, as when I run this in the page that contains the form that is being filled out:

<? $whatisit = $contactRecord["email"];
echo $whatisit;
?>


I get the correct email address being output.

However when I modify the address value in the sendmail.php file, to use the same method like so:

$address = $contactRecord["email"];

The send mail fails because the address value seems to be blank. I am guessing that there must be a method I have to use to pass the value to sendmail.php.

Hope you can help and thanks in advance.

Paul

Re: [8bit Gamer] Dynamically filling content with data from CMS Builder.

Hi 8bit Gamer,

Just guesses,

I noticed that you're using double quotes instead of single.

You might try using a variable for the email address in the sendmail $address similar to what you did for your test.

<?php $whatisit = $contactRecord["email"]; ?>

$address = <?php echo $whatisit ?>


Hope that gets you going.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [Jason] Dynamically filling content with data from CMS Builder.

First of all thanks to all who replied.

I took the problem home from work with me and worked on it over the weekend.

I am pleased to say that it is fixed and was due to an error in the way the post was being sent.

Many thanks again.

Paul.