Why are my Symfony Router are not Working?

I am currently creating a Symfony Project for School and i was just trying some things out with this Security Bundle… I was creating the Registration Controller with this php bin/console make:registration-form Command and it worked out fine. The Files got created and i got no Errors but when i am trying to go to /register they just show me my index.php all the time… if i delete index.php its always # Page not Found from my Symfony Local Server… Im just testing out so im just using this localhost Webserver from Symfony. I tested out the Route with php bin/console router:match /register and it showed green, it works and exists. But when i try going to the Site nothing happens.

namespace AppController;

use AppEntityUser;
use AppFormRegistrationFormType;
use AppRepositoryUserRepository;
use AppSecurityEmailVerifier;
use DoctrineORMEntityManagerInterface;
use SymfonyBridgeTwigMimeTemplatedEmail;
use SymfonyBundleFrameworkBundleControllerAbstractController;
use SymfonyComponentHttpFoundationRequest;
use SymfonyComponentHttpFoundationResponse;
use SymfonyComponentMimeAddress;
use SymfonyComponentPasswordHasherHasherUserPasswordHasherInterface;
use SymfonyComponentRoutingAnnotationRoute;
use SymfonyCastsBundleVerifyEmailExceptionVerifyEmailExceptionInterface;

class RegistrationController extends AbstractController
{
    private EmailVerifier $emailVerifier;

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

    #[Route('/register', name: 'app_register')]
    public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager): Response
    {
        $user = new User();
        $form = $this->createForm(RegistrationFormType::class, $user);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            // encode the plain password
            $user->setPassword(
            $userPasswordHasher->hashPassword(
                    $user,
                    $form->get('plainPassword')->getData()
                )
            );

            $entityManager->persist($user);
            $entityManager->flush();

            // generate a signed url and email it to the user
            $this->emailVerifier->sendEmailConfirmation('app_verify_email', $user,
                (new TemplatedEmail())
                    ->from(new Address('[email protected]', 'Julian Schaefers'))
                    ->to($user->getUserIdentifier())
                    ->subject('Please Confirm your Email')
                    ->htmlTemplate('registration/confirmation_email.html.twig')
            );
            // do anything else you need here, like send an email

            return $this->redirectToRoute('_profiler_home');
        }

        return $this->render('registration/register.html.twig', [
            'registrationForm' => $form->createView(),
        ]);
    }

    #[Route('/verify/email', name: 'app_verify_email')]
    public function verifyUserEmail(Request $request, UserRepository $userRepository): Response
    {
        $id = $request->get('id');

        if (null === $id) {
            return $this->redirectToRoute('app_register');
        }

        $user = $userRepository->find($id);

        if (null === $user) {
            return $this->redirectToRoute('app_register');
        }

        // validate email confirmation link, sets User::isVerified=true and persists
        try {
            $this->emailVerifier->handleEmailConfirmation($request, $user);
        } catch (VerifyEmailExceptionInterface $exception) {
            $this->addFlash('verify_email_error', $exception->getReason());

            return $this->redirectToRoute('app_register');
        }

        // @TODO Change the redirect on success and handle or remove the flash message in your templates
        $this->addFlash('success', 'Your email address has been verified.');

        return $this->redirectToRoute('app_register');
    }
}

SQL Database Entry and Query [duplicate]

Hello experts I would be very happy about your help

The aim of the code is that the user can register.
So it should store the values of form id=”signup”

should be stored in the mysql database.

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>Mahlzeit</title>
  <link rel="stylesheet" href="./Login.css">
</head>

<!DOCTYPE html>
<html>
<head>
    <title>Slide Navbar</title>
    <link rel="stylesheet" type="text/css" href="slide navbar Login.css">
<link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
</head>
<body>
    <div class="main">      
        <input type="checkbox" id="chk" aria-hidden="true">
            <div class="signup">
                <form action="http://localhost/Kulinarik/signup_save.php" methode="POST" id="signup">
                    <label for="chk" aria-hidden="true">Sign up</label>
                    <input type="text" name="vorname" placeholder="Vorname" id="vorname">
                    <input type="text" name="nachname" placeholder="Nachname" id="nachname">
                    <input type="email" name="email" placeholder="Email" id="email">
                    <button type="submit" value="signup">Sign up</button>
                </form>
            </div>
            <div class="login">
                <form action="login_save.php" methode="POST" id="login">
                    <label for="chk" aria-hidden="true">Login</label>
                    <input type="email" name="email" placeholder="Email" required=""/>
                    <input type="password" name="pswd" placeholder="Password" required=""/>
                    <button type="submit" value="Login">Login</button>
                    <a class="changepassword">Passwort ändern</a>
                </form>
            </div>
        </input>
    </div>
</body>
</html>

