I guess the issue with this line:
$path = "wp-content/themes/creation/templates/inc/log.txt";
You need to use the full path, not a relative part, while using fopen() or file_exists().
Something like this should fix your issue:
$path = get_template_directory() . "/templates/inc/log.txt";
get_template_directory() will return the absolute server path, without a trailing slash.
Related Posts:
- Comparing arrays within a loop
- Jquery ajax to custom php file: returning blank data
- PHP calling AJAX function that relies on passed PHP function values not working
- Looking for a better way to handle an ajax script that pulls in post data on click
- Data fetch and delete by ajax request
- Can’t use get_results() in ajax query
- Debugging PHP object during Ajax call in WordPress
- WordPress Ajax Data problem
- Display notification only once
- admin-ajax.php returning error 400 namespaced callback
- Access/update database with jQuery
- Passing jQuery value using Ajax to a page template
- ajax_object is not defined when ajax calls the function
- Why is this Ajax not working?
- How to prevent those PHP variables from being cached on WordPress?
- Ajax return code 400
- How to make drop down post title
- Create onClick Event to Re-load a Widget
- ajax, right way to do it and make it works?
- How to store data from multiple forms using ajax and php
- WordPress ajax doesn’t display object method on jQuery .change() function
- Problem with custom plugin using AJAX to pull info from php file
- Call a PHP Function with Multiple Parameters that is outside the AJAX Handler
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- Ajax date_query not working past the first iteration
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- WordPress, AJAX and pre_get_posts using conditional tags
- Refresh table data with Ajax
- Setting value of session with Ajax not working
- [jQuery]Adding shortcode
- WordPress Ajax Call inserting data but success response false
- Loading php file with AJAX in WordPress frontend
- Ajax contact form return 0
- AJAX – Returning Two JSON Objects with One PHP Function
- Get the URL of the page from which an ajax request has been launched within ajax callback
- unable to use ‘new WP_Query’ in AJAX call
- admin-ajax Firing Error 400 When Logged In
- is_user_logged_in() not working in AJAX validation call
- Unset session variable on page reload / setup but exclude AJAX
- Add Ajax Hooks and Call from Custom Template PHP
- Making an AJAX call to refresh a table
- Using data sent via AJAX in multiple functions on a WP plugin
- Woocommerce with Lazy Load php and ajax
- Short code template + ajax
- Can I make get_users() query global?
- My jQuery Ajax form submit is still refreshing page?
- Calling PHP Scripts in Ajax that are in PHP Snippets
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Simple jQuery AJAX Request fails to run PHP Script
- Allow user to Upload image and manipulate it on the frontend
- Execute Jquery when a specific page in my plugin is loading
- calling admin-ajax.php from admin-ajax.php
- AJAX function not working [closed]
- what does $options = get_option(‘test_theme’); do?
- Validating an email input from form field before submit using JQuery, AJAX, and PHP
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- jquery & ajax getting data from php in wordpress . admin-ajax.php returns 400
- Settings API form – submit with AJAX
- My Custom Post Type AJAX Query is Returning no posts – why?
- register_block_type is not working properly
- Submit remote form to wordpress REST API and save data to custom post type
- AJAX numerical pagination problem in TwentyFifteen-child theme
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Why my Ajax events are no longer detected after dynamic change of shortcode content
- wp_set_object_terms returns 500 error when called through AJAX function
- How can i send id of the currently posted form data through json response in custom wordpress plugin?
- Cannot successfully execute AJAX script to call function.php specific function. Using XAMPP localhost to test
- autocomplete in wordpress using ajax with json-data
- ajax polling with admin-ajax.php
- Remove item from post_meta array via AJAX
- wp_send_json erase last value
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- How to load WP_Editor JS files manually (with AJAX)?
- WordPress 404 when using AJAX to call php function
- wordpress ajax pagination
- Submitting my form to the database and then redirecting to payment site
- wp_delete_comment is doing nothing
- Pass the updated value of aid from form using ajax
- 403 (Forbidden) delete file image in themer folder
- 500 (Internal Server Error) of external php file
- Use jQuery and AJAX to get HTML
- Problems with plugin that fetches data from database with ajax
- Dynamic Gallery
- Execute PHP code in Javascript onclick
- best way to communicate between php and jquery/javascript
- Loading a post’s content, into a div outside the loop, when it’s title is selected in a list
- Jquery autosave text area after typing
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- Correct way to perform a GET to another PHP file hosted on wordpress
- Remove Woocommerce product from cart with ajax/fetch
- WooCommerce Modal Fly cart on add to cart – With AJAX
- Word press – JSPDF – Sending PDF as attachment from wp_mail – Special characters
- Upload multiple files via ajax from an HTML file input
- How to pass javascript var to php var
- Ajax infinite scroll random order shows duplicate posts on custom post type
- Display posts based on the selected category when no subcategory is chosen
- Data insertion after clicking a button does not work (script, AJAX, PHP)
- WordPress Insert line in DB when clicking a button
- Woocommerce – how can i add items to cart using onclick – multiple items at once with custom prices