I have developed an AJAX function within WordPress for my plugin. In the plugin construct, I am setting up the AJAX callback: public function __construct() { return $this->register(); } /** * Register all new files in WooCommerce hooks */ public ...
I want to update the quantity in the session cart or add a new item if it doesn't already exist. If the item is already in the cart, I am looking to increase the quantity by 1. if (!isset($_SESSION['cart'])) { $item = array('pid&ap ...
Can you assist with the following issue? <?php if(isset($_POST['MEASURE'])) { shell_exec("sudo python /var/www/html/lab/mkdir.py"); } ?> Here is the HTML part: <form method="post" > <input type="submi ...
I am encountering a strange issue with the response from my ajax request. The controller's method below is supposed to return an ID: <?php namespace AppHttpControllers; use IlluminateHttpRequest; //use AppHttpRequests; use IlluminateSupportF ...
There are two main resources that I am working with: Organizations OrganizationUsers (which has a foreign key to Users on user_id) The User model includes the following attributes and methods: class User extends Authenticatable { use Notifiable; ...
Recently, while working with Laravel and Vue.js, I came across an issue after rearranging my files to upload the project online. Now, whenever I update the Vue files, the changes don't seem to reflect. Seeking assistance from the experts in this commu ...
I am faced with the task of generating a custom JSON object by organizing data retrieved from PHP in my Controller. I have full control over what information goes where and in what specific order. To accomplish this, it seems like I will need to go throug ...
I am trying to retrieve the value of a variable set using an input tag from one tpl file. Here is the input tag in A.tpl file: <input type="checkbox" class="checkbox" name="payment_data[processor_params][enable_addbillcard]" id="optional_enable_addbil ...
There seems to be an issue with my ajax login call: $.ajax({ url: url_to_ajax, success: function ( data ) { switch (data) { case "-2": input1.addClass("has-error"); break; cas ...
Hey everyone, I'm working on implementing a simple voting system for comments using jQuery Ajax to avoid page refreshing when someone likes or dislikes a comment. Here is the jQuery code I have so far: $(document).ready(function(){ $(".vote-btn").cli ...
I am currently diving into the world of Ajax and I've hit a roadblock: 1. HTML : <body> <form> Username: <input type="text" id="username" name="username"/> <input type="submit" id="submit" /> </form> <script src ...
i am trying to implement a code snippet if($_POST){ // creating a response hash $response = array('type'=>'', 'message'=>''); try{ // performing data validations, for example checking if & ...
I have a challenge where I need to pass a string stored in a variable to a MySQL table using PHP. Currently, my workaround involves using a hidden <input>. I assign the variable value to it and submit it through a form. It works, but it's not e ...
I followed a tutorial on YouTube to copy the code, adjusted the database connection and SELECT items to fit my existing DB, but I'm struggling to get the JS file to load the PHP file. When I use Chrome's "inspect" tool, it shows that the JS file is being l ...
Having some trouble extracting a value from an href link to use in my database operations. Unfortunately, I couldn't retrieve the desired value. Displayed below is the code for a button: <a class="btn btn-info" href="scheduleSetTime.php?id='. $id .' ...
So I have these files: require_once("includes/database.php"); This poses a problem when the file is included from shopping_cart.php because the path makes sense in that context. But if the table.php file is called directly, the current directory will be ...
Currently, I am in the process of learning how to effectively rename an uploaded picture (or file) with a unique identifier to ensure it does not have the same name as any other uploaded files. This unique file should then be saved into a database where it ...
Currently, my code reads: $this->db->select('GROUP_CONCAT(prod_poster, poster2, poster3, poster4, poster5, poster6, poster7)'); However, I encounter an error with this line of code and the SQL query that is generated is as follows: SELECT GROUP_CO ...
Hey there, I've got a quick question that has been puzzling me lately. I have a specific date, like "first Sunday in April," and I'm trying to figure out the day before using the strtotime function in PHP. I thought about how this task would be more compli ...
Here is the current server block configuration I am using: server { listen 80; server_name petpal.co.il; root /usr/share/nginx/petpal; index index.php; rewrite ^/([a-zA-Z]+)\-([0-9\-]+)$ /$1.php?page=$2? last; rewrite ^/e ...
Looking for a solution to customize the reply-to email addresses specifically for New Order and Shipped emails sent to customers. I attempted to implement a suggested fix from this resource Change "reply to" email address in all Woocommerce email ...
Having previously written scripts to manage IMAP, such as removing spam emails, I am now working on a more general script to examine available mailboxes. My starting point was the PHP website example for imap_getmailboxes. Here is my adapted version: $use ...
Looking for assistance in sending the current page URL to a database or email without redirecting the page. Any help is appreciated! Thank you! ...
Imagine a scenario where there are two links available. <li><a href="#" id="VALUE1" class="charName">Name 1</a></li> <li><a href="#" id="VALUE2" class="charName">Name 2</a></li> Now, when one of these link ...
Here is the PHP code snippet I am working with: <?php if(isset($_POST['address_building_number']) OR !isset($_POST['address_building_number'])){ $address_building_number = $_POST['address_building_number']; echo 'Hello'; $go ...
My dedicated server is set up with WHM/cPanel CentOS Apache. One of the accounts on cPanel is hosting a WordPress site that has been infected with a virus. This virus is being used to send emails and inject affiliate links without authorization. Despite ...
I am using a role package that stores relational data in my database, specifically with a users table and a user_roles table containing foreign keys. When updating the model, I utilize the following code: $user = User::findOrFail($id); $user-> ...
I have an HTML table that is generated dynamically and I am looking to extract the data from it using the POST method. Is there a way to accomplish this? Are there any alternative methods you would suggest for achieving this goal? Below is a basic example ...
I'm encountering an issue while attempting to insert data into the 'products' table within my SQL server. Despite my efforts, the table remains empty and I'm unsure about what's causing this problem. Here's a snippet of my code: <?php /* Defining the ...
Looking to implement a JavaScript loading image that displays until the page has fully loaded? I'm currently developing an online antivirus scanner and in need of help. I am trying to set up JavaScript to show a loading image while a file is being uploade ...
I've been trying to figure out how to pass variables from a js function to my database using php, but I've hit a roadblock. Any suggestions on how I can resolve this issue would be greatly appreciated. <html xmlns="http://www.w3.org/1999/xhtm ...
I have a jQuery script that sends data to a .php script using post or get methods. However, I want to prevent direct access to the PHP script. If a user looks at the HTML source code, they could potentially access the PHP script by copying the URL from ...
I am currently developing an innovative Image hosting platform, and I am faced with a crucial challenge – how can I effectively prevent users from continuously refreshing the form, causing the image to be repeatedly uploaded until my disk space allocat ...
I'm currently working on a laravel-angular application that requires a password reset feature. However, the default password-reset in Laravel relies on email verification, which is not necessary for this particular application. I tried setting $confir ...
Upon returning to a project after a week without making any changes, my php artisan command suddenly stopped working. Strangely, this issue only affects this specific project, as other projects are running fine with php artisan. When attempting to execute ...
How can I incorporate a JavaScript variable 'x' into an @if statement in Laravel? I have tried placing it both inside and outside of the @if statement. When placed outside, it works perfectly fine, but I really need to perform an action based on this condi ...
Recently, I encountered an issue while trying to set up an album for a specific page. The error message that appeared was: [15-Sep-2011 22:38:14] PHP Fatal error: Uncaught OAuthException: (#100) Invalid ID for album owner thrown in C:inetpubwwwrootD ...
Operating an e-commerce site at , built on wordpress and woocommerce. Utilizing the Ultimate Member plugin for user registration and login purposes. Currently seeking a plugin or method to allow users to view their orders directly from their profile. ...
To provide a clearer explanation, here is a code snippet: private $ParseRuleMap = array(); public function __construct( $rules ) { foreach( $rules as $which=>$rule ) { $mapping = $rule->getMinimumMatchables(); foreach( $mapping ...
I'm really struggling with this mysqli prepared statement and I just can't seem to figure out what's going wrong. I've spent a lot of time troubleshooting already, so let me start by showing you the code snippet (which is currently only working locally): ...
When uploading an image from a React frontend to a Laravel backend, I encountered an issue where the uploaded image path was saved in the database but the image wouldn't display. React code ` useEffect(() => { axiosClient .get(&q ...
Seeking some assistance. I must confess, this might be a simple question for most, but as someone who isn't proficient in programming, I ventured into creating an app with Laravel without having a solid grasp on the fundamentals of PHP. Currently, I ...
These PHP lines are effective, but I am unable to replicate them in Node. $secret_key = hash('sha256', XXXX, true); $hash = hash_hmac('sha256', YYYY, $secret_key); The documentation states that hash() returns raw binary data, but it a ...
Is there a method to incorporate the Git version of a file/repository into a comment block so that PHP Doc can dynamically display it when generating documentation? ...
Hello there! I've encountered an issue: PHP is sending compressed data using gzdeflate(): $string=gzdeflate($string,9); echo $string; In the browser, pako.js has been included and the following code is executed: var rsp=rst.responseText; rsp=pako.inflate ...
While utilizing Laravel to send Ajax requests, everything functions properly on localhost. However, once I test it on the live server with an adblocker enabled, it fails to work. Once the adblocker is disabled, the functionality returns. domain.com/sponso ...
I was struggling to find the right words for my question -- My issue involves a basic ajax request triggered by a checkbox that sends data to a database. I want to prevent the checkbox from changing if the ajax request fails. Currently, when the request ...
Following the migration of a WordPress site from a development server to the live site, I am encountering the following issues: A cautionary message is being displayed: include() [function.include]: Failed opening '/home/content/83/11353583/html/wp-conten ...
I'm looking to develop a custom WordPress plugin that involves modifying the .htaccess file. Can someone guide me on how to achieve this using PHP? I've seen it implemented in other plugins, but I'm unsure of the process. Any advice would be greatly appr ...
I have 3 folders named FOLDER1, FOLDER2, and FOLDER3. Each folder contains files such as file1.txt, file2.txt, file3.txt, and so on. There are no subfolders within these directories. Some files in these folders are duplicates, for example: FOLDER1 has fi ...
I'm attempting to showcase the departments on my website as tabs. When a tab is clicked, it should display the data related to that specific department based on the department_id. I experimented with this code snippet Execute php function only when c ...
I am looking to customize my menu display by showing the primary menu only on my home page (front-page.php) and displaying the secondary menu on all other pages except for the home page. In my functions.php file, I have registered both the primary and sec ...
I am currently working on an Ajax call that will submit a form and display different content based on the server's response: $('#applyForm').submit(function(){ var dataString = $(this).serialize(); $.ajax({ type: "POST", url: "php/c ...
Utilizing an external webservice, I am able to retrieve my data through a .php link that provides a downloadable .csv file. I want to import this data into a Google Spreadsheet and have it automatically refresh (ideally every hour) to include any new data ...
I am designing a website on Wordpress where I want to showcase various "tiles" containing content from different sections of the site on the homepage. These tiles are custom post types such as "services", "consultants", and "blog posts". While I understan ...
I built a form to collect user information, which I then encode into JSON and send to PHP for storage in a MySQL database using AJAX. Below is the script I included just before the closing </body> tag. Unfortunately, I'm facing an issue where the re ...
There are two dropdown menus on my webpage that display information from my SQL table. The first dropdown contains different "Colors," and the second dropdown contains members associated with each color group. Each member is categorized into different optg ...
Similar Question: PHP - reformat multidimensional array to insert into MYSQL? I am trying to save a multi-dimensional array in my database. Here is the code I have, but it doesn't seem to be working: include 'config/config.php'; $ ...
I am working on a form that has two input type buttons. The first button is labeled "edit", and when clicked, it enables the input field. The second button is labeled "save", and when clicked, it disables the input field and should save the new values in a ...
Help needed with passing a variable from PHP to Python and displaying it on the webpage. PHP <?php $item='example'; exec("python pytest.py $item"); ?> Python import sys print(sys.argv[1]) Using WAMP, both the PHP and Python files ar ...
I oversee a team of employees, each with a 7-day work schedule. To streamline the process, I have developed a PHP form that I would like to use to collect data for verification in JavaScript before submitting it to an SQL database using AJAX. My main cha ...
I am currently in the process of developing a massive web application. In this platform, users will have the capability to upload both images and music files onto my server. I am utilizing the PHP language with the Codeigniter framework, all managed throug ...
[ {"category":["30","32","33"],"type":"30 days","price":"100","ID":"0"}, {"category":["34","37","47"],"type":"30 days","price":"200","ID":1}, {"category":["46"],"type":"40 days","price":"100","ID":2} ] To retrieve all categories that have the type: 30 day ...
Is it possible to create a drag-and-drop editor similar to the one found in the form editor on wufoo.com? ...
Here is an example of my Ajax call: var keyword = $('#keyword').value; $.post("ajax.php?for=result", {suggest: "keyword="+keyword}, function(result){ $("#search_result").html(result); }); In the PHP file, I am trying to retrieve the ...
Looking to retrieve information from anchor URLs on a website: require 'simple_html_dom.php'; $html = file_get_html('http://www.example.com'); foreach($html->find('a') as $element) { $href= $element->href; $nam ...
After searching extensively on the internet, I am still unable to find a solution to my problem. I have an .htaccess file that successfully rewrites my query string into the GET variable. However, I have encountered a new issue when dealing with the POST ...
I am working on a project where I have a group of options within a selection dropdown and my goal is to utilize JavaScript to deselect all chosen values, gather them into a string, and then send it over to my PHP script. ...
Can anyone suggest the most effective method for passing a PHP object via AJAX? For instance: //objectClass = objectClass.php $obj = new objectClass(); <a href="javascript:getOutput("some variable", $obj); Since the other file, output.php (called thr ...
Recently, I've been working on configuring updates for tickets added to the Wallet app on iOS. It’s intriguing how the url https://example.com/index.php/var1/var2 continues to function properly and triggers the execution of index.php. Is there a sp ...
Is it feasible to display the contents of a text file uploaded via a form directly from the $_FILES variable without saving it on the server first? I am aware of the security implications, but this will only be executed on a local machine. ...
Is it possible to include an icon in a post using the sw_icon command? For instance: {% sw_icon 'head' %} Are there any alternatives to using 'head' for this command? ...
Currently, I have an ajax function that sends a string of variables to my script. However, there is one variable that needs to hold a complete URL along with parameters. In the current setup, var1 and var2 are received as $_POST variables. But I specifica ...
I am facing a challenge that seems simple to resolve, but it's proving to be quite tricky. Currently, I have a functional PHP file that fetches data from a database and stores it in an array. This file does not require any parameters and the output i ...
Hello everyone! I recently faced an issue with my Joomla website. I am using a Joomla template and in the 'views' directory, there is a page that displays a list of employees using an 'ajax-accordion'. Each employee's name serves as the header, and clicki ...