</body>
</html>

and the connection

    <?php
    session_start();
?>
<?php
$con= mysqli_connect('localhost','root','123456', 'userdata',);
$email = $_POST['email'];
$vorname = $_POST['vorname'];
$nachname = $_POST['nachname'];
$passwort = rand(0, 999999);


$result = $con->query("SELECT email FROM signup WHERE email = $email");
if($result->num_rows == 0) {
    $sql = "INSERT INTO signup (vorname, nachname, email, Passwort) vALUES ($vorname, $nachname, $email, $passwort)";
    if ($con->query($sql) === TRUE) {
        header("Location: Login.html");
      } else {
        echo "Error: " . $sql . "<br>" . $con->error;
      }
} else {
    echo "User ist bereits registriert";
}
$mysqli->close();

?>

Do you notice an error ?

The error message says that the array keys are not defined

e.g.:Warning: Undefined array key “email” in C:xampphtdocsKulinariksignup_save.php on line 9

Thanks in advance
Hello experts I would be very happy about your help

Remove duplication and show max count

I have the code below, but my problem is i received PHP Notice: Undefined offset: (from 1 to 7)
error message
and what is very important for me to get country ID only once with the max number.
its counting the number of projects and increase everytime one which is correct and what i need, but need to display it only once
how does it display
the correct result show be similar to:
the correct result

here is my code:-

<table>
    <tr>
        <th>Country ID</th>
        <th>Country Name</th>
        <th>Number of Place</th>
    </tr>

    <?php 
    $country_counts=[];
    $count_country =0;
    $country_count_each=0;
    $ids=array();// Store unique country_id values here
   
    foreach( $projects as $project ) {
        $country_id = $project['Project']['country_id'];
        # Check if the country_id is NOT in the array and display if OK.
        if( isset( $country_counts[ $country_id ] ) || !in_array( $country_id, $ids ) ) {
            $country_counts[$country_id]++;
            $country_count_each = $project['Project']['country_id'];
                if($project['Project']['country_id']==$country_count_each){
                    $count_country+=$country_count_each;
                    $ids[]=$country_id;
                    //echo $country_counts[$country_id];
    ?>
        <tr>
            <td style="width: 30%"><?php echo $project['Project']['country_id']; ?></td>
            <td style="width: 30%"><?php echo 'Country Name'; ?></td>
            <td style="width: 30%"><?php echo $country_counts[$project['Project']['country_id']]; ?></td>
        </tr>
    <?php       
                } 
        }else {
            $country_counts[$country_id] =$country_id;
        }
    }
    $proects_num = count($projects); 

    ?>

</table>

<?php 
    echo '<br>' .'Total projects numbers are: ' . $proects_num .'<br>'; 
    echo $html->link('Home ', $this->webroot.'countries/index/');
?>

the table in database
Table of projects

I need a help in that please

PHPExcel Codeigniter-4 unable to upload more than 50k rows

I want to upload an excel file of 50K columns but it’s unable to read them while I upload 2k row its worked fine and data was uploaded in the database(MySQL) also but when I tried to upload 50K rows at a time its not even showing error also.So my requirement is to upload 50K rows and 40 columns at a time using SpreadsheetReader_XLSX

Not able to fetch data from checkbox

So, i’m working on this real estate project, where users can add room details. Probblem is, when i check the checkbox for room one detail, i get information, but when i check the checkbox for another room (Please watch video), it does not show any information. Why?
Please watch this 20 sec video: link

 <div class=" add-list-tags fl-wrap">
          <!-- Checkboxes -->
                                    <ul class="fl-wrap filter-tags no-list-style ds-tg">
                                        <?php foreach ($action->fetchData("facilities") as $key => $value) {

                                        ?>
                                            <li>
                                                <input type="checkbox" value="<?php echo $value['id']; ?>" name="room_facilities[]">
                                                <label for="<?php echo $value['name']; ?>"> <?php echo $value['name']; ?></label>
                                            </li>
                                        <?php } ?>

                                    </ul>
       <!-- Checkboxes end -->
  </div>

How to make viewforum.php?foo=bar request serve a file instead of a PHP code?

I’m archiving a phpBB forum into flat HTML files, without any PHP code anymore.
I used wget (see How to: Archive a phpBB forum using Wget and preserve styling), and I now have these files:

enter image description here

How to make that Apache will serve example.com/forum/viewforum.php?f=2&start=25 as a file, and not as a request to viewforum.php with a query string? The latter does not work obviously and gives a 404.

I already tried this htaccess with no success:

RemoveHandler .php .phtml .php3
RemoveType .php .phtml .php3
php_flag engine off

Note: this is how I archived the forum:

