jhmedia Posted August 14, 2011 Share Posted August 14, 2011 Hi people, Im more of a web designer than coder, so Im struggling with this. Basic form I have, works fine, but this form needs to create a unique page with a link with all the form values. its basically for a payment link - they click the email link on the email, the page has a button to pay which sends all those values via POST. Form has - Email address (to sent link to page) Value Description Customer Name any advice would be great! kind regards, J Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 14, 2011 Share Posted August 14, 2011 Where is your code? Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 14, 2011 Author Share Posted August 14, 2011 Sorry Voip, i only have a basic form at the moment, as I dont know how to create a page with the payment link - <p>Please click on the button below to pay for your order.</p> <form action="/app/payment.pl" method="post"> <p> <input name="pay_to_email" type="hidden" value="info@..." /> <input name="status_url" type="hidden" value="orders@..." /> <input name="language" type="hidden" value="EN" /> <input name="currency" type="hidden" value="GBP" /> </p> <p>Customer Name: <input name="Name" type="text" value="" /> </p> <p>Customer Email: <input name="Name" type="text" value="" /> </p> <p>Amount to pay: <input name="amount" type="text" value="" /> </p> <p> Product Details: <input name="detail1_description" type="text" value="Product Decription" title="" /> </p> <p> Payment Decription: <input name="detail1_text" type="text" value="" /> </p> <p> <input type="submit" value="Click to pay" /> </p> </form> this works fine to actually go to the payment and put car details in but I need this to create a link with the values and email the customer with the link to the page or something. Thank you kindly J Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 14, 2011 Share Posted August 14, 2011 On submit,You are going to send email to your client with payment link and the total amount Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 14, 2011 Author Share Posted August 14, 2011 Yes, a payment link to the page with the payment button. Unless you can make a payment link creation which uses post? hope this helps? Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 14, 2011 Author Share Posted August 14, 2011 Ok, after some thought, creating a page for each submission and emailing them the link to the page...for the payment link is going around the houses lol how can I get that form to create a link with all the variables like ie: https://www.site.com/app/payment.pl?pay_to_email=info%40site.co.uk&status_url=orders%40site.co.uk&language=EN&amount=7.99¤cy=GBP&detail1_description=product+description&detail1_text=product+more+details If the form could create a link like this and send them an email saying, "please click this link etc for your payment LINK etc, thank you" ?? best regards, J Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 14, 2011 Share Posted August 14, 2011 This is for paypal Quote Link to comment Share on other sites More sharing options...
xyph Posted August 14, 2011 Share Posted August 14, 2011 The $_POST array will contain all the values a user would submit with a form using the POST method. Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 14, 2011 Author Share Posted August 14, 2011 thank you for your time, i can get this to work perfectly from the form, but we need it to sent a recipient a email with a generated link with these values, so they click and then can therefore arrive at payment site? best regards, J Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 14, 2011 Share Posted August 14, 2011 <? if($_POST['submit']) { $headers = "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers.= 'From: site.com<no-reply@site.com>' ."\r\n"; $verifyemail = "Buyer email address"; $mail_body="<a href="https://www.site.com/app/payment.pl?pay_to_email=info%40site.co.uk&status_url=orders%40site.co.uk&language=EN&amount=7.99¤cy=GBP&detail1_description=product+description&detail1_text=product+more+details">Payme NOw</a>"; if (mail($verifyemail,"Pay NOW", $mail_body,$headers)) { echo "email send"; } else { echo "email faild"; } ?> Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 14, 2011 Author Share Posted August 14, 2011 thats great, but the form submit needs to set the variables inside the link that is sent to the customer? really appreciate your time! Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 14, 2011 Author Share Posted August 14, 2011 something like - $mail_body="<a href="https://www.site.com/app/payment.pl?pay_to_email=info%40site.co.uk&status_url=orders%40site.co.uk&language=EN&amount='.$amount.'¤cy=GBP&detail1_description='$detail1_description'&detail1_text='$detail1_text'">Click here to pay</a>"; hmmm?? Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 14, 2011 Share Posted August 14, 2011 <? if($_POST['submit']) { $headers = "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers.= 'From: 99pitt.info <no-reply@99pitt.info >' ."\r\n"; $verifyemail = "Buyer email address"; $mail_body="https://www.site.com/app/payment.pl?pay_to_email=". $_GET['pay_to_email']."&status_url=".$_GET['status_url']."&language=EN&amount=".$_GET['amount']."¤cy=GBP&detail1_description=".$_GET['detail1_description']."&detail1_text=". $_GET['detail1_text'].""; if (mail($verifyemail,"Pay NOW", $mail_body,$headers)) { echo "email send"; } else { echo "email faild"; } ?> <p>Please click on the button below to pay for your order.</p> <form action="/app/payment.pl" method="post"> <p> <input name="pay_to_email" type="hidden" value="info@ukcanvas.co.uk" /> <input name="status_url" type="hidden" value="orders@ukcanvas.co.uk" /> <input name="language" type="hidden" value="EN" /> <input name="currency" type="hidden" value="GBP" /> </p> <p>Customer Name: <input name="Name" type="text" value="" /> </p> <p>Customer Email: <input name="Name" type="text" value="" /> </p> <p>Amount to pay: <input name="amount" type="text" value="" /> </p> <p> Product Details: <input name="detail1_description" type="text" value="Product Decription" title="" /> </p> <p> Payment Decription: <input name="detail1_text" type="text" value="" /> </p> <p> <input type="submit" value="Click to pay" /> </p> </form> Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 14, 2011 Share Posted August 14, 2011 One more advice Security reason, do not use the main email address (login in email address) in this code. <input name="pay_to_email" type="hidden" value="info@..." /> <input name="status_url" type="hidden" value="orders@..." /> Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 14, 2011 Author Share Posted August 14, 2011 Thanks so much!! I really appreciate your advice. thank you! J Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 14, 2011 Share Posted August 14, 2011 its my honour to help you and please mark topic as solve. thanks Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 14, 2011 Author Share Posted August 14, 2011 Im having issues with the code, getting this error when viewing the page, Parse error: syntax error, unexpected $end in /home/ukcanvas/public_html/payment-link.php on line 44 but created a .html and it shows most of the php mail code above the form below, but once submitted it goes to the payment site perfectly ok, but it doesnt email the email link?? here is my full .php <?php if($_POST['submit']) { $headers = "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers.= 'From: Payment Link - <info@site.com >' ."\r\n"; $verifyemail= .$_POST['email']; $mail_body="https://www.site.com/app/payment.pl?pay_to_email=".$_GET['pay_to_email']."&status_url=".$_GET['status_url']."&language=EN&amount=".$_GET['amount']."¤cy=GBP&detail1_description=".$_GET['detail1_description']."&detail1_text=". $_GET['detail1_text'].""; if (mail($verifyemail,"Click here to pay!", $mail_body,$headers)) { echo "email sent"; } else { echo "email failed"; } ?> <p>Please enter customers details to send payment link.</p> <form action="/app/payment.pl" method="post"> <input name="pay_to_email" type="hidden" value="info@email.com" /> <input name="status_url" type="hidden" value="orders@email.com" /> <input name="language" type="hidden" value="EN" /> <input name="currency" type="hidden" value="GBP" /> <p>Customer Name: <input name="Name" type="text" value="" /> </p> <p>Customer Email: <input name="email" type="text" value="" /> </p> <p>Amount to pay: <input name="amount" type="text" value="" /> </p> <p> Product Details: <input name="detail1_description" type="text" value="" title="" /> </p> <p> Payment Decription: <input name="detail1_text" type="text" value="" /> </p> <p> <input type="submit" value="Click to pay" /> </form> thank you so much! kindly J Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 15, 2011 Author Share Posted August 15, 2011 any idea? Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 15, 2011 Share Posted August 15, 2011 $verifyemail= .$_POST['email']; try $verifyemail= $_POST['email']; Or $verifyemail='enater your emaid address'; then try Quote Link to comment Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 15, 2011 Share Posted August 15, 2011 its my honour to help you and please mark topic as solve. thanks sounds like my thang Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 15, 2011 Share Posted August 15, 2011 Just passing the ‘Thanks’ (@ copyRight ZulfadlyAshBurn) AND Thank YOU ZulfadlyAshBurn Quote Link to comment Share on other sites More sharing options...
jhmedia Posted August 15, 2011 Author Share Posted August 15, 2011 appreciate your help... but eeeek still not working! Ive tried both ways and still wont send the email kindly J Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 15, 2011 Share Posted August 15, 2011 Creat a new page and test this code <? $from = "mysite.com <no-reply@mysite.com >"; $headers = "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers.= "From: $from\r\n"; $verifyemail = "aj123cduk@yahoo.com"; $mail_body="Test mail"; if (mail($verifyemail,"Customer contact", $mail_body,$headers)) { echo " Thankyou! - Your feedback has been sent! "; } else { echo " Thankyou! - We could not send email. Please try later! "; } ?> Quote Link to comment Share on other sites More sharing options...
voip03 Posted August 15, 2011 Share Posted August 15, 2011 If the code does not work Open the “php.ini“ Search for the attribute called “SMTP” in the php.ini file. “SMTP=localhost“. change the localhost to the smtp server name of your ISP “smtp_port” which should be set to 25. Quote Link to comment Share on other sites More sharing options...
ZulfadlyAshBurn Posted August 15, 2011 Share Posted August 15, 2011 Just passing the ‘Thanks’ (@ copyRight ZulfadlyAshBurn) AND Thank YOU ZulfadlyAshBurn no prob its my honour to help people Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.