PHP cURL parsing of site adidas.de returns 403 error

PHP cURL parsing of page https://www.adidas.de/frauen-sneakers returns 403 error. Probably the site is protecting from parsing. Here is my code:

$url = 'https://www.adidas.de/frauen-sneakers';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    $header = array(
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7',
    'cache-control: max-age=0',
    'cookie: gl-feat-enable=CHECKOUT_PAGES_DISABLED; geo_ip=5.189.119.168; geo_country=RU; onesite_country=DE; geo_coordinates=lat=56.85, long=60.60; AKA_A2=A; sbsd_ss=ab8e18ef4e; akacd_plp_prod_adidas_grayling=3890698788~rv=23~id=eec2203c9e0501446a16ec5a436e9d65; mt.v=1.033191846.1713245990928; persistentBasketCount=0; userBasketCount=0; x-commerce-next-id=7641c825-97c4-4599-85ad-2796ec083517; pagecontext_cookies=; pagecontext_secure_cookies=; notice_preferences=%5B0%2C1%2C2%5D; ab_qm=b; AMCVS_7ADA401053CCF9130A490D4C%40AdobeOrg=1; s_cc=true; QSI_HistorySession=https%3A%2F%2Fwww.adidas.de%2Ffrauen-sneakers~1713245997584; QSI_SI_0evq2NrkQkQaBb7_intercept=true; newsletterShownOnVisit=true; bm_sz=45186C40D1FB3522438E51CF2C28065B~YAAQB4DdWOXpcMWOAQAA23t95RcJ76N2rV6S+YgYB2rJCqrmjYE0/T1jau4WqDm1DpxWqNAPybSwE8cok/cnqipGIGe7XjLiJPDo1stT3xg5EK3Z9nI8eNnAC5qs1n9+J69ge6O/Lqet+e9fXL7lKB6jWXxPeDlAqgX7PpSJiO8L0xP1u/DN9NDr8u5cRpmiXx3BXrHcCjlCzXJ73sKqgjEZjlx3Xey3CuuoFv6oHCVVtA3fwlOJpxAaWST2Hdll8Q/BKrAq+Y1LoVrLrTPFe39yli7eIAF7CBhiC3kXliRFgdTUI2nJhnfwe/MbyWdUjOS/r+kgZMGAgREQh5+oLZdVeoOs9Npsm/iz5FG9MLQBtv/wWXmeLjCZoWMxQX8D5k05LrAZOHj2sGdBFE61SOPsA8KsXUAudV3EuSmhzj0CT8mYoxCLwB6rgDY+VNcC47M=~3682373~4403249; UserSignUpAndSave=3; _abck=A5441BFF0E161B4315DFC7F197D551EB~-1~YAAQB4DdWAvqcMWOAQAAzId95QsdmC9/ihh4gXJ4aotmF7mjv07swKHVefmhK/Jvlr6H6q9y8xMcyE4RdYwumyLyrpfreLhI6zfRhkwOuGduWus4w/M2iKZZoKjPDjUY2aX0JDboGS1yKL64P1sISjRpUnrz7KKtpnIxUlbA7IiZoqSQCeOTvYjIwnUaAijaeV3dafr5Vc4NhNHPV3FYOvo3hPrFg8LTvrF3peDeIcBohIGeRBLiDXHGGr+cJAjFVKcndfMJ2ugNbrOBY3g+O9Y6zn9v5kK7ww9cZF/aOIds4tnk5l8QwH76XC4CHo1XS9SS5bvrmj83xNK4DAmeKnhgsH/lzPjGVjnzOR831vbZtk2pW0AIl+TgpA6T+swCzXHiL5tt9OoDGzk+djHXCX4BhKQerX3PA41yk8mxjnuaWHGIOFYDaVBVNH/xLAatplRXWK4YHk6TX+xgKm5/aDukHZ6GLNHAvNTyZWzND9qrljNZ87knyoPEEa9hip+WazDIa+l4~-1~-1~1713250793; ak_bmsc=9F8DBC2DAF9892163B5DC5322A424037~000000000000000000000000000000~YAAQB4DdWBTqcMWOAQAAV4p95Rc0PrFRWD27fH+n/qFe8oCll8qj0UazgbnVoJLNyc28bY5wiAXRLrkeEXV0spvH6CLqtK6QZfJ+G+qA3RR9onvPtKh2IKw43S1ttt3JeQqL1u7NAOslCzkXGOPO/B8cE7AObFku/BHFf5iEWdgnLNhQHvEiFnj8Jun0OL9/q3m2ZC2sIMG7kxUEeHvWz+agVdML6Br92zDMFAXgPN4wlFU9uDQOK0DdnGb6GKYlTQeVg9c83VHQDGfbV3uUbnjQjkeh0bcXvbiGX27fPOq9VyQjBo4BgDz9r8+Ahu466MWxZIIH1M/TEOUtKeuIuF83O78ma5GyWl64b9VOfQlii3C2ngg7o6buP/ePO4357eo75SWze2y1; s_pers=%20s_vnum%3D1714503600732%2526vn%253D1%7C1714503600732%3B%20pn%3D1%7C1715838008012%3B%20s_invisit%3Dtrue%7C1713248997699%3B; utag_main=v_id:018ee56b41a2004283e85615f4a005065002505d00fb8$_sn:1$_se:8%3Bexp-session$_ss:0%3Bexp-session$_st:1713248995968%3Bexp-session$ses_id:1713245995426%3Bexp-session$_pn:3%3Bexp-session$ab_dc:TEST%3Bexp-1718431195971$_vpn:3%3Bexp-session$_prevpage:PLP%7CG_WOMEN%7CPT_TRAINERS%3Bexp-1713250797685$ttdsyncran:1%3Bexp-session$dc_visit:1$dc_event:3%3Bexp-session$dcsyncran:1%3Bexp-session; AMCV_7ADA401053CCF9130A490D4C%40AdobeOrg=-227196251%7CMCIDTS%7C19830%7CMCMID%7C49791192017317256298472773599495290531%7CMCAID%7CNONE%7CMCOPTOUT-1713254398s%7CNONE; sbsd=suAGJcBtrLiiBYBqKh3DDoOKHX7ZWxTyezlveR0MwU1nlKjZ1w+4SEQfTqwk2L72ll/TvUOTA0463av7eqIlLdrvxst+x3fQcEs2H77HeSbOmu3Sg6+X1YttYIvTV9KR4sAA8zxCAz/uM3sEkJp8RifKw4DJBdieI+WjacbykyCA=; _abck=A5441BFF0E161B4315DFC7F197D551EB~-1~YAAQBIDdWEXeXJmOAQAA5mVs5QuHH6uOtxAr3fwM14hh39q7/YQZMoV8nw/Cr4SxquNpBtAaVOx4IAGlRGxB2F0FmA5T1wbx+hTdCp5ogFBZu+h4xG/J3a2a8D2a33HJVKv+l+yLCmP3zC7YcT35dyapF+kQ/4EoTZmHvWyurHzb6oFyKpDU5Hg2RPHqEX7LG9fQPDn4O+yj1qkdDkY8N2evN/2zWrU1G73V4SscflvN5D5Pn/sNDPXDYakF5n9EZV2vh9EJffVKKO6RRQP7qD3dYdqDYLpKuP+qKrP39/MIgEsHE8k3vok+5ZgQIvSlEMbp1OqKuF/u0/S+jeutPgz3bd3XCq+IeXmWIq4fO6RQIyhOdkCF85KgZ6RcHiQzsqGeLtmZUKeNgpIVqYrROSiAmYjlL5a4jaQ8nRI0lcTMy8bxTVbV9nhEJbrLSRHmbr6oOB85cpM2BXgOX0DSi0M6F1+XywlY/s87Lr31VKpm7aIdcV7jj+psArJdyp4Kfn2wgg8=~0~-1~1713249594; bm_sz=45186C40D1FB3522438E51CF2C28065B~YAAQN4DdWCsIK8WOAQAAsUCA5RfIsTZFECJ/dzIJET+QYnOUtwJHnDAmi63kTfIMECcGToyI2I9jrlNxXz05nbb5fqcWNvzFDkC2A1TV8Do5d6jO4US7bW8qfV0N2InGn1A4hRnYxhIivvsALGHxP0FHqAzlFaQCYzsZ9ikSE2S9rNWTX9TxN+CM6e5iLQOidBtcAyEn1lovbSBtj4f0mOzOlify+ENx6Y+CROtw2wC6EMLo+K8Yp5L6iviH9pu2d/+U1lSQYtfyFE5p9JWil4SdeoRrbvbJ0ewIzGDl0nwp/v4UChZKw6MHrsRsSmUHGWGmdnasI6xuWUiiJj8P2lxh/h4J0peNUU8EbRANsO9XglMn1vwXtVnNyGxwBxrHLSWwXpMMWf0SrCqaRz/yNXHgXO+4xvwUcTHC7zpnuJqN1qttT9GBQAiJsuLukImfhK7RgLAbunyx~3682373~4403249; sbsd=sRlmNQp07SrmNzmDFQ2I3EDdWJhmGcjdnoL3U9TAZEm0LjJZ8JS1WKE1YShk2gydm4wb7Qdzf/k9idK3nwKnN5h253QQo+EZO+tSI8dwywA8jTH2TYU1AYKoQdYG8dQzhQ0ycf6zH+kNIkrYXyoWF/j+M+b9c/CtU7tgWwQEb16A=; geo_coordinates=lat=56.85, long=60.60; geo_country=RU; onesite_country=DE',
    'dnt: 1',
    'referer: https://qna.habr.com/',
    'sec-ch-ua: "Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
    'sec-ch-ua-mobile: ?0',
    'sec-ch-ua-platform: "Linux"',
    'sec-fetch-dest: document',
    'sec-fetch-mode: navigate',
    'sec-fetch-site: same-origin',
    'sec-fetch-user: ?1',
    'upgrade-insecure-requests: 1',
    'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'
  );
                    
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_PROXY, '23.227.38.168:80');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    $html = curl_exec($ch);
    curl_close($ch);
    var_dump($html);

