How do I let users upload files to a chosen location?

In PHP, instead of: <form method=”POST” action=”url”> Use this instead: <form enctype=”multipart/form-data” method=”post” action=”url”> You can then fetch the resulting files using the $_FILES superglobal. In WP 3.1, the whole uploads infrastructure should be available as an API unless I’m mistaking. But it won’t necessarily work on the front end, let alone allow you to … Read more

Form doesn’t submit on second submit call

The php function which handles the submitted values in this plugin checks first if the button’s value isset. When using the original submit it is. When using preventDefault() and then calling submit() it isn’t and therefor the php doesn’t handle the submitted form but rebuilds it. To fix this I just added to the isset() … Read more

Custom CSS for plugin form

you can check with the_posts hook if your shortcode exists and only enqueue the style if so : function check_for_shortcode($posts) { if ( empty($posts) ) return $posts; $found = false; foreach ($posts as $post) { if ( stripos($post->post_content, ‘[CHANGE_TO_YOUR_SHORT_CODE’) ) $found = true; break; } if ($found){ $url = get_bloginfo( ‘template_directory’ ); wp_enqueue_style( ‘my_login_Stylesheet’,$url.’/my_login_Stylesheet.css’ ); … Read more

WordPress custom form action url

simple with jQuery: //first make sure you have jQuery on that page add_action(‘wp_enqueue_scripts’,’make_sure_i_have_jquery’); function make_sure_i_have_jquery(){ if (!is_admin()) wp_enqueue_script( ‘jquery’ ); } //then just change the url to you own add_action(‘wp_footer’,’change_comment_form’); function make_sure_i_have_jquery(){ if (!is_admin() && (is_page() || is_single())) echo ‘<script> $(“#commentform”).attr(“action”, “http://yourUrl.com”); </script>’; } just paste this in your theme’s functions.php or the plugin your … 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

Adding Custom Forms

If I were doing it this is how I’d do it: I would be to use a plugin such as cFormsII (free), Gravity Forms (Commercial), or several others to store the data in the database. Both the plugins I mentioned allow you to export the data which is great for a guest list. For the … Read more

How to take options from form fields and turn them in to links?

Yes. First of all, to be able to highlight the current sorting method, we attempt to retrieve if the GET variable sort_by occurs in the url: <?php switch ($_GET[“sort_by”]) { case ‘most_recent’: $active=”most_recent”; break; case ‘most_favourite’: $active=”most_favourite”; break; case ‘most_viewed’: $active=”most_viewed”; break; default: // However you sort by default $active=”most_recent”; }?> If a valid sort … Read more

RSVP form for Facebook events from a WordPress post?

I’m also working on this right now, I’d love if you post your final solution once you get there. Here are two tutorials that may help you. http://www.masteringapi.com/tutorials/how-to-check-status-and-rsvp-to-facebook-events-using-graph-api-fql/61/ http://www.masteringapi.com/tutorials/how-to-create-facebook-events-using-graph-api-advanced/59/

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