Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About terungwa

  • Rank
    Regular Member

Profile Information

  • Gender
  • Interests
    PHP and RUBY programming
  1. adding this function below to my wp-config.php solved the problem: define('DB_SSL', true); Reference: https://stackoverflow.com/questions/7142632/wordpress-ssl-mysql-is-this-configuration-possible
  2. I have Set Up a Remote Database to Optimize wordpress Site Performance with MySQL on Ubuntu 16.04. I downloaded the wordpress onto my web server. When I Navigate to the public IP address associated with my web server, i get "Error establishing a database connection". With wordpressdebug mode set to true, the details of the error is: Warning: mysqli_real_connect(): (HY000/3159): Connections using insecure transport are prohibited while --require_secure_transport=ON. in /var/www /html/wp-includes/wp-db.php on line 1538 I have tested remote connection using the remote user and I am able
  3. I have created a phone number as Buddypress Profile field. I need to check that no two or more user accounts share the same phone number. My query below is not enforcing the restriction. I need help to resolve this. function bp_phone_number_validate() { global $bp; global $wpdb; // check if phone number is in use $result=$bp->get_var("SELECT COUNT(*) FROM {$bp->profile->wp_bp_xprofile_data} WHERE value = '{$_POST['field_2']}' GROUP BY id;"); if($result > 0){ $bp->signup->errors['field_2'] = __( 'Phone number is already in use.', 'buddypress' ); } } add_action( 'bp_signup
  4. I have used this tutorial here (https://codex.wordpress.org/Integrating_WordPress_with_Your_Website) as a guide to set up non-wordpress pages to access some wordpress resources on non-wordpress pages. Eg I can view wordpress posts on non-wordpress page. I have wordpress installed in a sub-folder( ./root - PHP pages ./root/wordpres - Wordpress installation} In addition, I need to be able to detect if a user is logged into wordpress on the non-wordpress page. I am using this code below on non-wordpress pages for that: if(is_user_logged_in()){ $current_user = wp_get_current_user(); /** *
  5. I had downloaded this version before. But for the avoidance of doubt, I followed your link here to download then install. But I have the same error.
  6. I am trying to install WAMP on a 64bit Computer with windows version 8.1 installed. I have downloaded the WAMP version for a 64bit system. Following installation, This "httpd.exe-System Error pops up "The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem". Fixing the problem above requires installation of the Visual C++ Redistributable for Visual Studio 2015 update 3. I have also installed other recommended runtime libraries. I have downloaded this runtime library (Visual C++ Redistributable f
  7. Yea I shall definitely validate server side. The html5 pattern attribute is for user experience improvement on supported browsers
  8. I need to create a pattern attribute that specifies a regular expression for an <input> element's value that accepts mobile phone numbers. Jacques1 provided this PHP regex function which works great. I attempted to use this as a value for the pattern attribute but is is failing to check properly. Here is the regex code below: <!DOCTYPE html> <html> <body> <form action="demo_form.asp"> Country code: <input type="text" name="country_code" pattern="\\A(?:\\+?234|0)?(?:704|702|803|806|703|706|813|816|810|814|903|802|708|808|812|701|902|809|817|818|909|90
  9. Thanks Jacques1, but Your pattern /\\A(?:\\+?234|0)?(?:704|803)\\d{7}\\z/ does not match this subject string (2347048134704); when tested here https://www.regex101.com/ Or am I missing something?
  10. I have a regex expression that validates a set of mobile numbers: The numbers have optional prefixes (+234 or 234 or 0) and I have used the alternation with the pipe character. Immediately following the international code or zero character is a set of service provider specific identifiers that I have also specified the options using the alternation character. Based on the regex I have, this number should not be valid (12349098766543); but the regex returns it as valid. It appears the there is a match on 909 in the code. But shouldn't the presence of 1 at the beginning of the test string en
  11. I had successfully set up and integrated a third party payment integration system on WHMCS. Inorder to Validate callback authenticity, the gateway provides a method of verifying that a callback originated from them as shown in code below: $mertid ='secretmerchantID'; $amt = '10000'; $tranxid = 'gtPay130958397220820'; $hashkey ='secretclientkey'; $hash = hash('sha512', $mertid . $tranxid . $hashkey); $url = 'https://ibank.gtbank.com/GTPayService/gettransactionstatus.xml?mertid='.$mertid.'&amount='.$amt.'&tranxid='.$tranxid.'&hash='.$hash; $xmlString = file_get_contents($url);
  12. I wish to redirect to a custom page following the failure in payment as returned by payment gateway. To this end, I am using the ShoppingCartCheckoutCompletePage hook to check this using the variable $vars['ispaid']. When payment is successful, $vars['ispaid'] is true and the redirect to the thankyou page works. add_hook('ShoppingCartCheckoutCompletePage', 1, function ($vars) { # Will be true if the order has been paid if($vars['ispaid'] == true) { #redirect to thank you page header('location:'.thankYouPage); die; } else { header('
  • 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.