The headers were copied from the Network tab of Chrome Dev Tools. In the browser the site is opening correctly. Why does this problem appear? Any ideas?

php mailer sending and receiving from same email

I have php code that sends feedback form data to specific email(receiver). The setFrom() function receives email(sender) from html form. But the email is send with email(receiver).

HTML

<form action="submit.php" method="post">
    <label for="name">Name:</label><br>
    <input type="text" id="name" name="name" required><br><br>
    <label for="email">Your Email:</label><br>
    <input type="email" id="email" name="email" required><br><br>
    <label for="subject">Subject:</label><br>
    <input type="text" id="subject" name="subject" required><br><br>
    <label for="message">Message:</label><br>
    <textarea id="message" name="message" rows="4" cols="50" required></textarea><br><br>
    <input type="submit" value="Submit" name="send">
</form>

PHP

<?php

use PHPMailerPHPMailerPHPMailer;

use PHPMailerPHPMailerException;

require 'phpmailer/src/Exception.php';
require 'phpmailer/src/PHPMailer.php';
require 'phpmailer/src/SMTP.php';

if ($_SERVER[“REQUEST_METHOD”] == “POST” && isset($_POST[“send”])) {

$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];

$mail = new PHPMailer(true);

try {
    
                   
    $mail->isSMTP();                                         
    $mail->Host = 'smtp.gmail.com';                 
    $mail->SMTPAuth = true;                                   
    $mail->Username = '[email protected]';                    
    $mail->Password = 'SECRET';                         
    $mail->SMTPSecure = "ssl";
  
    $mail->Port = 465;                                 

    //Recipients
    //Recipients
    $mail->setFrom($email, $name);

    $mail->addAddress("[email protected]", );
 

   
    //Content
    $mail->isHTML(true);                                  //Set email format to HTML
    $mail->Subject = $_POST["subject"];
    $mail->Body = "Name: $namenEmail: $emailnnMessage:n$message";
    //$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    $mail->send();
    echo "Send Successfully!";

} catch (Exception $e) {
    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}

}

