Skip to main content

Posts

Showing posts with the label php

can´t find php file to endow html element with tooltip [closed]

On a single product page under the product short description there are the product atrribute options like "size" for example. I would like to insert a hover effect so that everytime a user hovers over the word "size" (just an example) a tooltip pops up displaying text to explain what the attribute exactly means. I have no idea where to put these changes in my theme editor. can anybody help me? source https://stackoverflow.com/questions/70414195/can%c2%b4t-find-php-file-to-endow-html-element-with-tooltip

Lumen save() is not working after an other save()

I have these two Models : Club.php class Club extends Model implements AuthenticatableContract, AuthorizableContract, JWTSubject { use Authenticatable, Authorizable; // because name of the class != table name protected $table = 'sf_club'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'login', 'email', 'nom_equipe', 'avatar', 'nation_id', 'argent', ]; /** * The attributes excluded from the model's JSON form. * * @var array */ protected $hidden = [ 'password', ]; } Stade.php <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Stade extends Model { // because name of the class != table name protected $table = 'sf_stade'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [

How yo insert data with image in AngularJs and PHP mysql

I have a CRUD table where I want to display users list with the profile pictures I'm using AngularJs and Bootstrap I have added upload file to the form and I'm able to insert to the DB but not able to save the uploaded file to my directory (/uploads) My index form <!DOCTYPE html> <html> <head> <title>users</title> <script src="jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> <script src="jquery.dataTables.min.js"></script> <script src="angular-datatables.min.js"></script> <script src="bootstrap.min.js"></script> <link rel="stylesheet" href="bootstrap.min.css"> <link rel="stylesheet" href="datatables.bootstrap.css"> </head> <bo

EParseError Unrecognized parameter name "Type"on line 592 in Aeston

I updated WAMP to version 3.2.6, even installed Aestan version 3.2.4.2 separately (though the installer told me it was installed already). No errors when I start WAMP with a PHP version other than 8.1 but I do get [EParseError] Unrecognized parameter name "Type" on line 592 when starting Wampmanager using PHP 8.1. The services are started and phpinfo() tells me I am actually using PHP version 8.1. PHP version 8 was installed using the WAMP installation utility. source https://stackoverflow.com/questions/70360544/eparseerror-unrecognized-parameter-name-typeon-line-592-in-aeston

Create an Html with OpenTBS

I'm using tbs '3.8.0' with OpenTBS Plugin version 1.7.6 to create a docx. In the same project I have dompdf.cls.php 468 I know that I can't convert directly a docx to a pdf, so I'm trying to use OpenTBS to create a valid input for Dompdf . Is there a way to create an html with OpenTBS, or something that I can pass as a valid input to Dompdf ? As now my docx is created in this way: $TBS = new \clsTinyButStrong; $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN); $TBS->LoadTemplate('path'.$fileName, OPENTBS_ALREADY_UTF8); $TBS->Show(OPENTBS_STRING, $fileName.docx"); source https://stackoverflow.com/questions/70396707/create-an-html-with-opentbs

WooCommerce custom add to cart function adding only first item

I am running a custom function that adds an item variation to the cart. It is registered as a route route. The code of the function: try { require WP_PLUGIN_DIR . '/woocommerce/includes/wc-cart-functions.php'; require WP_PLUGIN_DIR . '/woocommerce/includes/wc-notice-functions.php'; WC()->session = new WC_Session_Handler(); WC()->session->init(); if (!WC()->cart) { WC()->initialize_cart(); } $passed_validation = apply_filters('woocommerce_add_to_cart_validation', true, $_POST['product'], $_POST['quantity'], $_POST['variation']); $product_status = get_post_status($_POST['product']); if ($product_status == 'publish' && $passed_validation && WC()->cart->add_to_cart($_POST['product'], $_POST['quantity'], $_POST['variation'])) {

How do I fix reviews not showing on my website? [duplicate]

I need to show reviews on products on my website. Due to a theme issue I need to add php code to my functions.php to achieve this. The problem is the file will not save and returns an error. However the reviews will show. The error is "Your PHP code changes were rolled back due to an error on line 120 of file wp-content/themes/oceanwp-child-theme-master/functions.php. Please fix and try saving again. syntax error, unexpected '<', expecting end of file" When I fix it by removing "<?php" the file saves but the reviews stop showing. Any ideas on what to do? Please treat me as a total noob!! this is the code function add_contact_form() { global $product; if(!$product->is_in_stock( )) { echo do_shortcode('[wpforms id="3244"]'); } } <?php /** * Enable reviews for all WC Products. */ add_action('admin_init', function() { $updated = 0; $query = new \WP_Query([

method is not supported for this route

I get this error whenever I hit the delete button to delete a thread. The DELETE method is not supported for this route. Supported methods: GET, HEAD. Here is the route in web.php: Here is destroy function inside Controller: Here is the form inside index.blade: I have try instead of get in route use delete but when use it I got other error. that goes to variables inside the blade and its undefined variable. I would be very thankful if anyone could point-out mistake I'm doing here. source https://stackoverflow.com/questions/70383702/method-is-not-supported-for-this-route

Testing PHP scripts with MySQL access offline without changing live system - recommended workflow

this question might sound simple but I havent been able to find answers online so far. I am running a website that has php scripts accessing a mysql database. Whenever I make changes I don't want to work test the changes on the live website, so I test them on my local PHP server and a local MySQL database. Now obviously when i upload the changes I have to change the line establishing the connection $con=mysqli_connect(...); This is obviously not a huge deal but I bet professionals have their workflow set up in a way where this is not necessary right? Could any professional PHP developers tell me there workflow for making changes to a live site? Thank you! I am using PHPstorm btw. source https://stackoverflow.com/questions/70368665/testing-php-scripts-with-mysql-access-offline-without-changing-live-system-rec

How can I align the amount box to the right? html

Good people, after so many hours trying, I turn to you who will surely be able to help me, I could not align the picture in any way, I would appreciate it very much since I am not an expert. use center, left, right. It is a page that a client asked me, and I must correct it before Friday https://pastebin.com/0Tuu0Zjx table image <div class="table-responsive"> <table cellspacing=1 cellpadding=2 border=0 width=100% class="transaction-table"><tr class="hover"> <td class="item htd"> <div class="table-responsive"><div class="deptab"> <table cellspacing=1 cellpadding=2 border=0 width=100% class="transaction-table"> <tr> <td colspan=3 align=center><h1>{$p.name}</h1></td> </tr> <tr> <th class=inheader>Plan</th> <th class=inheader>Deposit Amount</th> <th class=inheader nowrap><nobr>{$p.pe

Delphi equivalent to PHP's verify_password() function

Is there a "simple" function in Delphi (using 10.3 Professional) that allows me to verify a password with a hash code generated in PHP using password_hash() ? A function which does the same as PHP's password_verify($password, $hash) ? Example using PHP: $hash = password_hash('thisismyaccesscode', PASSWORD_DEFAULT); // $hash == '$2y$10$21qire0Qwz/gj6HEej3tf.skdiZzeB.rgFdg7qD.5rAhE/AFg.U8q' Now I'm looking for a Delphi function, that tells me, if the password entered into my program can be verified against this hash. Background: I have a list of user records for my web server. Using a web service I can retrieve a user's password hash from that server. I know it is generated using the PHP function password_hash() . I want to enable my users to log in to my Delphi program using the access code from the web site. Therefore I get the password hash from the web server and want to verify it locally in my Delphi program instead of uploading the password

How does php substr deal with two offset values?

Consider the following: echo substr("abcdefgh", 1, -1); // outputs bcdefg echo substr("abcdefgh", 2, -2); // outputs cdef Seems like substr is taking first numeric parameter as offset from start of the string and the second parameter as another offset from the end of the string. I went through the official docs https://www.php.net/manual/en/function.substr.php They don't mention that there can be two offsets. They rather expect the second numeric parameter to be the length . So, does substr take the second numeric argument as a second offset from the end when it is negative? source https://stackoverflow.com/questions/70368353/how-does-php-substr-deal-with-two-offset-values

Downloading data records only between specified Date frame

So im working on a CRM software in YetiForce and my task is to download data records and calculate only these that match specified Date frames. I have a html form where user gives Date frames: <div class="modal-header"> <h5 class="modal-title">Kalkulator kosztu eksploatacji</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> <form action="CostCalculator.php" method="post"> <h4>End Date</h4> <input type="date" name="startDate"><br> <h4>Start Date</h4> <input type="date" name="endDate"><br><br> <input type=&qu

Getting wrong records count from my mysql table

I know I am doing something wrong here but I couldn't figure out where ? Trying to display records and delete them by clicking on a Remove button, records get displayed but they are duplicates eventhough in my Table they are unique, here is my code: // Fech files and display them in a Modal if($_POST["action"] == "fetch_files") { $file_data = scandir($_POST["folder_name"]); ?> <table class="table table-striped table-sm" cellspacing="0" width="100%"> <tr style="background-color:#FFC300"> <th style="text-align: left">Document Name</th> <!-- <th style="text-align: center">Category</th> --> <th style="text-align: right">Remove Document</th> </tr> <?php foreach($file_data as $file)

create a function and modify a post on the wordpress site based on the post id [closed]

I want to create a function and modify a post on the wordpress site based on the post id, and it is in the single.php loop. default values: single.php file $dlm128=get_post_meta($post_id,'music128',true); $dlm320=get_post_meta($post_id,'music320',true); If specific conditions are met( $constantvalue= "anothervalue" ), I want to update the post; else, I want to leave it the same. How can I acquire a post by id in a loop and edit the content of that post using if conditions? (I want this post(by postid) have different result by conditions that I declared) source https://stackoverflow.com/questions/70353064/create-a-function-and-modify-a-post-on-the-wordpress-site-based-on-the-post-id

Assign WooCommerce custom checkout field as billing [duplicate]

I've created WooCommerce checkout custom fields via plugin that edit checkout fields. So far it works, but I can't figure out how to display the custom fields in "Billing" under WooCommerce -> Orders: (This is important to my shipping plugin, that is why I insist it will be in billing section). add_action( 'woocommerce_before_order_notes', 'bbloomer_add_custom_checkout_field' ); function bbloomer_add_custom_checkout_field( $checkout ) { $current_user = wp_get_current_user(); $saved_license_no = $current_user->license_no; woocommerce_form_field( 'license_no', array( 'type' => 'text', 'class' => array( 'form-row-wide' ), 'label' => 'License Number', 'placeholder' => 'CA12345678', 'required' => true, 'default' => $saved_license_no, ), $

how i can edit my source code which is encoded with ioncube loder [closed]

1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted. Ensure that you use binary mode when transferring files with FTP and disable the 'TAR smart cr/lf feature' if using WinZIP\n");}if(function_exists('_il_exec')){return _il_exec();}echo('Site error: the file '.__FILE__.' requires the ionCube PHP Loader '.basename($__ln).' to be installed by the website operator. If you are the website operator please use the ionCube Loader Wizard to assist with installation.');exit(199); ?> E¿¦g°xµ|ûT!“[=¶W$¤ORbìMÊ~RÖ55

Periodic Office 365 SMTP Send Error Due to TLS 1.1/1.0

We have PHP web application that sends SMTP emails via authenticated smtp.office365.com. This has been working for at least a couple of years. We are using PHP Mailer 5.2. We are forcing the crypto_method to STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT. Here's the weird thing. About 75% of the time it works fine. The rest of the time it reports SMTP ERROR: Password command failed: 421 4.7.66 TLS 1.0 and 1.1 are not supported. Please upgrade/update your client to support TLS 1.2. Registered Stream Socket Transports is tcp, udp, unix, udg, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2 How is it even possible that it works most of the time. If it were truly a TLS issue I'd expect it to fail 100% of the time. source https://stackoverflow.com/questions/70353208/periodic-office-365-smtp-send-error-due-to-tls-1-1-1-0

how to configure the azure app to send a notification when a user is deleted from the app

Everyone is fine? I have an azure AD registered app that integrates into a php system using a single login with the SAML protocol. everything works fine, but I need to set up a request so that when the user is deleted by the administrator it sends a request to my server so I can log the user out and remove it from my system. what have I tried? I tried to use provisioning but I didn't get the result I wanted, even setting the correct mapping. I've wondered how I can do this with provisioning, trying to understand how to send when the user is deleted in azure to my system, but I don't understand how I can do this. what do i really want? When the app's adm deletes the user, it sends a request for a route configured on my server so that I can also delete the user from my server. source https://stackoverflow.com/questions/70353207/how-to-configure-the-azure-app-to-send-a-notification-when-a-user-is-deleted-fro