Jump to content

halben

Members
  • Posts

    42
  • Joined

  • Last visited

halben's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm currently working on a WordPress website project and I am hoping someone can help me out on this. In the registration page, the data entered is stored into the WordPress database. I've also build a connection to store those data into an external database as well. So basically, If a visitor registers on the site, their data info is stored in the WP and external DB. My question is since the external DB relies on checking to see if the submit button has been pressed, do those data input values need to be escaped to prevent sql injection into the external DB since the data submitted to WordPress has already been sql escaped? Thanks for helping.
  2. I would like someone to please help look over these lines of codes and help me correct what's wrong with it. The first problem I found out on my registration form is when a user fills out a portion of the form, the WordPress client side and server side validation works as intended but that data gets processed/stored into my external database which it is not suppose to. So what I did to prevent it check if the user pressed the submit button, if it's pressed, check to see if the values aren't empty. If the values are empty, do something and stop the connection but If the values are not empty, run the connection to the external DB using the try/catch statement. I tested it out again and the validation works as intended, no data was processed but when the user completes the registration form correctly, their info gets stored into the WordPress DB but not my external database. Can anyone please help me with this issue? <?php $firstname = esc_attr($_POST['fname']); $lastname= esc_attr($_POST['lname']); $email= esc_attr($_POST['email']); ... $error = false; $required = array($firstname, $lastname, $email ...); if (!isset($_POST['on-reg-submit'])) { // Do nothing } else { foreach($required as $val) { if (empty($_POST[$val])) { $error = true; } } if ($error) { // If errors, prevent from submmiting to external DB } else { // No errors try { // Here is where I connect to the external DB // processing the posts values into it and storing the post values into my external DB } catch { echo "ERROR!"; } } ....
  3. Figured it out. Thanks for viewing!
  4. Hi, I'm working on a reset password for WordPress and I'm stumped on this query. What the query does is when a user requests a password reset, the query makes an update to the user's password and activation key. When I run this query, it's giving me int(0) which is saying there are no rows affected. I ran a var_dump on each POST variables to check if the values are correct and it is, so I'm not sure where the error is coming from this sql statement. $resetQuery = $wpdb -> query($wpdb -> prepare("UPDATE wp_users SET user_pass = %s, user_activation_key = '' WHERE user_login = %s AND user_activation_key = %s" , $hashedPwd , $usernameemail, $key)); If anyone can please assist me, that would be great! -Halben
  5. First off, I'm working on a WordPress website. I'm having issue getting the video to play in the FV WordPress Flowplayer: (1) auto play when the page loads (2) Listen for the button click event (purposedly added the comment tag for testing either one) Here's my code: var $j = jQuery.noConflict(); $j(function(){ (1) $j('#post-1823.flowplayer').flowplayer().play(); (2) /*$j('#post-1823.flowplayer').flowplayer({ play: function(){ console.log('IT PLAYS!'); } });*/ }); The error I'm getting for (1) is "Uncaught TypeError: Object[object Object] has no method 'play'" Uncaught TypeError: Object [object Object] has no method 'play' - custom_scripts.js:33 (anonymous function) - custom_scripts.js:33 x.Callbacks.c - jquery.js?ver=1.10.2:3 x.Callbacks.p.fireWith - jquery.js?ver=1.10.2:3 x.extend.ready - jquery.js?ver=1.10.2:3 q I'm thinking that it's not understanding any of the flowplayer api functions. *Ref Link*: http://flowplayer.org/docs/api.html Can someone please assist me with these issues? Thank you, rolu
  6. I have the following codes: if(window.location.pathname.search(/\?/) != -1) { var refUrl = window.location.pathname.strip(/\?/); } else { var refUrl = window.location.pathname; } var pathname = refUrl += '/' + 'hey' + '/' + 'what'; alert(refUrl); I'm running a check to see if there are any characters in the pathname, if so, strip it out. The output is : /_display//hey/what So basically it didn't strip anything characters out from the pathname after testing this on jsfiddle. Can someone please tell me what's wrong with it? Thank you, halben
  7. I'm getting the error: Error code: ERR_TOO_MANY_REDIRECTS after writing this filter hook function into my child theme functions.php. My code is below: function redirect_wp_login() { $request = basename($_SERVER['REQUEST_URI']); if ($request == 'wp-login.php') { wp_redirect(site_url('/login')); exit(); } } add_filter('init', 'redirect_wp_login'); Anything wrong with the code?
  8. Thanks for the assistance. I'm still pretty new to this so I'll keep on researching.
  9. I found 2 links regarding to automating services: 1) http://www.redolivedesign.com/utah-web-designers-blog/2007/11/17/how-to-run-a-php-or-asp-file-on-a-schedule-with-windows-xmlhttp-object-and-scheduled-tasks/ 2) http://amitdhamu.com/blog/automating-php-using-task-scheduler/ I'm just not sure which to use.
  10. What I meant was can I make HTTP request to call the script since my script is on the server?
  11. How would I configure the script to run if the sript is the server? php -f /path/to/script.php I'm assuming this line of code only retrieves the file from the local computer.
  12. Bummer. Let me know if I'm going in the right direction. I'm working on a WordPress website where new users who registers to the site gets their information stored into the WP database and an external database. I have that fully functional from WordPress DB syncing/updating users information to an external DB. I'm trying to get the external DB to do the same thing to the WordPress DB. What I'm basically trying to do is listen for changes in the external DB so if anything changes in it, it would update only 1 field in the WordPress DB. This is possible right?
×
×
  • 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.