Difficulty Including payment.php File Content in checkout.php on Live Website

Description:
I’m encountering an issue with my website where the content of the payment.php file is not being included in the checkout.php page, specifically on the live website. This problem occurs even when the user is logged in. However, on my local development environment, everything works as expected.

Steps Taken:

Verified file paths to ensure correctness.
Checked file permissions for payment.php to ensure it’s accessible by the web server.
Implemented error logging to check for any PHP errors or warnings during the inclusion process.
Attempted to debug the issue locally, but couldn’t replicate it.
Ensured server configurations (PHP version, settings) on the live website match the local environment.
Cleared any caching mechanisms to rule out caching-related issues.
Question:
What could be causing this discrepancy between my local environment and the live website? Are there any server-side configurations or permissions I should check specifically for including PHP files? Is there a recommended approach for troubleshooting such issues in a live server environment?

Update mail form required password not name – Laravel Breeze

I want to update the mail user’s with password verification and not a name verification, I can’t change the form and the method in the controller, I used the profil edit from Laravel Breeze

Model

 protected $fillable = [
        'name',
        'email',
        'password',
    ];

    /**
     * The attributes that should be hidden for serialization.
     *
     * @var array<int, string>
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * Get the attributes that should be cast.
     *
     * @return array<string, string>
     */
    protected function casts(): array
    {
        return [
            'email_verified_at' => 'datetime',
            'password' => 'hashed',
        ];

Controller

  public function update(ProfileUpdateRequest $request): RedirectResponse
    {
        $request->user()->fill($request->validated());

        if ($request->user()->isDirty('email')) {
            $request->user()->email_verified_at = null;
        }

        $request->user()->save();

        return Redirect::route('dashboard')->with('status', 'profile-updated');
    }

view

 <form method="post" action="{{ route('profile.update') }}" class="mt-6 space-y-6">
                            @csrf
                            @method('patch')

                            <div class="col-span-6 sm:col-span-3">
                                <x-input-label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
                                               for="email" :value="__('New email')"/>
                                <x-text-input id="email" name="email" type="email"
                                              class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
                                              :value="old('email', $user->email)" required autocomplete="username"/>
                                <x-input-error class="mt-2" :messages="$errors->get('email')"/>


                                @if ($user instanceof IlluminateContractsAuthMustVerifyEmail && ! $user->hasVerifiedEmail())
                                    <div>
                                        <p class="text-sm mt-2 text-gray-800">
                                            {{ __('Your email address is unverified.') }}

                                            <button form="send-verification"
                                                    class="underline text-sm text-gray-600 hover:text-gray-900 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                                                {{ __('Click here to re-send the verification email.') }}
                                            </button>
                                        </p>

                                        @if (session('status') === 'verification-link-sent')
                                            <p class="mt-2 font-medium text-sm text-green-600">
                                                {{ __('A new verification link has been sent to your email address.') }}
                                            </p>
                                        @endif
                                    </div>
                                @endif
                            </div>

                            <div class="col-span-6 sm:col-span-3">
                                <x-input-label class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
                                               for="name" :value="__('Name')"/>
                                <x-text-input id="name" name="name" type="text"
                                              class="shadow-sm bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
                                              :value="old('name', $user->name)" required autofocus autocomplete="name"/>
                                <x-input-error class="mt-2" :messages="$errors->get('name')"/>
                            </div>

I tried to update the form view with a password field instead of the name field and to add this method from the password controller in the edit email controller

   $validated = $request->validateWithBag('updatePassword', [
            'current_password' => ['required', 'current_password'],
            'password' => ['required', Password::defaults(), 'confirmed'],
        ]);

        $request->user()->update([
            'password' => Hash::make($validated['password']),
        ]);

Getting error when retrieving OUT variables from procedure [duplicate]

I am using an open source database base class from the codeshack. I have a stored procedure:

DELIMITER //
CREATE OR REPLACE PROCEDURE test(
    IN test_param BIGINT UNSIGNED,
    OUT result_out BIGINT UNSIGNED
)
proc_test:BEGIN

    SET result_out = test_param;
    
END //
DELIMITER ;

which works when I call it regularly via phpmyadmin like:

CALL test(100, @result);
SELECT @result;

However, when I try to use the php db class, I get the error:

Fatal error: Uncaught Error: Call to a member function fetch_field()
on bool in /home/testingDb.php:9

I even var_dump out $query and it just prints out the DB object.

This is the php code I am using:

$db = new db();

$sql = "CALL test(?, ?)";

$vals = [420000, null];

$query = $db->query($sql, $vals);

$result = $query->fetchAll();

This is the database class:

<?php
class db {

    protected $connection;
    protected $query;
    protected $show_errors = TRUE;
    protected $query_closed = TRUE;
    public $query_count = 0;

    public function __construct($dbhost = 'localhost', $dbuser = 'root', $dbpass = '', $dbname = '', $charset = 'utf8') {
        $this->connection = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
        if ($this->connection->connect_error) {
            $this->error('Failed to connect to MySQL - ' . $this->connection->connect_error);
        }
        $this->connection->set_charset($charset);
    }

    public function query($query) {
        if (!$this->query_closed) {
            $this->query->close();
        }
        if ($this->query = $this->connection->prepare($query)) {
            if (func_num_args() > 1) {
                $x = func_get_args();
                $args = array_slice($x, 1);
                $types = '';
                $args_ref = array();
                foreach ($args as $k => &$arg) {
                    if (is_array($args[$k])) {
                        foreach ($args[$k] as $j => &$a) {
                            $types .= $this->_gettype($args[$k][$j]);
                            $args_ref[] = &$a;
                        }
                    } else {
                        $types .= $this->_gettype($args[$k]);
                        $args_ref[] = &$arg;
                    }
                }
                array_unshift($args_ref, $types);
                call_user_func_array(array($this->query, 'bind_param'), $args_ref);
            }
            $this->query->execute();
            if ($this->query->errno) {
                $this->error('Unable to process MySQL query (check your params) - ' . $this->query->error);
            }
            $this->query_closed = FALSE;
            $this->query_count++;
        } else {
            $this->error('Unable to prepare MySQL statement (check your syntax) - ' . $this->connection->error);
        }
        return $this;
    }


    public function fetchAll($callback = null) {
        $params = array();
        $row = array();
        $meta = $this->query->result_metadata();
        while ($field = $meta->fetch_field()) {
            $params[] = &$row[$field->name];
        }
        call_user_func_array(array($this->query, 'bind_result'), $params);
        $result = array();
        while ($this->query->fetch()) {
            $r = array();
            foreach ($row as $key => $val) {
                $r[$key] = $val;
            }
            if ($callback != null && is_callable($callback)) {
                $value = call_user_func($callback, $r);
                if ($value == 'break') break;
            } else {
                $result[] = $r;
            }
        }
        $this->query->close();
        $this->query_closed = TRUE;
        return $result;
    }

    public function fetchArray() {
        $params = array();
        $row = array();
        $meta = $this->query->result_metadata();
        while ($field = $meta->fetch_field()) {
            $params[] = &$row[$field->name];
        }
        call_user_func_array(array($this->query, 'bind_result'), $params);
        $result = array();
        while ($this->query->fetch()) {
            foreach ($row as $key => $val) {
                $result[$key] = $val;
            }
        }
        $this->query->close();
        $this->query_closed = TRUE;
        return $result;
    }

    public function close() {
        return $this->connection->close();
    }

    public function numRows() {
        $this->query->store_result();
        return $this->query->num_rows;
    }

    public function affectedRows() {
        return $this->query->affected_rows;
    }

    public function lastInsertID() {
        return $this->connection->insert_id;
    }

    public function error($error) {
        if ($this->show_errors) {
            exit($error);
        }
    }

    private function _gettype($var) {
        if (is_string($var)) return 's';
        if (is_float($var)) return 'd';
        if (is_int($var)) return 'i';
        return 'b';
    }

}
?>

My question is how do access the result_out result from the test procedure? This class works perfectly when I am using regular select statment sql code.

I have had a look at this question but the error I am getting does not make any sense to me as it doesn’t seem there is any issues with my call. I have 2 parameters n my procedure, which I have tried supplying null, I have tried supplied &$result and then echoing result. Nothing has seemed to work yet.

php, shell_exec: Cannot execute powershell Get-Acl command with cyrillic in path

I have a simple PHP script in a main asp.net project. The script should copy another script with cyrillic in the path to the web server and run it using the Curl library. But the copy() or fopen() methods do not work – access is denied.

First I tried setting read access to the file using chmod():

<?php
$path = "C:\Users\Stanislav\Documents\Visual Studio Projects\ForumEngine\wwwroot\src\user-account.php";
chmode($path, 0755);
?>

But this had no effect.
Then I tried to set Acl using the appropriate powershell command, but first – get it, make change and then – set. I have run Get-Acl command, using shell_exec, but it return empty result.

<?php
$log_filename = (string)$_SERVER["DOCUMENT_ROOT"] . "\report.log";
$log_handle = fopen($log_filename, "w+");
if($log_handle !== false)
{
    ini_set("syslog.filter", "all");
    set_error_handler(function(int $errno, string $errstr, string $errfile = null, int $errline = 0) use($log_filename)
    {
        $message = "Error: {$errno} in {$errfile}, line no {$errline}n{$errstr}";
        return error_log($message, 3, $log_filename);
    }, E_ALL);
}
header("Content-Type: text/html; charset=Windows-1251");
$EOL = "<br>n";
echo "<pre>";
$path = "C:\Users\Станислав\Documents\Visual Studio Projects\ForumEngine\wwwroot\src\user-account.php";
echo "{$EOL}path: {$path}";
$command = "(Get-Acl '{$path}').Access | Format-List";
echo "{$EOL}command: {$command}";
$result = shell_exec('powershell -InputFormat none -ExecutionPolicy ByPass -NoProfile -Command "& {' . (string)$command . '}"');
$result = is_string($result) ? trim($result) : "error occurred";
echo "{$EOL}Get-Acl result: {$result}";
echo "</pre>";
if($log_handle !== false)
{
    fclose($log_handle);
}
?>

When I tried get Acl for path, wich don’t contains cyrillic, shell_exec was return correct result.

How correctly execute powershell commands which contans cyrillic?

Uploaded content from html to database [closed]

Can someone help me with saving the content from a html page to a database for the user to access later? I have a create_project page where an account can upload images, audio and text. I want to create an upload button to save those files and text into a database and to save it in a my_projects page, where every account can see their projects and can edit them or share them.

The creation/upload page

this is the page where I want users to see their projects.

Is this possible? Can someone help me?

I searched the internet for solution, but I can’t find anything for my problem or my ideea.

View image from array (no download)

I’m playing around with some json files. Is it possible to view the image indicated in the array URL with the tag?
If I insert it, the browser lets me download the photo but doesn’t display it.
I also tried changing the photo ID to the filename in the URL but it doesn’t find it.
Maybe this service is not allowed?

Thank you all.

    "catalog":"NGC",
    "name":"NGC5457",
    "m":[
        "M101"
    ]
    ,
    "ngc":null,
    "ic":null,
    "type":"G",
    "object_definition":"Galaxy",
    "ra":"14:03:12.54",
    "dec":"+54:20:56.2",
    "const":"UMa",
    "majax":23.99,
    "minax":23.07,
    "posang":28,
    "b_mag":8.46,
    "v_mag":7.86,
    "j_mag":6.52,
    "h_mag":5.81,
    "k_mag":5.51,
    "surfbr":23.97,
    "hubble":"SABc",
    "cstar_u_mag":null,
    "cstar_b_mag":null,
    "cstar_v_mag":null,
    "cstar_names":null,
    "identifiers":"IRAS 14013+5435,MCG +09-23-028,PGC 050063,SDSS J140312.52+542056.2,UGC 08981",
    "common_names":null,
    "ned_notes":"M102 may be a duplicate obs. of M101; see Sawyer, JRASC 41, Nos 7&8, 1947.",
    "openngc_notes":null,
    "image":{
        "thumbnail":true,
        "filename":"M101.JPG",
        "format":"JPEG",
        "width":816,
        "mimetype":"image/jpeg",
        "id":"0eb14758ee56fb463d6f42d798673e4f",
        "last_synchronized":"2020-05-01T21:29:13.815923",
        "color_summary":[
            "rgba(241, 240, 240, 1.00)",
            "rgba(252, 252, 252, 1.00)",
            "rgba(250, 250, 250, 1.00)"
        ]
        ,
        "height":1054,
        "url":"https://www.datastro.eu/api/explore/v2.1/catalog/datasets/ngc-ic-messier-catalog/files/0eb14758ee56fb463d6f42d798673e4f"

I have created a layout for each celestial body and I would like to make the image appear as well.

PHP Fatal error: Uncaught Error: Class “MyAppChat” not found in /var/www/html/bin/chat-server.php:12 [duplicate]

PHP Warning: Module “sockets” is already loaded in Unknown on line 0

PHP Fatal error: Uncaught Error: Class “MyAppChat” not found in /var/www/html/bin/chat-server.php:12

Stack trace:
#0 {main}
thrown in /var/www/html/bin/chat-server.php on line 12

Directory structure

 bin
    chat-server.php
 src
    chat.php
 vendor
 composer.json

My composer.json file:

{
    "autoload": {
        "psr-4": {
            "MyApp\": "src/"
        }
    },
    "require": {
        "cboden/ratchet": "^0.4.4"
    }
}

PHP custom shortcode is appending the word “Array”. How do I get rid of this?

I have a custom shortcode that shows the last updated date of my posts. The shortcode is ouputting the proper date but is appending the word “Array”? How do I get rid of this?

//Last Updated Date Blogs
function show_last_updated( $content ) {
  $u_time = get_the_time('U');
  $u_modified_time = get_the_modified_time('U');
  if ($u_modified_time >= $u_time + 86400) {
    $updated_date = get_the_modified_time('m/d/Y');
    $updated_time = get_the_modified_time('h:i a');
    $custom_content .= '<p class="last-updated-date">Updated: '.$updated_date.'</p>';
  }
  $custom_content .= $content;
  return $custom_content;
}
add_shortcode( 'the_content', 'show_last_updated' );

Issue connecting to remote MariaDB database from PHP code

Assumptions:
Server OS: AlmaLinux 8.9
Two IP addresses (a public and a private one) assigned to OS
SELinux: Disabled
WebServer: OpenLitespeed (Managed by DirectAdmin)
LSPHP version 5.6.4
Issue:
Trying to connect to remote MariaDB database using mysqli connection in PHP code running on OpenLitespeed web server fails with “connection refused” error.
Connection is established when running the PHP code using php cli:
/usr/local/php56/bin/php /path/to/test.php

Hints:
I ran tcpdump on port 3306 and saw the transmitted packets when the connection is established using PHP cli, but no packets are transmitted when accessing the page via Web Server.

Here’s what I already tried:
I allowed httpd to connect to network in SELinux policy and even disabled SELinux but still no luck.
I tried connecting to the database using both mysql cli and PHP cli which works fine.
I need some hints to correct the connection issue via php code running on the web server.

WooCommerce – Empty Cart Page Reload issue

I have an issue when i remove product from the cart and the page refresh to the empty cart page. I use this inside my functions.php file to modify the empty cart page :

add_action( 'woocommerce_cart_is_empty', 'custom_empty_cart_message', 10 );

function custom_empty_cart_message() {
    $html  = '<h1 class="woocommerce-cart-title">Cart</h1>';
    $html .= '<div class="cart-empty"><p class="cart-empty">';
    $html .= '<p class="cart-empty cart-empty_text">Your cart is currently empty.</p>';
    $html .= '<img fetchpriority="high" decoding="async" width="540" height="540" src="https://myurl.com/wp-content/uploads/2024/04/empty_bento.jpeg" alt="empty_bento" class="empty_bento" sizes="(max-width: 740px) 100vw, 740px">';

    echo $html . '</p></div>';
    echo do_shortcode( '[woo_product_slider id="2994"]' );
}

The first part is working but then the shortcode slider is not rendered, i have an infinite loading wheel.
If i manually refresh the page a second time, everything loads correctly and works.
How can i successfully render the shortcode on first page reload ?

“personal access” and “password grant” clients table not being created when I run “php artisan passport:install”

When I run “php artisan passport:install” and it gets to the part that it asks ” Would you like to create the “personal access” and “password grant” clients? (yes/no)” and I proceed with “yes”, I get the error below when the tables are being. P.S. I am running laravel-11.0.8.

IlluminateDatabaseQueryException

SQLSTATE[01000]: Warning: 1265 Data truncated for column ‘id’ at row 1 (Connection: mysql, SQL: insert into oauth_clients (user_id, name, secret, provider, redirect, personal_access_client, password_client, revoked, id, updated_at, created_at) values (?, Project Personal Access Client, uEEJLJEJWLEEjn7HUsXOWjakEjO2bPBcH1mHKHDK, ?, http://localhost, 1, 0, 0, 9bca8777-9713-4a42-9aa7-7089781971212, 2024-04-12 17:03:25, 2024-04-12 17:03:25))

I was expecting the tables to be created successfully and the Client ID and Client secret created.

Failed opening required ‘PHPMailerAutoload.php’ [duplicate]

enter image description here

Uncaught Error: Failed opening required ‘PHPMailerAutoload.php’
Warning: require(PHPMailerAutoload.php): Failed to open stream:

I am trying to send an email using PHP, whenever I want to send an email but the email is not sent through and I think it is because the composer is not installed.

I want my site to send a student email after registration.

<?php
require 'PHPMailer/PHPMailer/PHPMailerAutoload.php';
require 'PHPMailer/PHPMailer/class.smtp.php';
require 'PHPMailer/PHPMailer/class.phpmailer.php';

use PHPMailerPHPMailerPHPMailer;

include('database/config.php');

if (isset($_POST['submit'])) {
    $FirstName = $_POST['FirstName'];
    $LastName = $_POST['LastName'];
    $Gender = $_POST['Program'];
    $Email = $_POST['Email'];
    $Subject1 = $_POST['Subject1'];
    $Subject2 = $_POST['Subject2'];
    $Address = $_POST['Address'];
    $ContactNum = $_POST['ContactNum'];
    $Password = $_POST['password'];

    $hashed_password = password_hash($Password, PASSWORD_DEFAULT);
    $reference = $_POST['reference'];
    $proof = $_FILES['proof']['name'];
    $tmp_name = $_FILES['proof']['tmp_name'];
    $target_dir = "uploads/";
    $target_file = $target_dir . basename($proof);

    if (move_uploaded_file($tmp_name, $target_file)) {
        $Actions = "Pending";

        $checkQuery = "SELECT COUNT(*) as count FROM Students WHERE Email = '$Email'";
        $result = $conn->query($checkQuery);
        $row = $result->fetch_assoc();
        if ($row['count'] > 0) {
            // Email already exists, display error message or take appropriate action
        } else {
            $sql = "INSERT INTO Students (FirstName, LastName, Subject1, Subject2, Email, Address, ContactNum, Password,Actions,reference,proof) VALUES ('$FirstName', '$LastName', '$Subject1', '$Subject2', '$Email', '$Address', '$ContactNum', '$hashed_password', '$Actions','$reference', '$proof')";

            if ($conn->query($sql) === TRUE) {
                // Send email
                $mail = new PHPMailer(true);
                try {
                    //Server settings
                    $mail->isSMTP();                                      // Set mailer to use SMTP
                    $mail->Host = 'smtp.example.com';                     // Specify main and backup SMTP servers
                    $mail->SMTPAuth = true;                               // Enable SMTP authentication
                    $mail->Username = '[email protected]';           // SMTP username
                    $mail->Password = '*********';              // SMTP password
                    $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
                    $mail->Port = 587;                                    // TCP port to connect to

                    //Recipients
                    $mail->setFrom('[email protected]', 'DSI TUTORING');
                    $mail->addAddress($Email, $FirstName . ' ' . $LastName);     // Add a recipient

                    // Content
                    $mail->isHTML(true);                                  // Set email format to HTML
                    $mail->Subject = 'Registration Confirmation';
                    $mail->Body = 'Dear ' . $FirstName . ',<br><br>Thank you for registering. Your registration is pending approval.<br><br>Best regards,<br>Your Organization';

                    if ($mail->send()) {
                        // Redirect to thank you page
                        $_SESSION['user_id'] = $conn->insert_id;
                        header("Location: thank_you.php");
                        exit;
                    }
                } catch (Exception $e) {
                    echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
                }
            } else {
                echo "Error: " . $sql . "<br>" . $conn->error;
            }
        }

        $conn->close();
    }
}
?>