trouble getting form data to mail.php

6 posts by 2 authors in: Forums > CMS Builder
Last Post: August 25, 2010   (RSS)

Re: [rentittoday] trouble getting form data to mail.php

By Jason - August 23, 2010

Hi Lauren,

You are redirecting correctly. The issue is that when you redirect, it doesn't bring any of the form elements with it.

Why do you need to do the redirect? Is it possible to send the email from the page that you have doing the error checking? This would be the quickest and simplest solution.
Another solution would be to append all of the variables to the end of mail_2.php where you do the redirect.

Let me know and I can give you some more specific examples.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] trouble getting form data to mail.php

Right now we have ~42 categories in CMS and each of those categories has it's own contact page with the email form on it. So in order to be more efficient we have created a mail_2.php page that all of the pages use to send the emails. This saves us time when we want to make changes to the email, etc. So that is why I was redirecting it to there.

We do know now that we have setup our categories in CMS "wrong" from the start by having each category have its own table instead of just one big table with all the 42 categories in it. We are planning right now to begin the process of completely overhauling the system and setting it up the way we should have done from the start. Which will make things like this much easier.

So at this point it may just be easier to append the stuff at the end of mail_2.php. And then once we overhaul everything and have only 1 details viewer rather than 42 of them go ahead and send the email from that 1 page.

Thanks!
Lauren
Jason Glass

Re: [rentittoday] trouble getting form data to mail.php

By Jason - August 23, 2010

Hi Lauren,

I see. In this case, you can use this code to append all of the variables in the $_REQUEST array to the end of your URL.

$url=""http://www.rentittoday.com/mail_2.php?";

foreach($_REQUEST as $key => $value){
$url.="$key=$value&";
}


// send email
if (!$errorsAndAlerts) redirectBrowserToURL($url);


Give that a try.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] trouble getting form data to mail.php

By rentittoday - August 25, 2010 - edited: August 25, 2010

That works beautifully! Thank you.

Now the issue is that the email we send out is UGLY!

The fields do not always align in the email that is sent. For example, they align in outlook express but not when you view it in gmail.

We would also like to add an image of our logo at the end of the message. What are the easiest ways to accomplish these tasks?

I have attached a file of our mail_2.php which is the file that generates the emails.

Thanks!
Jason Glass
Attachments:

mail_2.php 2K

Re: [rentittoday] trouble getting form data to mail.php

By Jason - August 25, 2010

Hi,

If you`re just sending your email as plain text, there really isn`t a way to control how different email applications display it.

If you want to add an image to your email, you need to be sending your email as HTML. This will also give you a greater degree of control on how it looks. Take a look at this post to see how to send that kind of email:
http://www.interactivetools.com/forum/gforum.cgi?post=81273#81273

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/