Database Problem: “The page isnt working, if the problem continues, contact the site owner.” [closed]

I created a database in phpmyadmin,
I wrote PHP code in connect.php,
I wrote code in signin.html,
I connected them all together.
But still, it does not work.

Here is my signin.html code:

<form method="post" action="connect.php">
<label>First Name...</label>
<input type="text" placeholder="" id="firstName" name="firstName">
<label>Last Name...</label>
<input type="text" placeholder="" id="lastName" name="lastName">
<label>Email</label>
<input type="email" placeholder="" id="email" name="email">
<label>Password...</label>
<input type="password" placeholder="" id="password" name="password">
<label>Comfirm Password...</label>
<input type="password" placeholder="">
<input type="submit" value="Submit" name="btn btn-primary">
</form>

Here is my connect.php code:

    <?php
$firstName = filter_input(INPUT_POST, 'firstName');
$lastName = filter_input(INPUT_POST, 'lastName');
$email = filter_input(INPUT_POST, 'email');
$password = filter_input(INPUT_POST, 'password');
if (!empty($firstName)){
if (!empty($lastName)){
if (!empty($email)){
if (!empty($password)){
$host = "localhost";
$dbusername = "root"; 



$dbpassword = "";
$dbname = "accounts";
// Create connection
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_error() .') '
. mysqli_connect_error());
}
else{
$sql = "INSERT INTO registration (firstName, lastName, email, password)
values ('$firstName', '$lastName', '$email', '$password')";
if ($conn->query($sql))}
echo "New record is inserted sucessfully";
}
else{
echo "Error: ".$sql . "<br>". $conn->error;
}
$conn->close();
}
}
else{
echo "Password should not be empty";
die();
}
}
else{
echo "Username should not be empty"
die();
}
?>

I have watched countless of videos of this problem,
but nothing seems to explain the problem.
I know really little about PHP and databases in general.

Thank you for reading through,
I hope you can help.
If you need more information, please contact me.

Next semantic version php (laravel)

Hi I would like to update a semantic version number using php for a three digit system in string form.
An example :

'1.0.0' => function => '1.0.1'
'1.0.12' => function => '1.0.13'

Does anyone know a solution to this problem?
Thanks in advance

Upgrade from Symfony 3.4 to 4 : Errors when upgrading symfony

I try to upgrade my Symfony 3.4 project to Symfony 4. I cleaned my project of all deprecations but now when I want to upgrade, I have theses issues and I don’t know how to do.

