Webentwicklung – die besten Beiträge

Website lädt Datei nicht hoch, warum?

Moin, kennt sich vielleicht jemand mit PHP und Html aus und weiß warum beim Upload der Datei nicht das Script "upload.php" ausgeführt wird? Versuche mich gerade beim Scripten, stehe allerdings gerade voll auf dem Schlauch... Danke!

<?php include 'header.php'; ?>
<?php
if(!isset($_SESSION['email'])){
  header('location:login.php');
  $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
}
 ?>
      <div class="breadcrumb">
        <div class="container">
            <a class="breadcrumb-item" href="index.php">Home</a>
            <span class="breadcrumb-item active">Welecome <?php echo $_SESSION['email'] ?></span>
            <span class="breadcrumb-item active">Upload Video</span>
        </div>
    </div>
    <section class="static about-sec">
        <div class="container">
            <h1>Upload Video</h1>
            <div class="form">
                <form class="" action="videoUpload.php" method="post">
                    <div class="row">
                        <div class="col-md-6">
                            <input type="hidden" name="id" value="">
                            <label for="name">Name of Video:</label>
                            <input type="text" name="name" value="" placeholder="Fantasy World" required>
                            <label for="video_url">Video URL</label>
                            <input type="file" name="video_url" required>
                            <label for="description">Description</label>
                            <input type="text" name="description" value="" placeholder="">
                            <label for="category">Category</label>
                            <select name="category">
                              <option value="Classic">Classic</option>
                              <option value="Adventerous">Adventerous</option>
                              <option value="Nature">Nature</option>
                              <option value="Others">Others</option>
                            </select>
                          </div>
                        </div>
							<div class="col-lg-8 col-md-12">
							<form action="upload.php" method="post" enctype="multipart/form-data">
							<input type="submit" class="btn black" value="Upload Image" name="submit">
							</form>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>


    <?php include 'footer.php';?>
HTML, Webseite, HTML5, Code, Datenbank, MySQL, PHP, Programmiersprache, Webdesign, Webentwicklung

Wie verbessere ich die Darstellung auf mobilen Geräten?

<?php
session_start();
?>


<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Warenkorb</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            display: flex;
            flex-direction: column;
            align-items: center; 
            padding: 20px;
        }


        .cart-container {
            width: 100%;
            max-width: 600px;
            background-color: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 20px;
            text-align: left;
        }


        .cart-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
        }


        .cart-item p {
            margin: 0;
        }


        .total {
            font-weight: bold;
            font-size: 1.2em;
            color: #333;
            margin-top: 20px;
            text-align: right;
        }


        
        .checkout-button {
            background-color: #2a9d8f;
            color: #fff;
            padding: 10px 20px;
            border: none;
            border-radius: 25px;
            font-size: 1em;
            font-weight: bold;
            cursor: pointer;
            margin-top: 20px;
            text-align: center;
            transition: background 0.3s ease;
        }


        .checkout-button:hover {
            background-color: #21867a;
        }
    </style>
</head>
<body>
    <h1>Warenkorb</h1>
    <div class="cart-container">
        <?php if (!empty($_SESSION['cart'])): ?>
            <?php $total = 0; ?>
            <?php foreach ($_SESSION['cart'] as $item): ?>
                <div class="cart-item">
                    <p><?= htmlspecialchars($item['product_name']) ?> (x<?= htmlspecialchars($item['quantity']) ?>)</p>
                    <p>€<?= htmlspecialchars(number_format($item['price'] * $item['quantity'], 2)) ?></p>
                </div>
                <?php $total += $item['price'] * $item['quantity']; ?>
            <?php endforeach; ?>
            <p class="total">Gesamt: €<?= htmlspecialchars(number_format($total, 2)) ?></p>


      
            <form action="checkout.php" method="post">
                <button type="submit" class="checkout-button">Zur Kasse</button>
            </form>


            <form action="index.php" method="post">
                <button type="submit" class="checkout-button">weitershoppen</button>
            </form>


        <?php else: ?>
            <p>Ihr Warenkorb ist leer.</p>
        <?php endif; ?>
    </div>
</body>
</html>


Webseite, Webentwicklung

Python discord NonType Error?

Ich habe einen Error in meinem Code:

async def on_submit(self, interaction2: discord.Interaction):
    response = await sendRequests(str(self.username), str(self.email), str(self.password))
    if response == "email":
        await interaction2.response.send_message("Incorrect email format", ephemeral=True)
        return
    if response == "password":
        await interaction2.response.send_message("Incorrect password format. The password must meet these requirements: \nOne Uppercase letter \nOne lowercase letter \nOne number\n A special character ", ephemeral=True)
        return
    if response == "maintenance":
        await interaction2.response.send_message("The system is currently under maintenance. Please look in #news for more infos.", ephemeral=True)
    query = "INSERT INTO users VALUES (?, ?, ?, ?)"
    main.cursor.execute(query, (interaction2.user.id, str(self.username), str(self.email), str(self.password)))
    main.database.commit()
    await interaction2.response.send_message("You are now in the registration process. This can take up to one hour.", ephemeral=True)
    channel = main.bot.get_channel(1309925591146958933)
    await channel.send("make a recaptcha, registration from user : " + str(interaction2.user.name) + " with id: " + str(interaction2.user.id))

Error:
[2024-11-23 19:32:43] [ERROR  ] discord.ui.modal: Ignoring exception in modal <RegisterModal timeout=None children=3>:

Traceback (most recent call last):

 File ".venv\Lib\site-packages\discord\ui\modal.py", line 189, in _scheduled_task

   await self.on_submit(interaction)

 File "TestButton.py", line 41, in on_submit

   await channel.send("make a recaptcha, registration from user : " + str(interaction2.user.name) + " with id: " + str(interaction2.user.id))

         ^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'send'

Bot, Code, Programmiersprache, Python, Webentwicklung, Python 3, Pycharm, Discord, Discord Bot

Meistgelesene Beiträge zum Thema Webentwicklung