wget -m -p -np -R "*sid=*,ucp.php*,memberlist.php*,*mode=viewprofile*,*view=print*,viewonline.php*,search.php*,posting.php*" https://forums.example.com

How to display a parent category in a product card

On my site there are product cards with my product. Each product has a category and a subcategory (it functions as Brand> Collection). Using the brands plugin doesn’t work for me.
the display on the product page itself is correct and excellent. (screenshot below). But on the product card, a subcategory is shown that belongs to the product, and I need a parent one. Can someone suggest how to do this?

enter image description here
enter image description here

Wrong image is displayed on browser breakpoints

I wrote a PHP image display function. There is no problem with the function. But I have a problem with breakpoints. On mobile it shows the big picture. I couldn’t understand how to solve the problem.

function imglazy($filen,$altn,$classn) {
    global $imagepath;
    global $cdnsource;
echo '<picture>
<source media="(min-width: 1025px)"
    data-srcset="'.$cdnsource.$imagepath.$filen.'-fl.webp"
    type="image/webp">
<source media="(max-width: 1024px)"
    data-srcset="'.$cdnsource.$imagepath.$filen.'-bg.webp"
    type="image/webp">
<source media="(max-width: 768px)"
    data-srcset="'.$cdnsource.$imagepath.$filen.'-md.webp"
    type="image/webp">
<source media="(max-width: 500px)"
    data-srcset="'.$cdnsource.$imagepath.$filen.'-sm.webp"
    type="image/webp">

<source media="(min-width: 1025px)"
    data-srcset="'.$cdnsource.$imagepath.$filen.'-fl.jpg"
    type="image/jpeg">
<source media="(max-width: 1024px)"
    data-srcset="'.$cdnsource.$imagepath.$filen.'-bg.jpg"
    type="image/jpeg">
<source media="(max-width: 768px)"
    data-srcset="'.$cdnsource.$imagepath.$filen.'-md.jpg"
    type="image/jpeg">
<source media="(max-width: 500px)"
    data-srcset="'.$cdnsource.$imagepath.$filen.'-sm.jpg"
    type="image/jpeg">
<img
    data-srcset="'.$cdnsource.$imagepath.$filen.'-bg.jpg,
        '.$cdnsource.$imagepath.$filen.'-md.jpg,
        '.$cdnsource.$imagepath.$filen.'-sm.jpg"
    data-src="'.$cdnsource.$imagepath.$filen.'-fl.jpg"
    alt="'.$altn.'"
    class="lazyload '.$classn.'">
</picture>';
}

Connect Office 365 use POP3 – PHP

I have a trouble with Office 365 use POP3 method.

Currenty, I can’t connect to this server:

   outlook.office365.com 
   port:995

This is my code example:

<?php
$host = 'outlook.office365.com';
$port = '995';
$username = 'outlook_mail';
$password ='password';
$mbox = imap_open('{'.$host.':'.$port.'/pop3/ssl/novalidate-cert}', $username, $password);

echo "<h1>Mailboxes</h1>n";
$folders = imap_listmailbox($mbox, "{".$host.":".$port ."}", "*");

if ($folders == false) {
    echo "Call failed<br />n";
} else {
    foreach ($folders as $val) {
        echo $val . "<br />n";
    }
}

echo "<h1>Headers in INBOX</h1>n";
$headers = imap_headers($mbox);

if ($headers == false) {
    echo "Call failed<br />n";
} else {
    foreach ($headers as $val) {
        echo $val . "<br />n";
    }
}

imap_close($mbox);

If I change port to 993, it’s OK.
Anyone know this problem? Many thanks!

Yii1 CDbHttpSession not working correctly

I used database session storage approach for using my sessions,

And I used this article too: slow-db-session-table

So I created YiiSession table in my db with this script:

 CREATE TABLE YiiSession
 (
  id CHAR(32) PRIMARY KEY,
  expire INTEGER,
  data BLOB,
  KEY expire_idx (expire) USING BTREE
 );

And my config in config/main.php:

'session' => [
    'class' => 'CDbHttpSession',
    'connectionID' => 'db',
    'sessionTableName' => 'YiiSession',
    'timeout' => 3600 * 24 * 30,
    'autoStart' => false,
    'autoCreateSessionTable' => false
],

I stores all user cart info session values as an object like this:

Yii::app()->session[‘user-cart’] = $this->cartInfo;

Issue

There are some issues,

1- Session, after page redirect sometimes no have any value,there is this problem
with using CDbHttpSession and no in session file working approach.

2- Sometimes session stores but unset session not works, and maybe after calling two
more time the method clears sessions it works.

unset(Yii::app()->session[‘user-cart’]);

What is the problem?
I don’t have any problem with working with session file approach, but db session not working correctly in my codes.

Yii version -> 1.1.23

PHP version -> 7.4

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