Correct Syntax for uploading files to custom directory in WordPress

(Update to answer: 05.27.15) What finally worked is using ABSPATH: $folderPath = “/jobtracking/files/standard/{$projID}”; mkdir(ABSPATH.$folderPath, 0755, true); $filename = basename($_FILES[‘Attach_Files’][‘name’]); $filetype = $_FILES[‘Attach_Files’][‘type’]; $datei = “files/standard/{$projID}/{$filename}”; $target_path = ABSPATH.$folderPath . “https://wordpress.stackexchange.com/” . $filename; if(move_uploaded_file($_FILES[‘Attach_Files’][‘tmp_name’], $target_path)) { mysql_query(“INSERT INTO files (files.name, files.project, files.user, files.added, files.datei, files.type, files.folder, files.visible) VALUES(‘{$filename}’, ‘{$projID}’, 5, UNIX_TIMESTAMP(now()), ‘{$datei}’, ‘{$filetype}’, 0, ‘ ‘)”); … Read more

jQuery Live Form Validation in WordPress

Your page through javascript errors. Try loading the validation scripts on footer (before closing </body> tag) rather than within header (within <head> tag). If that doesn’t work, then try editing the jquery.validate.js file, and replace the first line (function(jQuery){ with (function($){. It should work.

jQuery form plugin, submit in the wordpress way

If you want to use the WordPress functions in your process.php file then there is a way for you. simply put these two lines of code at the top of your process.php file $blogheader = explode(“wp-content”,$_SERVER[“SCRIPT_FILENAME”]); include $blogheader[0].”wp-blog-header.php”; Now you can use the WordPress functions in your file and do what you want. Will that … Read more

upload images on front by user using form

If all you do is update ACF fields with your form, why not use the built-in function to generate the form? Create a new ACF field for the images, or simply use the Gallery field type, then display the form using acf_form: <?php acf_form(array( ‘post_id’ => ‘new_post’, ‘new_post’ => array( ‘post_type’ => ‘vendre’, ‘post_status’ => … Read more

Submitting a plugin form to database in admin page

[UPDATE] You should have the page divided in two section- 1. One dealing with AJAX request and Post Method 2. Displaying form data Here is outline <?php if (strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’]) == ‘xmlhttprequest’ or $_SERVER[‘REQUEST_METHOD’] == ‘POST’){ // Process AJAX Request or POST Method } if (strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’]) != ‘xmlhttprequest’){ // HTML Code here which will not be … Read more

Get Video Attachment to post

Video from video clud, like youtube.com, vimeo? If true – use text field or textarea field. User fill youtube share code in this field and you will add this to post_content. Or create custom iframe and tell users insert video link.

Issue with contact form 7

Invalid mailbox syntax is used Error You can find Invalid mailbox syntax is used error under the To, From, Subject or Additional Headers fields, that are located in the Mail Contact Form tab. solve “Your contact form has a configuration issue” error You have to solve this error. Otherwise, your email might not reach the … Read more

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