COMPOSER_MEMORY_LIMIT=-1 composer update “symfony/*”
–with-all-dependencies Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is
deprecated and some packages will not be available. You should upgrade
to Composer 2. See
https://blog.packagist.com/deprecating-composer-1-support/ Updating
dependencies (including require-dev) Your requirements could not be
resolved to an installable set of packages.

Problem 1
– symfony/options-resolver v6.0.0 requires php >=8.0.2 -> your PHP version (7.2.14) does not satisfy that requirement.
– Conclusion: don’t install symfony/symfony v4.4.35
– Conclusion: don’t install symfony/symfony v4.4.34
– Conclusion: don’t install symfony/symfony v4.4.33
– Conclusion: don’t install symfony/symfony v4.4.32
– Conclusion: don’t install symfony/symfony v4.4.31
– Conclusion: don’t install symfony/symfony v4.4.30
– Conclusion: don’t install symfony/symfony v4.4.29
– Conclusion: don’t install symfony/symfony v4.4.28
– Conclusion: don’t install symfony/symfony v4.4.27
– Conclusion: don’t install symfony/symfony v4.4.26
– Conclusion: don’t install symfony/symfony v4.4.25
– Conclusion: don’t install symfony/symfony v4.4.24
– Conclusion: don’t install symfony/symfony v4.4.23
– Conclusion: don’t install symfony/symfony v4.4.22
– Conclusion: don’t install symfony/symfony v4.4.21
– Conclusion: don’t install symfony/symfony v4.4.20
– Conclusion: don’t install symfony/symfony v4.4.19
– Conclusion: don’t install symfony/symfony v4.4.18
– Conclusion: don’t install symfony/symfony v4.4.17
– Conclusion: don’t install symfony/symfony v4.4.16
– Conclusion: don’t install symfony/symfony v4.4.15
– Conclusion: don’t install symfony/symfony v4.4.14
– Conclusion: don’t install symfony/symfony v4.4.13
– Conclusion: don’t install symfony/symfony v4.4.12
– Conclusion: don’t install symfony/symfony v4.4.11
– Conclusion: don’t install symfony/symfony v4.4.10
– Conclusion: don’t install symfony/symfony v4.4.9
– Conclusion: don’t install symfony/symfony v4.4.8
– Conclusion: don’t install symfony/symfony v4.4.7
– Conclusion: don’t install symfony/symfony v4.4.6
– Conclusion: don’t install symfony/symfony v4.4.5
– Conclusion: don’t install symfony/symfony v4.4.4
– Conclusion: don’t install symfony/symfony v4.4.3
– Conclusion: don’t install symfony/symfony v4.4.2
– Conclusion: don’t install symfony/symfony v4.4.1
– Conclusion: don’t install symfony/symfony v4.4.0
– Conclusion: remove liip/imagine-bundle 2.7.3
– Conclusion: don’t install symfony/symfony v4.3.11
– Conclusion: don’t install symfony/symfony v4.3.10
– Conclusion: don’t install symfony/symfony v4.3.9
– Conclusion: don’t install symfony/symfony v4.3.8
– Conclusion: don’t install symfony/symfony v4.3.7
– Conclusion: don’t install symfony/symfony v4.3.6
– Conclusion: don’t install symfony/symfony v4.3.5
– Conclusion: don’t install symfony/symfony v4.3.4
– Conclusion: don’t install symfony/symfony v4.3.3
– Conclusion: don’t install symfony/symfony v4.3.2
– Conclusion: don’t install symfony/symfony v4.3.1
– Conclusion: don’t install symfony/symfony v4.3.0
– Conclusion: don’t install symfony/symfony v4.2.12
– Conclusion: don’t install symfony/symfony v4.2.11
– Conclusion: don’t install symfony/symfony v4.2.10
– Conclusion: don’t install symfony/symfony v4.2.9
– Conclusion: don’t install symfony/symfony v4.2.8
– Conclusion: don’t install symfony/symfony v4.2.7
– Conclusion: don’t install symfony/symfony v4.2.6
– Conclusion: don’t install symfony/symfony v4.2.5
– Conclusion: don’t install symfony/symfony v4.2.4
– Conclusion: don’t install symfony/symfony v4.2.3
– Conclusion: don’t install symfony/symfony v4.2.2
– Conclusion: don’t install symfony/symfony v4.2.1
– Conclusion: don’t install symfony/symfony v4.2.0
– Conclusion: don’t install symfony/symfony v4.1.13
– Conclusion: don’t install symfony/symfony v4.1.12
– Conclusion: don’t install symfony/symfony v4.1.11
– Conclusion: don’t install symfony/symfony v4.1.10
– Conclusion: don’t install symfony/symfony v4.1.9
– Conclusion: don’t install symfony/symfony v4.1.8
– Conclusion: don’t install symfony/symfony v4.1.7
– Conclusion: don’t install symfony/symfony v4.1.6
– Conclusion: don’t install symfony/symfony v4.1.5
– Conclusion: don’t install symfony/symfony v4.1.4
– Conclusion: don’t install symfony/symfony v4.1.3
– Conclusion: don’t install symfony/symfony v4.1.2
– Conclusion: don’t install symfony/symfony v4.1.1
– Conclusion: don’t install symfony/symfony v4.1.0
– Conclusion: don’t install symfony/symfony v4.0.15
– Conclusion: don’t install symfony/symfony v4.0.14
– Conclusion: don’t install symfony/symfony v4.0.13
– Conclusion: don’t install symfony/symfony v4.0.12
– Conclusion: don’t install symfony/symfony v4.0.11
– Conclusion: don’t install symfony/symfony v4.0.10
– Conclusion: don’t install symfony/symfony v4.0.9
– Conclusion: don’t install symfony/symfony v4.0.8
– Conclusion: don’t install symfony/symfony v4.0.7
– Conclusion: don’t install symfony/symfony v4.0.6
– Conclusion: don’t install symfony/symfony v4.0.5
– Conclusion: don’t install symfony/symfony v4.0.4
– Conclusion: don’t install symfony/symfony v4.0.3
– Conclusion: don’t install symfony/symfony v4.0.2
– Installation request for kriswallsmith/assetic (installed at v1.4.0) -> satisfiable by kriswallsmith/assetic[v1.4.0].
– Installation request for liip/imagine-bundle (installed at 2.7.3, required as ^2.7) -> satisfiable by liip/imagine-bundle[2.7.3].
– Conclusion: don’t install symfony/symfony v4.0.1
– liip/imagine-bundle 2.7.3 requires symfony/options-resolver ^3.4|^4.4|^5.3|^6.0 -> satisfiable by symfony/symfony[v3.4.49, v4.4.0,
v4.4.1, v4.4.10, v4.4.11, v4.4.12, v4.4.13, v4.4.14, v4.4.15, v4.4.16,
v4.4.17, v4.4.18, v4.4.19, v4.4.2, v4.4.20, v4.4.21, v4.4.22, v4.4.23,
v4.4.24, v4.4.25, v4.4.26, v4.4.27, v4.4.28, v4.4.29, v4.4.3, v4.4.30,
v4.4.31, v4.4.32, v4.4.33, v4.4.34, v4.4.35, v4.4.4, v4.4.5, v4.4.6,
v4.4.7, v4.4.8, v4.4.9], symfony/options-resolver[v3.4.0, v3.4.1,
v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.16,
v3.4.17, v3.4.18, v3.4.19, v3.4.2, v3.4.20, v3.4.21, v3.4.22, v3.4.23,
v3.4.24, v3.4.25, v3.4.26, v3.4.27, v3.4.28, v3.4.29, v3.4.3, v3.4.30,
v3.4.31, v3.4.32, v3.4.33, v3.4.34, v3.4.35, v3.4.36, v3.4.37,
v3.4.38, v3.4.39, v3.4.4, v3.4.40, v3.4.41, v3.4.42, v3.4.43, v3.4.44,
v3.4.45, v3.4.46, v3.4.47, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9,
v4.4.0, v4.4.1, v4.4.10, v4.4.11, v4.4.12, v4.4.13, v4.4.14, v4.4.15,
v4.4.16, v4.4.17, v4.4.18, v4.4.19, v4.4.2, v4.4.20, v4.4.25, v4.4.27,
v4.4.3, v4.4.30, v4.4.4, v4.4.5, v4.4.6, v4.4.7, v4.4.8, v4.4.9,
v5.3.0, v5.3.4, v5.3.7, v5.4.0, v6.0.0].
– Can only install one of: symfony/symfony[v4.0.0, v3.4.49].
– don’t install symfony/options-resolver v3.4.0|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.1|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.10|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.11|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.12|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.13|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.14|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.15|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.16|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.17|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.18|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.19|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.2|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.20|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.21|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.22|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.23|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.24|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.25|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.26|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.27|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.28|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.29|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.3|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.30|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.31|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.32|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.33|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.34|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.35|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.36|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.37|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.38|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.39|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.4|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.40|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.41|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.42|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.43|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.44|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.45|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.46|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.47|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.5|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.6|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.7|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.8|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v3.4.9|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.0|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.1|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.10|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.11|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.12|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.13|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.14|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.15|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.16|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.17|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.18|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.19|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.2|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.20|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.25|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.27|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.3|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.30|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.4|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.5|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.6|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.7|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.8|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v4.4.9|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v5.3.0|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v5.3.4|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v5.3.7|don’t install symfony/symfony v4.0.0
– don’t install symfony/options-resolver v5.4.0|don’t install symfony/symfony v4.0.0
– Installation request for symfony/symfony ^4 -> satisfiable by symfony/symfony[v4.0.0, v4.0.1, v4.0.10, v4.0.11, v4.0.12, v4.0.13,
v4.0.14, v4.0.15, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7,
v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13,
v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9,
v4.2.0, v4.2.1, v4.2.10, v4.2.11, v4.2.12, v4.2.2, v4.2.3, v4.2.4,
v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.3.0, v4.3.1, v4.3.10,
v4.3.11, v4.3.2, v4.3.3, v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8,
v4.3.9, v4.4.0, v4.4.1, v4.4.10, v4.4.11, v4.4.12, v4.4.13, v4.4.14,
v4.4.15, v4.4.16, v4.4.17, v4.4.18, v4.4.19, v4.4.2, v4.4.20, v4.4.21,
v4.4.22, v4.4.23, v4.4.24, v4.4.25, v4.4.26, v4.4.27, v4.4.28,
v4.4.29, v4.4.3, v4.4.30, v4.4.31, v4.4.32, v4.4.33, v4.4.34, v4.4.35,
v4.4.4, v4.4.5, v4.4.6, v4.4.7, v4.4.8, v4.4.9].

Here is my composer.json :

{
    "name": "beyonds/base",
    "license": "Beyonds",
    "type": "project",
    "autoload": {
        "psr-4": {
            "AppBundle\": "src/AppBundle"
        },
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        },
        "files": [
            "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
        ]
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "[email protected]:alexandre.bru/admin-generator-bundle.git"
        }
    ],
    "require": {
        "php": "^5.5.9|>=7.0.8",
        "algolia/search-bundle": "4.0.0",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/inflector": "^1.4|^2.0",
        "doctrine/orm": "^2.7",
        "excelwebzone/recaptcha-bundle": "^1.5",
        "friendsofsymfony/ckeditor-bundle": "^2",
        "friendsofsymfony/jsrouting-bundle": "^2.2",
        "friendsofsymfony/user-bundle": "~2.0",
        "helios-ag/fm-elfinder-bundle": "^9.3",
        "incenteev/composer-parameter-handler": "^2.0",
        "lexik/translation-bundle": "^4.0",
        "liip/imagine-bundle": "^2.7",
        "nochso/html-compress-twig": "^2.0",
        "sensio/framework-extra-bundle": "^5.4",
        "stof/doctrine-extensions-bundle": "^1.3",
        "symfony/monolog-bundle": "^3.6.0",
        "symfony/polyfill-apcu": "^1.23",
        "symfony/swiftmailer-bundle": "^3.3",
        "symfony/symfony": "^4",
        "thormeier/breadcrumb-bundle": "^2.2",
        "twig/extensions": "^1.2",
        "twig/twig": "^1.0||^2.0",
        "vich/uploader-bundle": "^1.4"
    },
    "require-dev": {
        "beyonds/cms-generator-bundle": "dev-master",
        "doctrine/doctrine-fixtures-bundle": "^3.4",
        "symfony/phpunit-bridge": "^6.0"
    },
    "scripts": {
        "symfony-scripts": [
            "Incenteev\ParameterHandler\ScriptHandler::buildParameters"
        ],
        "post-install-cmd": [
            "@symfony-scripts"
        ],
        "post-update-cmd": [
            "@symfony-scripts"
        ]
    },
    "config": {
        "sort-packages": true,
        "component-dir": "web/assets"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": null,
        "symfony": {
            "allow-contrib": "true"
        }
    }
}

unable to connect codeigniter to firebase.how to do the configuration and write the model to insert and update data?

** this is my config/firebase.php file**
<?php

class firebase{

    
    public function  __construct($config = array())
    {
       
        
        $config['firebase_app_key'] = __DIR__ . '/../config/gfgh-6bbd-firebase-adminsdk-fivu8-11536116hw5.json';
    }

}
?>
   
**this is my model**

<?php
require '/vendor/autoload.php';
use KreaitFirebaseFactory;

class Login_model extends CI_Model
{

    public function __construct()
    {
        parent::__construct();
        $factory = (new Factory())
        ->withServiceAccount('gfgh-6bbd-firebase-adminsdk-fivu8-11536116hw5.json')
        ->createFirestore();
        $this->db = $factory->database();
    }

function get_data()
    {
        $document = $this->db->get();
        return $document;
    }
}

** i want to insert and update data in firebase **

i am gettingthis error- Your C:xampphtdocssolverapplicationconfig/firebase.php file does not appear to contain a valid configuration array.

Web Push Panel Post URL Redirection

I do not know much about coding, but recently I got a self-hosted web-push panel made for my website by a developer, he also gave a plugin for my WordPress website. The admin panel works fine, there is something wrong with it, maybe he didn’t fix it on purpose

Like when I send a notification of a post from my WordPress website, the notification goes but when the subscriber clicks on that post, it gets redirected to a different URL when I checked the files of the panel, I found a file called link.php

There is a code in that file in which that Redirect URL is set as if I set that URL to google.com, then after clicking on my post, the user landed on google.com and not on my post and the developer did the same With many things, I was given a script like unlimited subscribers, but the notification goes to only 10k people.

Now I am not having any contact with that developer so how can I fix this redirection problem please give any suggestion

link.php code

<?php

const BASE_PATH = __DIR__;
require_once BASE_PATH.'/system/init.php';

$linkId = (isset($_GET['linkId']) && !empty(trim($_GET['linkId'])))? SQLSecure(base64_decode($_GET['linkId'])) : '0';

$linkQuery = $DB->query("SELECT * FROM `links` WHERE `id`='{$linkId}'");
if($linkQuery->num_rows > 0){
    $LinkData = $linkQuery->fetch_assoc();
    $DB->query("UPDATE `links` SET `clicks`=`clicks`+1 WHERE `id` = '{$LinkData['id']}'");
    redirect($LinkData['full_link']);
}
redirect('https://google.com');

?> 

the other file code, mentioned in the link.php file system/init.php

<?php

ini_set('max_execution_time', 0);
ini_set('session.cookie_httponly',1);
ini_set('session.use_only_cookies',1);
ini_set('session.cookie_secure', 1);
ini_set('session.cookie_samesite', 'Strict');
session_start();

require_once BASE_PATH.'/config.php';
require_once __DIR__.'/core/database.php';
require_once __DIR__.'/core/functions.php';
require_once __DIR__.'/core/app-start.php';  

How can i get the data from database which is stored as md5 file using php

so i have been trying for a while to get the data which is password in my database which i stored using md5 function.Now what i am trying to do is,i am asking user to enter id and password then if they click the button i send that data to function.

I also change the user’s input as a md5 file to match the one in the database if it is true.

For example if user entered “hello” as password i change it with md5 file using $abc = md5($aramasonucu2);

However i can’t make this happen for some reason and would really appriciate some help.

  function func1()
                {

                    $servername = "127.0.0.1";
                    $username = "root";
                    $password="";
                    $database = "customer_list";
                    $port = 3306;
                    $con = mysqli_connect($servername,$username,$password, $database, $port);

                    $aramasonucu = $_POST['uname'];
                    $aramasonucu2 = $_POST['psw']; //user input as password
                    $abc =  md5($aramasonucu2); //user input translated to md5


                    $sql="SELECT * FROM customer_list WHERE ad_soyad  LIKE '%$aramasonucu%' AND  sifre = '$abc'";
                    $result=$con->query($sql);


                    if ($abc="ab4b5f7503")
                    {


                        ?>
                        <html>
                        <head>
                            <style>
                                table {
                                  border-collapse: collapse;
                                  width: 180%;
                              }

                              th, td {
                                  padding: 12px;
                                  text-align: left;
                                  border-bottom: 2px solid #DDD;
                              }

                              tr:hover {background-color: lightblue;}
                          </style>
                      </head>



                      <?php



                      if($row=$result->fetch_assoc())
                      {
                        echo "<table>";
                        echo "<tr>";
                        echo "<th>Ad ve Soyad</th>";  
                        echo "<th>Telefon</th>";
                        echo "<th>E-Posta</th>";
                        echo "<th>Cari Kart Kodu</th>";
                        echo "<th>Olusturma Tarihi</th>";
                        echo "<th>Guncelleme Tarihi</th>";
                        echo "</tr>";
                        echo "<tr>";
                        echo "<td> $row[ad_soyad]</td>";
                        echo "<td> $row[telefon]</td>";
                        echo "<td> $row[e_posta]</td>";
                        echo "<td> $row[cari_kart_kodu]</td>";
                        echo "<td> $row[olusturma_tarihi]</td>";
                        echo "<td> $row[guncelleme_tarihi]</td>";
                        echo "</tr>";


                    }  

                    else 
                    {
                        echo "Wrong Password!";
                    }  

                }
            }

How to add fields to Blog Page/index.php by Carbon Fields

I am trying to add fields to Blog Page/index.php by Carbon Fields but its not working

carbon.php

Container::make( 'post_meta', __( 'Blog Page Settings','carbon' ) )
        ->where( 'post_template', '=', 'index.php' )

        ->add_tab( __( 'Page Header Section','carbon' ), array(
            Field::make( 'text', 'blog_page_header_title', __( 'Title','carbon' ) )->set_width( 100 ),
            Field::make( 'text', 'blog_page_header_sub_title', __( 'Sub Title','carbon' ) )->set_width( 100 ),
        ) );

index.php

<h4><?php echo esc_html(carbon_get_the_post_meta('blog_page_header_title')); ?></h4>
<h1><?php echo esc_html(carbon_get_the_post_meta('blog_page_header_sub_title')); ?></h1>

Edit Excel Cells then download it with keeping the sheet styles

I have an Excel file that is stored in my server with some Dynamic Data. I want to Edit the Data in The Sheet then Download the Excel with Keeping the sheet format .
I am Already Editing the Data in Excel but I can’t keep the original style of the Sheet.
i am using maatwebsite/excel package with Laravel 8.

my controller code:

        public function generateArtisanalFile(Request $request){
                $lins=new ArtisanalImport();
                $data= Excel::import($lins,public_path('storage/delivered/CI-model.xlsx'));

                $export = new AsrisanalFileGenerator($lins->data);
                return Excel::download($export, 'model.xlsx');
}

The Import Class :

class ArtisanalImport implements ToCollection
  {

    public $data;

    public function collection(Collection $rows)
    {
       $rows[7][1]='karim El Hajjami';
       $rows[3][0]='Delivered';
       $this->data=$rows;
 
     }
   }

this is the Export Class:

class AsrisanalFileGenerator implements FromCollection
 {
   public $data;

   public function __construct($data){
    $this->data=$data;
  
   }

   public function collection()
   {
      return $this->data;
   }

 }

Why create function in RegisterController is not working in laravel

I am new to Laravel. I am using registerController in Laravel to create users . Users data are stored in Users table.

What I have tried is :

    @extends('adminlte::auth.auth-page', ['auth_type' => 'register'])
    
    @php( $login_url = View::getSection('login_url') ?? config('adminlte.login_url', 'login') )
    @php( $register_url = View::getSection('register_url') ?? config('adminlte.register_url', 'register') )
    
    @if (config('adminlte.use_route_url', false))
        @php( $login_url = $login_url ? route($login_url) : '' )
        @php( $register_url = $register_url ? route($register_url) : '' )
    @else
        @php( $login_url = $login_url ? url($login_url) : '' )
        @php( $register_url = $register_url ? url($register_url) : '' )
    @endif
    
    @section('auth_header', __('adminlte::adminlte.register_message'))
    
    @section('auth_body')<!-- comment -->
    <?php $roles = DB::table('roles')->where('id','>',1)->get(); ?>
    <div class="login-form">
        <div class="container">
            <div class="row ">
                <div class="register-box">
                    <div class="register-box-header">
                        <p class="login-box-msg">{{!empty($type) && $type == 'Agronamist' ? 'Buyer' : ''}} REGISTRATION FORM</p>
                    </div>
                    <div class="register-box-body register_body">
                        <form method="POST" action="{{ route('register') }}" class="registerForm" enctype="multipart/form-data">
                            @csrf
                            @if(empty($type))
                            <div class="row">
                                <div class="col-md-12 text-center">
                                    <div class="form-group has-feedback">
                                        <select name="role" class="form-control" onchange='window.location.href=window.location.origin+"/register?role="+$(this).val();' required>
                                            <option value="">Select a Role</option>
                                            @foreach($roles as $role)                                           
                                              <option value="{{$role->id}}" {{(count($_GET)>0 && $_GET['role'] == $role->id) ? 'selected' : ''}}>{{$role->name}}  </option>
                                              @endforeach
                                        </select>
                                    </div>
                                </div>
                            </div>
                            @else
                            <input type="hidden" name="role" value="2">
                            <input type="hidden" name="type" value="{{$type}}">
                            @endif
                            @if(count($_GET)>0 && $_GET['role'] != '')
                                <?php $states = DB::table('states')->orderBy('name','asc')->get();?>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group has-feedback">
                                            <input type="text" class="form-control" placeholder="First Name *" name="first_name" value="{{ old('first_name') }}" required>
                                            <span class="glyphicon glyphicon-user form-control-feedback"></span>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group has-feedback">
                                            <input type="text" class="form-control" placeholder="Last Name *" name="last_name" value="{{ old('last_name') }}" required>
                                            <span class="glyphicon glyphicon-user form-control-feedback"></span>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group has-feedback">
                                            <input type="email" class="form-control" name="email" value="{{ old('email') }}" placeholder="Email *" required>
                                            <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group has-feedback">
                                            <input type="text" class="form-control phoneMask" placeholder="Phone *" name="phone" value="{{ old('phone') }}" required>
                                            <span class="glyphicon glyphicon-phone form-control-feedback"></span>
                                        </div>
                                    </div>
    <div class="col-md-6">
                                        <div class="form-group has-feedback">
                                            <input type="text" class="form-control" placeholder="Address *" name="address" value="{{ old('address') }}" required>
                                            <span class="glyphicon glyphicon-map-marker form-control-feedback"></span>
                                        </div>
                                    </div>
     <div class="col-md-6">
                                        <div class="form-group has-feedback">
                                            <input type="password" class="form-control @error('password') is-invalid @enderror" name="password" placeholder="Password *" required autocomplete="new-password">
                                            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                                            @error('password')
                                                <span class="invalid-feedback" role="alert">
                                                    <strong>{{ $message }}</strong>
                                                </span>
                                            @enderror
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group has-feedback">
                                            <input type="password" class="form-control" name="password_confirmation" placeholder="Retype password *" required autocomplete="new-password">
                                            <span class="glyphicon glyphicon-log-in form-control-feedback"></span>
                                        </div>
                                    </div>
 <div class="row">
                                <div class="col-md-3 col-xs-offset-4 submit_btn">
                                  <button type="submit" class="btn btn-primary btn-block btn-flat">Register</button>
                                </div>
                            </div>
</form>


Register Controller
<?php

namespace AppHttpControllersAuth;

use IlluminateHttpRequest;
use IlluminateAuthEventsRegistered;
use AppHttpControllersController;
use IlluminateDatabaseEloquentBuilder;
use AppUser,AppUserDetails,AppUserRoles,AppUserAddresses, Appmanager_group;
use IlluminateFoundationAuthRegistersUsers;
use IlluminateSupportFacadesHash;
use IlluminateSupportFacadesValidator;
use CarbonCarbon;
use Auth;
use DB;
class RegisterController extends Controller
{
    

    use RegistersUsers;

    
    protected $redirectTo = '/';

    
    public function __construct()
    {
        //$this->middleware('guest');
    }

    
    public function register(Request $request){       
        
       
        
        $this->validator($request->all())->validate();
       // dd($this->validator($request->all())->validate());
                event(new Registered($user = $this->create($request->all())));
              
                if(array_key_exists('type', $request->all())){
                   
                    return $this->registered($request, $user) ? : redirect('/buyersList/'.Auth::user()->id)->with('success','Registered successfully.');
                }else{
                  
                    return $this->registered($request, $user) ? : redirect($this->redirectPath())->with('success','Registered successfully. Please wait for the approval to access your account.');
                }
    }
      
                //$this->guard()->login($user);
    

    protected function validator(array $data)
    {
       
        return Validator::make($data, [
            'first_name' => ['required', 'string', 'max:255'],
            'last_name' => ['required', 'string', 'max:255'],
            'phone' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 
            'password' => ['required', 'string', 'min:8', 'confirmed'],
        ]);
            }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return AppUser
     */
    protected function create(array $data)
    {
         $user = User::create([
            'first_name' => $data['first_name'],
            'last_name' => $data['last_name'],
            'phone' => $data['phone'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);
        
        
       
}
}

My data is not inserting to users table,and the create function is not working when I dd($user) it. How to make my code working. What my page shows when I try to submit data is :

Output

PHP Regex – Delete classes in HTML Tag

I have multiple HTML/CSS sites where I have classes added automatically due to a bug in an earlier version. Therefore my HTML files look currently like this:

<html class=" js cssanimations gecko win js js cssanimations gecko win js js cssanimations gecko win js js cssanimations gecko win js js cssanimations gecko win js js cssanimations gecko win js lang=de><head>

or like this:

<html class=" js cssanimations webkit chrome win js js cssanimations gecko win js js cssanimations webkit chrome win js js cssanimations gecko win js js cssanimations gecko win js js cssanimations gecko win js" lang="de"><head>

So those “phrases” are repeating:

 js cssanimations gecko win js 

or:

 js cssanimations webkit chrome win js 

I would like to write a regex in PHP where I replace those classes with an empty string. Here is what I´ve tried so far but it is not working at all:

private $replaceRegexes = [
    'html-class-attributes' => [
        'regex' => '/<html.*class=".*".*>/',
        'replacement' => '<html lang="de">',
    ]
];

But /<html.*class=".*".*>/ is not working.
Can someone help me out and let me know the correct regex for deleting the classes inside the <html tag?

Would appreciate any help.

Thanks,
Chris

php append pdf to pdf and check the page template first

i have a form where people can upload pdfs

with fpdf I append those pdf and generate a new one.
this works ok, unless someone uploads a vertical aligned pdf.
is there a way I can determine which alignment a pdf has?
this is my code to append:

/* APPEND PDFs */
    $files = [];
    array_push($files, $upload_folder . '/' . $pdf_name);
    if($new_path != 0 & $ext == 'pdf'){
        array_push($files, $new_path);
    }
    if($new_path1 != 0  & $ext1 == 'pdf'){
        array_push($files, $new_path1);
    }
    if($new_path2 != 0  & $ext2 == 'pdf'){
        array_push($files, $new_path2);
    }
    if($new_path3 != 0  & $ext3 == 'pdf'){
        array_push($files, $new_path3);
    }
    if($new_path4 != 0  & $ext4 == 'pdf'){
        array_push($files, $new_path4);
    }
    if($new_path5 != 0 & $ext5 == 'pdf'){
        array_push($files, $new_path5);
    }
    if($new_path6 != 0  & $ext6 == 'pdf'){
        array_push($files, $new_path6);
    }

pdf = new setasignFpdiFpdi();

// iterate over array of files and merge
foreach ($files as $file) {
    $pageCount = $pdf->setSourceFile($file);
    for ($i = 0; $i < $pageCount; $i++) {
        $tpl = $pdf->importPage($i + 1, '/MediaBox');
        $pdf->addPage();
        $pdf->useTemplate($tpl);
    }
}

// output the pdf as a file (http://www.fpdf.org/en/doc/output.htm)
$pdf->Output('F',$upload_folder . '/' . $pdf_name);

thanks a lot

shortcode for product tags description in WooCommerce

I am looking for a way to call the product tags description as a shortcode which could then be added in page builder like elementor. hope to get help here to solve my problem.

I found this snippet but it shows on shop page not on product tag pages

add_action( 'woocommerce_after_shop_loop_item', woocommerce_product_loop_tags', 5 );

function woocommerce_product_loop_tags() {

global $post, $product;

$tag_count = sizeof( get_the_terms( $post->ID, 'product_tag' ) );

echo $product->get_tags( ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', $tag_count, 'woocommerce' ) . ' ', '.</span>' );
}

Foreign keys not saved when trying to store data Laravel 8

I am trying to store store an author and genre into a Book. The way I’m trying to achieve this is by having an Author table, Genre table and a Book table. I want to store the foreign key for the author and genre into the books table.

I have created a form to store the needed information for the book. Within the form, there are two select tags and within them I loop through the authors and genres array. I use a store function in my BookController to validate the data that is being sent. After the validation, I store a new Book.

However, the foreign keys are not being stored in the database except for the primary key, title, blurb and timestamps.

Book Model

class Book extends Model
{
    use HasFactory;

    protected $fillable = [
        'author_id',
        'genre_id',
        'title',
        'blurb',
    ];

    public function authors()
    {
        return $this->BelongsTo(Author::class);
    }

    public function genres()
    {
        return $this->BelongsTo(Genre::class);
    }
}

Author Model

class Author extends Model
{
    use HasFactory;

    protected $fillable = [
      'name',
    ];

    public function book()
    {
        return $this->hasMany(Book::class);
    }
}

Genre Model

class Genre extends Model
{
    use HasFactory;

    protected $fillable = [
        'title'
    ];

    public function book()
    {
        return $this->hasMany(Book::class);
    }
}

BookController create()

    public function create()
    {
        $authors = Author::all();
        $genres = Genre::all();

        return view('admin.book.create', ['authors' => $authors, 'genres' => $genres]);
    }

BookController store()

    public function store(Request $request)
    {
        $validatedData = $request->validate([
            'title' => 'required|max:255',
            'authors' => 'required|array',
            'genres' => 'required|array',
            'blurb' => 'required',
        ]);

        Book::create($validatedData);

        return redirect()->route('admin.book.create');
    }

Books table migration

    public function up()
    {
        Schema::create('books', function (Blueprint $table) {
            $table->id();
            $table->foreignId('author_id');
            $table->foreignId('genre_id');
            $table->string('title');
            $table->string('blurb');
            $table->timestamps();
        });
    }

create.blade.php (create Book page)

    <div class="flex justify-center">
        <div class="flex justify-center border lg:w-1/4">
            <div class="flex flex-col justify-center lg:w-2/4 gap-2">
                <form action="{{ route('admin.book.store') }}" method="post">
                    @csrf
                    <div class="mb-2">
                        <h1 class="text-xl">Add Book</h1>
                    </div>
                    <div>
                        <label class="" for="title">Title</label>
                        <input name="title" class="w-10 border border-gray-400 w-full py-1 px-2" type="text">
                    </div>
                    <div>
                        <label class="" for="author">Author</label>
                        <select name="authors[]">
                            @foreach($authors as $author)
                                <option value="{{ $author->id }}">{{ $author->name }}</option>
                            @endforeach
                        </select>
                    </div>
                    <div>
                        <label class="" for="genre">Genre</label>
                        <select name="genres[]">
                            @foreach($genres as $genre)
                                <option value="{{ $genre->id }}">{{ $genre->title }}</option>
                            @endforeach
                        </select>
                    </div>
                    <div>
                        <label class="" for="blurb">Blurb</label>
                        <textarea name="blurb" id="" cols="18" rows="10"></textarea>
                    </div>
                    <div>
                        <button class="py-2 px-4 border" type="submit">Save</button>
                    </div>
                </form>
            </div>

        </div>
    </div>