Jump to content

Robert_Craig

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Robert_Craig

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you Barand for the quick reply and easy explanation.
  2. I am trying to create a math equation inside a variable but I am struggling to achieve the desired result. On one php page I have this: $x = "date('Y')"; $y = "1989"; $description = "In this classic lecture which was delivered over $x - $y years ago, etc etc....."; On my main page I have linked to the above and also $description but the result I am getting is: In this classic lecture which was delivered over date('Y') - 1989 years ago, I want to create a variable so I don't need to go back every year and change the description. Is this possible? Robe
  3. I have no idea. As mentioned above I am a beginner with JS and PHP. After my course in JS (as long as I pass of course) I am planning on doing their PHP course. What I did as a work around was to add a hidden input with the name subject to get it to work on first click
  4. <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { function post_captcha($user_response) { $fields_string = ''; $fields = array( 'secret' => '***************SECRET_KEY***************', 'response' => $user_response ); foreach($fields as $key=>$value) $fields_string .= $key . '=' . $value . '&'; $fields_string = rtrim($fields_string, '&'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify'); curl_setopt($ch, CURLOPT_POST, count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); curl_setopt(
  5. I just changed the name of the line 9 in the second form (from 'name' to 'subject') and now that form submits on the first click. So what is it in the code that is needing the word 'subject' for it to submit on the first click?
  6. Well spotted Barand. Definitely makes me think twice about the course now. 😊 requinix I have gone through your code and I thought I had it working but then noticed that on some of my forms I have to press the submit button twice before the form submits. On this form it submits fine with just one click: <form action="formmail.php" method="post" id="i-recaptcha"> <div class="g-recaptcha" data-sitekey="****************SITE_KEY****************" data-size="invisible" data-callback="recaptchaSubmit"> </div> <div> <input type="text" na
  7. Thank you requinix. You are right about learning JS. I am actually about to start a JS course at Seer Computing in the UK in about 3 weeks. I will go through your post now and hopefully be able to make sense of it as you have very gratefully added comments on all sections. Thank you again for your help.
  8. My knowledge of JavaScript is nonexistent unfortunately. I am familiar with HTML but a beginner with JS and PHP so I have no idea what to do with that JS code above. Do I just put that code in between <script> </script> tags and place it in my HTML code?
  9. Thank you requinix. From what I understand it ask to remove the reCAPTCHA code from the from button and place it in a div instead. So I now have this code <form action="formail.php" method="post" id="i-recaptcha"> <div class="g-recaptcha" data-sitekey="****************SITE_KEY****************" data-size="invisible" data-callback="onSubmit"> </div> <div> <label>Name</label> <input type="text" name="name" placeholder="Name (Required)" required> </div> <div> <label>Email Address</label>
  10. Hello I have recently implemented the Google reCAPTCHA v2 on my site. I am using the invisible version which only shows the reCAPTCHA if it thinks it may be a bot. I have noticed that when I added the reCAPTCHA to my site it now disables the HTML5 validation that was working fine before. My form is a standard form which I have included the code below. Is there a way to enable the validation so that it runs before that reCAPTCHA takes control? <form action="formail.php" method="post" id="i-recaptcha"> <div> <label>Name</label> <input typ
  11. That is exactly what I was thinking. But with my limited knowledge of coding it was the only way I could come up with a work around. I have been on People Per Hour and found someone who said they can do it for $5 but not quite sure how they will do it and also they was not from the UK so could not understand me properly.
  12. Thank you for the replies. As I am a total beginner I found your helpful recommendations too difficult for me to implement on my own so I therefore went for the easier way of just adding another field in my database called tags2. So now my code looks like this: "SELECT * FROM videos WHERE title LIKE '%$search_query%' OR tags LIKE '%$search_query%' OR tags2 '%$search_query%' ORDER BY title"; The problem I am getting now is that if someone searches for something in either tags or tags2 the search works but if they search for both it returns nothing. I have tried to add tags AND tags2 but
  13. Thanks for correcting me with regards to the correct terminology. Yes you are correct, currently the tags field has more than a single descriptive term. How do you recommend I add this information in my database? I am a total beginner in PHP so please excuse the ignorance but where you have written '%$word1' '%$word2' etc. Is this where I would replace the word 'word' with one keyword?
  14. I am having an issue with my website SQL Search. In my database I have a row called 'Tags' and within that field I enter any keywords that someone would be likely to search. The problem I am having is that I cannot get it to work the way I would like. For example in the tags row I have: 1) Red Dress 2) Blue Dress My code is SELECT * FROM videos WHERE tags RLIKE '[[:<:]]{$search_query}[[:>:]]' Now with this if someone searches red dress or even just red, then it will show the correct results. However if someone searches dress red it will not show any thing because in
  15. Wow! Thank you so much Barand. I have made the few changes that you suggested and it is all working perfectly. Thank you again
×
×
  • 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.