Jump to content

pepsinator

New Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

pepsinator's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you i got it write... managed to fix all my errors and it's running perfectly fine now
  2. Please help me with this code, its supposed to retrieve the users ID on the database when the user has logged on the blog and allow the user to delete or edit their profile Here is the code below; <?php session_start(); $id = isset($_SESSION['id']); if ($row['email'] === $email && $row['password'] === $pass) { $_SESSION['id'] = $row['id']; $_SESSION['email'] = $row['email']; header("location: home.php"); exit(); } echo "ID value: " .$id. "<br>"; if (!isset($_SESSION['email'])) { if ($row['email'] === $email && $row['password'] === $pass) { $_SESSION['email'] = $row['email']; header("location: home.php"); exit(); } else { header("location: login.php"); exit(); } } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" cotent="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!--Bootstrap--> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> <!--Font Awesome--> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <title>HOME</title> <link rel="stylesheet" type="text/css" href="styles.css"> </head> <body> <h1>Welcome to the our blog <?php echo htmlspecialchars($_SESSION['email'], ENT_QUOTES, 'UTF-8'); ?></h1> <br> <a href="logout.php">Logout</a> <br> <br> <div> <a href="edit.php?id=<?php echo isset($_SESSION['id']) ? $_SESSION['id'] : ''; ?>" class="link-dark"><i class="fa-solid fa-pen-to-square fs-5 me-3"></i></a> <a href="delete.php?id=<?php echo isset($_SESSION['id']) ? $_SESSION['id'] : ''; ?>" class="link-dark"><i class="fa-solid fa-trash fs-5 me-3"></i></a> </div> <!--Boostrap--> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> </body> </html> currently it's giving me that error as shown in the picture
  3. Please help with that code, the buttons don't work
  4. <meta charset="utf-8"> <title>Work intergrated learning</title> <style> #btnSubmit{ padding: 10px; background-color: red; font-size: 20px; border-radius: 10px; font-weight: bolder; transition: background-color 2s ease Os; cursor: pointer; } #btnCancel{ padding: 10px; background-color:yellow; font-size: 20px; border-radius: 10px; font-weight: bolder; transition: background-color 2s ease Os; cursor: pointer; } #btnSubmit:hover{ background-color: green; } #btnCancel:hover{ background-color: orange; } </style> <style> body { font-size: 30px; } p { font-size:x-large; } </style> This is my first task of creating a button using php code, it is my first time coding in php and i am so excited!!! <p>Creating a button</p> <br> <!--?php if(isset($_POST['btn-atc'])){ echo 'You have added an item to your shopping chart'; } ?--> <input type="submit" name="btn-atc" value="Add to Cart"> <!--?php $btnSubmit= $_POST['btnSubmit']; if (btnSubmit){ echo 'Your query has been successfully submited, our consultant will get in touch with you as soon as possible';} $btnCancel= $_POST['btnCancel']; elseif(btnCancel){ echo 'You have cancelled your query.'; } ?--> <input type="submit" value="Submit query" id="btnSubmit"><br> <input type="submit" value="Cancel" id="btnCancel">
  5. How can I create a PHP coded button which is responsive without using the form tag on HTML
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.