Jobs!
Meetups by TopicMeetups by CityStart a MeetupWhat's Meetup
Home > All Topics > Internet & Technology > Web Design Meetups Everywhere > The Prescott Web Design Meetup Group
Organizer:

Join The Prescott Web Design Meetup Group!

We'll never share your email address without your permission. Already a Meetup member? Sign in.

Messages

PHP Issues

Message Board › PHP Issues

Nancy Timper
swami12
Prescott, AZ
14th Post

Is there someone who is familiar enough with PHP who might feel inclined to take a look at a PHP file I'm tryng to configure??

I have a course registration form that uses a page (feedback.php) to send out an email with the registration info. So far, so good. Only I'd like to have the recipient's email be supplied dynamically from the course information, as there are different recipients for different courses. Not being really familiar with PHP, I've tried various things and none have worked so far.

Failing getting that to work, any ideas on alternate strategies or workarounds?

Many thanks. I've set up a link to a PDF of the code below (that is NOT working!).

Nancy

PDF of PHP Page

Kally M
kallym
Prescott Valley, AZ
4th Post

Hi,
I didn't have the time to study your script, but I usually find that when I strip things down to the bare bones, then slowly add things back in, it is easier to find an error. Assuming the problem lies in your mail function coding maybe you can try this:

$mailHead = "From: $name<$email>\n";

mail('your@domain.com', 'Registration from Website', $mailbody, $mailhead);

If that works add on any other mail headers that you need one at a time using .= instead of =


$mailHead = "From: $name<$email>\n";
$mailHead .= "Reply-to: <$email>\n";

mail('your@domain.com', 'Registration from Website', $mailbody, $mailhead);

Hope that helps some.
Kathleen ~~~

Nancy Timper
swami12
Prescott, AZ
15th Post

Thankyou for taking the time to post a response, I appreciate it!

Whats really giving me the problem (it seems) is the dynamic portion of the $mailto = script. I created a recordset on the feedback.php page, then I inserted the dynamic text field into the mailto portion:

$mailto ="'<?php echo $row_rsCourses['courseCoordEmail']; ?>'";

This line creates the following error:

Parse error: syntax error, unexpected T_STRING in /home/httpd/vhosts/permaculture.biz/http docs/usatour/feedback.php

I'm probably asking too much with my limited abilities..... but what the heck, thought I'd at least ask if maybe I was close!

Thanks again for your suggestions. Maybe I misunderstood you, I didn't see how they addressed my issues???

Nancy

Edited by Nancy Timper on Mar 3, 2007 at 8:28 AM

Mike Kreidel
user 2662246
Prescott Valley, AZ
7th Post

In the top of this page are you grabbing the variable $courseCoordEmail from the previous page? If so then something like this should work:

$mailto = $_POST['courseCoordEmail'];

Nancy Timper
swami12
Prescott, AZ
16th Post

Hi,

Thanks for your script, which did not produce an error, but did not send me an email, either (sigh). I appreciate you offering that suggestion.

I tried passing the courseCoordEmail as a variable, with a recordset on the feedback.php page filtering on that. Also tried the same using the courseID (primary key). I'm about ready to give it up, but if you think you can help more, I'd love to hear any guidance. Do you think I need a recordset on the feedback page?

thanks

Nancy

Kally M
kallym
Prescott Valley, AZ
5th Post

I had the time to take another look at your script. Line 76 that you mentioned in your post has an error:

$mailto ="'<?php echo $row_rsCourses['courseCoordEmail']; ?>'";

Change that to:

$mailto = $row_rsCourses['courseCoordEmail'];

Since you are getting this email address from the database, not the form, this should work. The problem was that you are already in a PHP tag so you didn't have to add the '<?php echo and ?>'"; That was causing the error.

Let us know if that cleared it up.

Kathleen ~~~

Nancy Timper
swami12
Prescott, AZ
17th Post

Awesome!! That seemed to do the trick. I had a feeling it wasn't impossible to get it working, and you have saved the day and a lot of future hassle. Next meeting I owe you a frosty beveage of your choice.

many many thanks

Nancy
biggrin

Powered by mvnForum