CRUD front end for mySQL in WordPress

Tom, I appreciate that WP doesn’t provide a CRUD type setup … I’m just wondering, whether these nice form-plugins that do a brilliant job in displaying and editing MySQL records of their own making within the WP-plugin-database could not do the same thing to a MySQL database on the same server. Again, I have been … Read more

How to submit form in a PHP file in WordPress?

I want to submit it to the file sub.php(which is in same directory) Don’t do this. You should not have standalone PHP files that get queried via forms or AJAX etc, WordPress handles all the requests. By having a standalone file, you open a can of worms of security issues, and other problems ( you … Read more

Help with forms and nonces

You need to pass the value of the nonce field as first argument to wp_verify_nonce. So, you need to modify the nonce verification part in your code. Also you were using form fields names that conflicts with internal wordpress query vars, you should prefix them with something unique so they do not conflict with wordpress. … Read more

wordpress not displaying my form

This is correct behaviour. A simple echo will just return the field from the DB, unmodified. if you want to render the shortcode try <div class=”first”><?php $recentProjects = get_post(‘275’); echo do_shortcode($recentProjects->post_content); ?> </div>

Creating a custom multilingual form

What would be the easiest, cheapest approach for this? Simple, create one form per language. In functions.php or, preferably, as a custom plugin: add_shortcode( ‘my-lingo-form’, ‘shortcode_wpse_98360’); function shortcode_wpse_98360() { $lingo = your_language_detection_method(); switch( $lingo ) { case ‘en’: echo do_shortcode(‘[form-en]’); break; default: echo do_shortcode(‘[form-other-languages]’); break; } } In your post or page: [my-lingo-form].

limit characters when posting from form

To limit characters add this to your textarea: maxlength=”200″ changing “200” to whatever you want the character limit to be. <textarea id=”description” maxlength=”200″ tabindex=”3″ name=”description2″ cols=”50″ rows=”6″></textarea> For a character counter you will need some basic Javascript, something like this: counter = function() { var value = $(‘#description’).val(); if (value.length == 0) { $(‘#totalChars’).html(0); return; … Read more

How to know what submit button the user clicked?

The submit_button() function is a wrapper for get_submit_button(). Now that function has multiple arguments, but the most interesting for your actual problem is the 3rd argument name. It sets the HTML name attribute. <form action=””> <input … etc. <button type=”submit” name=”choice-a”> </form> Now everytime you process your form with an empty action attribute, you will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)