
ben_1uk
Members-
Posts
79 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
ben_1uk's Achievements

Member (2/5)
0
Reputation
-
Hi everyone, I'm hoping somebody can help me out. I am attempting to make a small change to an existing .SWF file on my website. The file currently acts like a sort of image map, whereby if the user clicks on a certain part of the image, the relevant information will then display using flash animation. To edit the file, I have first decompiled it using Sothink SWF Decompiler and exported the .swf file to .fla to make the changes. I have then opened the .fla file using Flash Builder (4.7) Premium (trial version), made the change, and exported the file to a .swf again. However, after performing the above steps, the flash animation loops continuously with all clickable regions of the image seemingly disabled? Can anyone help? Thank you, Ben_1uk
-
Hi scootstah, I've had another tinker about with the code and I've managed to get the mails to come through! It all appears to work now :-) Thank you very much for all your help.
-
Having added var_dump($success); I received bool(true).
-
I'm really sorry for all the 'bad code', but the lack of documentation from Google when upgrading from reCAPTCHA v1 to v2 is not helping! Plus, every example I look at on the Internet is different so I'm just getting more and more confused by it all!
-
I've had another look at the code and have come up with the below. However, it still doesn't post to my email address. //collect user data from form and post $firstname = $_POST['firstname']; $surname = $_POST['surname']; $emailaddress = $_POST['emailaddress']; $telephone = $_POST['telephone']; $enquiry = $_POST['enquiry']; //format look of email $body = "First Name: $firstname \n Surname: $surname \n E-mail: $emailaddress \n Telephone Number: $telephone \n Message: $enquiry"; // if CAPTCHA is entered incorrectly if(validCaptchaV2() === FALSE) { header('Location: captcha_unsuccessful.html'); exit; } else { // If CAPTCHA is valid send email $emailSubject = 'Customer Enquiry'; $webMaster = 'my_email_address'; $mailheaders .= "From: $emailaddress\r\n"; $headers .= "Content-type: text/html charset=iso-88590-lrn"; // send email $success = mail($webMaster, $emailSubject, $body, $headers); }
-
The code is the same as when I had reCAPTCHA v1 working. I have checked the current 'live' mailer.php file and it does not include a mail() call yet still works? Here is the part of the code that should send the mail: $firstname = $_POST['firstname']; $surname = $_POST['surname']; $emailaddress = $_POST['emailaddress']; $telephone = $_POST['telephone']; $enquiry = $_POST['enquiry']; $body = "First Name: $firstname \n Surname: $surname \n Telephone Number: $telephone \n Message: $enquiry"; // if CAPTCHA is entered incorrectly if(validCaptchaV2() === FALSE) { header('Location: captcha_unsuccessful.html'); exit; } else { // If CAPTCHA is valid $emailSubject = 'Customer Enquiry'; $webMaster = 'my_email_address'; } Where would I need to add the mail() function? The examples I have looked at on-line are structured differently to mine.
-
I think my punctuation is a little off somewhere - too many ) : and } for me! I have tried moving the exit; } part of the code to include the rest of the script but I am now receiving the following error message: Parse error: syntax error, unexpected 'else' (T_ELSE) in /somewhereonmycomputer/webdirectory/mailercopycopycopy.php on line 38
-
Yes, I have a private key. I'm just hiding it for use on the forum. No, the script carries on after the instruction to render the unsuccessful.html page. { // If CAPTCHA is valid $emailSubject = 'Customer Enquiry'; $webMaster = 'my_email_address_lives_here'; }
-
Thanks scootstah, So, my code now looks something like this: <?php function validCaptchaV2() { $secret_key = 'my_private_key_lives_here'; $ch = curl_init(sprintf( 'https://www.google.com/recaptcha/api/siteverify?secret=%s&response=%s&remoteip=%s', $secret_key, $_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR'] )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $resp = curl_exec($ch); curl_close($ch); if (($answer = json_decode($resp)) !== null) { return $answer->success; } return false; } $firstname = $_POST['firstname']; $surname = $_POST['surname']; $emailaddress = $_POST['emailaddress']; $telephone = $_POST['telephone']; $enquiry = $_POST['enquiry']; $body = "First Name: $firstname \n Surname: $surname \n Telephone Number: $telephone \n Message: $enquiry"; // if CAPTCHA is entered incorrectly if(validCaptchaV2() === FALSE) { header('Location: captcha_unsuccessful.html'); exit; } else { // If CAPTCHA is valid $emailSubject = 'Customer Enquiry'; $webMaster = 'my_email_address_lives_here'; } ?> // Results rendered as HTML $theResults = <<<EOD <html> <head> <link rel="icon" href="favicon.gif" type="image/gif" /> <title>Woodside Enquiry Form</title> <meta http-equiv='Content-Type' content='text/html'> <style type='text/css'> <!-- body { margin: 0; padding: 0; font-size: 95%; font-family: georgia, times, "times new roman", serif; color: #000; background-color: #3399CC; } a:link { color: #036; } a:visited { color: #003366; } a:hover, a:active { color: #fff; background-color: #036; } div#pagewrap { width:980px; margin: 0 auto; background-color: #fff; } div#banner { background-image: url(banner2.jpg); height: 250px; width: 100%; background-position: 0, 0; background-repeat: no-repeat; border-bottom: 1px solid #000; } div#banner h1 { margin: 0; padding: .3em 0 .3em .5em; font-size: 2.2em; font-weight: normal; } div#container { background-image: url(nav_col_base.jpg); background-repeat: repeat-y; } div#container2 { background-image: url(more_col_base.jpg); background-repeat: repeat-y; background-position: right; } div#navigation { float: left; width: 150px; padding-top: 2em; } div#navigation ul { list-style-type: none; padding: 0; margin: 0; } div#navigation ul li { margin-top: 4px; } #navigation ul li a { display: block; width: 135px; padding: 3px 5px 3px 10px; text-decoration: none; color: #fff; background-image: url(nav_base.jpg); background-repeat: repeat-y; } #navigation ul li a:hover { color: #fff; background-color: #ccc; background-image: url(nav_base2.jpg); background-repeat: repeat-y; } div#more { float: right; width: 160px; margin: 0; padding: 2em 10px 0 0; color: #fff; } div#more h3 { margin-top: 0; color: #fff; padding: .2em; background-image: url(more_base.jpg); background-position: right; background-repeat: repeat-y; } div#content { margin-left: 190px; margin-right: 200px; } div#content h2 { font-size: 2em; color: #036; margin: 0; padding-top: 1em; font-weight: normal; } div#content { line-height: 150%; } #cleardiv { clear: both; height: 1em; } div#footer { clear: both; padding: .5em 1em; border-top: 1px solid #999; text-align: right; } div#footer ul { padding: 0; margin: 0; list-style-type: none; } div#footer li { display: inline; margin-right: 1em; } --> </style> </head> <body> <div id="pagewrap"> <div id="banner"> </div> <div id="container"> <div id="container2"> <div id="navigation"> <ul> <li><a href="index.html">Home</a></li> <li><a href="pools.html">Pools</a></li> <li><a href="rules.html">Fishery Rules</a></li> <li><a href="diary.html">Diary</a></li> <li><a href="results.html">Match Results</a></li> <li><a href="facilities.html">Facilities</a></li> <li><a href="cabins.html">Accommodation</a></li> <li><a href="news.html">News</a></li> <li><a href="contactus3.php">Contact Us</a></li> <li><a href="gallery.html">Gallery</a></li> <li><a href="links.html">Links</a></li> <li><a href="testimonials.php">Testimonials</a></li> <li><a href="wacs.html">Woodside ACS</a></li> <li><a href="video.html">Video</a></li> <li><a href="press.html">Press</a></li> </ul> </div> <div id="more"> </div> <div id="content"> <h2>Thank you for your submission.</h2> <p>Your enquiry will be processed shortly.</p> <p>Please note that if you did not submit the relevant CAPTCHA information, or entered the information requested incorrectly, your E-mail request will not reach our server and will not be processed. We are not ignoring you!</p> <p>E-mails sent to the fishery are usually responded to the same day. If you have not received a response within 48 hours, please call 01299 270565 or 07968 111 415.</p> <p>Thank you.</p> <p><a href="index.html" />Return to the homepage</a>.</p> </body> </div> <div id="cleardiv"></div> </div> </div> <div id="footer"> <ul> <li><a href="charliespool.html">Charlies Pool</a></li> <li><a href="housepool.html">House Pool</a></li> <li><a href="islandpool.html">Island Pool</a></li> <li><a href="woodsidepool.html">Woodside Pool</a></li> <li>©Woodside Fishery 2012</li> </ul> </div> </html> EOD; echo "$theResults"; ?>
-
I'm not seeing the Fatal error message anymore. However, the data being submitted via the HTML form is not sending via Email like it should..?
-
I've checked my domain and I'm not running any PHP version I have set my PHP version to PHP 5.5 as per their recommendation and the only PHP script I had running before my above change is still working.
-
1&1 Internet...
-
Hi, As I don't have PHP installed my end I'm assuming I am reliant on my domain host's configuration on their server(s) for this to work?
-
I'll look into this and see what the solution is. PHP is hard to get your head around!
-
Thanks again fastsol. I really do appreciate the help. The documentation from Google is next to useless! V1 was not as hard to implement as this! I have made the above change to my code, but I am now receiving this error message: Fatal error: Call to undefined function: json_decode() in /...filepath/somewhereonmycomputer/stillsomethingwrong... on line 8 <?php function validCaptchaV2() { $secret_key = 'my_private_key_lives_here'; $resp = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_key."&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR']); $answer = json_decode($resp); return $answer->success; } I've had this fatal error message once before with another example. Regards, Ben_1uk