Jump to content

Help setting variable as previous form input


unp0ssible

Recommended Posts

This code http://codepad.org/qHt2XK4e is a form page. When the fields are complete, it creates a page with the inputted information which is displayed by this code http://codepad.org/2O7ut6rV

 

On that second page, there is a form at the bottom. It is a php email form and I want to make that form email to the email address provided by the first form page. I thought if I did this

$to = get_post_meta($post->ID, "ema", true);

 

it would work as desired since if I put this

<?php if( get_post_meta($post->ID, "ema", true) ): ?>
<?php echo get_post_meta($post->ID, "ema", true); ?>
<?php endif; ?>

 

in the body of the second page the email address provided on the first would be printed, but it doesnt work it gives me the "Mail could not be sent. Sorry! An error has occurred, please report this to the website administrator." error when I press submit. I'm betting this is because the email is not getting passed through and not being recognized.

 

If I change $to to equal an email address like

$to = "me@me.com";

the email form works perfectly.

 

All I want to do is have $to equal the value that was inputted by the user into $email1 (and yes, I have tried

$to = $email1;

but it still displays the error message when I try to submit the email.

 

If anyone can please help me fix this problem I will greatly appreciate it! Thanks

 

In order to show my appreciation to your help, I will pay the first person to give me a working solution $40 paypal immediatly after I test and find it to work :) THanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.