Jump to content

Mekaboo

Members
  • Posts

    51
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mekaboo

  1. @Ingolme Thank Ya🧡
  2. Hey all!! Trying to delete huge empty space between 2 divs...here is my code: <div class="wrapper"> <div class="page-content"><h1>Welcome <?php echo $username;?></h1></div> <div class="menu"> <ul> <li><a href="profile.php">Profile</a> </li> <li><a href="trip.php">Reservations</a> </li> <li><a href="firms.php">Companies</a> </li> </ul> </div> </div> </div> <div class="container"> <!-- Calendar container --> <div id="calendar"></div> </div> Thank ya!!!
  3. Hey all!!! I have overlays working on my hexagon grid but the issue is I cant get the overlays to separate for each hexagon. How do I get it to where each hexagon will have its on overlay? Thankya😊 <div class="container"> <section class="hexagon-gallery"> <div class="hex"><img src="img/hiw.png"> <div class="overlay"> <div class="text">Hello World</div> <a href="default.asp" target="_blank">This is a link</a> </div></div> <div class="hex"><img src="img/wc.png"> <div class="overlay"> <div class="text">Hello World</div> <a href="default.asp" target="_blank">This is a link</a> </div></div> <div class="hex"><img src="img/sc.png"> <div class="overlay"> <div class="text">Hello World</div> <a href="default.asp" target="_blank">This is a link</a> </div></div> <div class="hex"><img src="img/ew.png"> <div class="overlay"> <div class="text">Hello World</div> <a href="default.asp" target="_blank">This is a link</a> </div></div> </section> </div>
  4. @Ingolme EUREKA YOU FOUND MY ISSUE😂❤️
  5. @Ingolme The closing body tag is highlighted which to me mean its not closed. There is an error somewhere..going to figure it out😊
  6. @Ingolme I wasn't getting an error message and that's the thing that blows me because it makes it hard to correct. It's something in the body but don't know what it is☹️
  7. Hey😊 Ive attached a file to review. Unfortunately the final body/html tags wont close due to an error. Ive don't inspect and debug but nothing pops up. Question is where is the error within the file? Thank ya ❤️ mucode
  8. Thank ya so very much❤️ @Ingolme
  9. Hey 😊 How do I get the modal to work with all the images within the loop? So far it only works with the most recent uploaded image with the older images dont move. Here is code: <?php require_once "db.php"; $sql = "SELECT imageId,comment FROM output_images ORDER BY imageId DESC;"; $result = mysqli_query($conn, $sql); // Loop thru comments and display all of them while($row = mysqli_fetch_array($result)) { printf("%s (%s)\n", $row["imageId"]); ?> <img id="myImg" src="imageView.php?image_id=<?php echo $row["imageId"]; ?>" /><br/> <div id="myModal" class="modal"> <span class="close">&times;</span> <img class="modal-content" id="img01"> </div> </div> <?php } ?> </BODY> <script> // Get the modal var modal = document.getElementById("myModal"); // Get the image and insert it inside the modal - use its "alt" text as a caption var img = document.getElementById("myImg"); var modalImg = document.getElementById("img01"); var captionText = document.getElementById("caption"); img.onclick = function(){ modal.style.display = "block"; modalImg.src = this.src; captionText.innerHTML = this.alt; } // Get the <span> element that closes the modal var span = document.getElementsByClassName("close")[0]; // When the user clicks on <span> (x), close the modal span.onclick = function() { modal.style.display = "none"; } </script> Thank ya💙
  10. Hey 😊 <?php require_once "db.php"; if(isset($_GET['image_id'])) && if(isset($_GET['comment'])) { $sql = "SELECT imageType,imageData FROM output_images WHERE imageId=" . $_GET['image_id']; $result = mysqli_query($conn, $sql) or die("<b>Error:</b> Problem on Retrieving Image BLOB<br/>" . mysqli_error($conn)); $row = mysqli_fetch_array($result); header("Content-type: " . $row["imageType"]); echo $row["imageData"]; } mysqli_close($conn); ?> I added 'comment' column to the 'output_images' table and also added 'if(isset($_GET['comment']))' which works for the comment part but the images (imageId) now don't show. I feel that I need to add '. $_GET['comment']' to the sql line but when I do it messes things up more. How to get both imageId and comment to work together?
  11. @dsonesuk Thank ya so very much..got it💙
  12. @dsonesuk You have been outstanding help❤️ Ive taken you advice and now have DB connection but dont know where to place SELECT statement to retrieve data. Im down to the finish line 😂Code: <?php $comment = filter_input(INPUT_GET, 'comment'); if (!empty($comment)){ $host = ""; $dbusername = ""; $dbpassword = ""; $dbname = ""; // Create connection $conn = new mysqli ($host, $dbusername, $dbpassword, $dbname); if (mysqli_connect_error()){ die('Connect Error ('. mysqli_connect_errno() .') ' . mysqli_connect_error()); } else{ $sql = "INSERT INTO comment(comment) values ('$comment')"; if ($conn->query($sql)){ echo "New record is inserted sucessfully"; } else{ echo "Error: ". $sql ." ". $conn->error; } $conn->close(); } } else{ echo "Comment should not be empty"; die(); } ?> <?php $result = mysqli_query("SELECT * FROM comment"); ?> <p><?php echo $GET["comment"]; ?></p> </div> </div>
  13. @niche <form action="pro.php" method="post"> Bio: <input type="text" name="bio"><br> <input type="submit"> </form> </div> <?php if (isset($_POST['submit'])) { echo "pro.php"; } ?> Sorry for delay...hung with a dear friend😊 I changed my form because I noticed the <textarea> tag doesn't seem to process within a form.
  14. @niche Thank ya as always❤️ Issue now is that content disappears. This is mainly due to the fact that things are not connected to DB. Working on that. <?php require_once "db.php"; $sql = "SELECT comment FROM tbl_member ORDER BY comment DESC Limit 1"; $result = mysqli_query($conn, $sql); ?> <p><?php echo $_POST["bio"]; ?></p> This is the results page....trying to get info from submission from one page to go into DB and display and stay permanent on another.
  15. Hey😊 Login/register session <?php session_start(); if (isset($_SESSION["username"])) { $username = $_SESSION["username"]; session_write_close(); } else { // since the username is not set in session, the user is not-logged-in // he is trying to access this page unauthorized // so let's clear all session variables and redirect him to index session_unset(); session_write_close(); $url = "./index.php"; header("Location: $url"); } ?> Form <?php // define variables and set to empty values $commentErr = "; $comment = "; function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["comment"])) { $comment = ""; } else { $comment = test_input($_POST["comment"]); } } ?> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> Bio: <textarea name="comment" rows="5" cols="40"><?php echo $comment;?></textarea> <input type="submit" name="submit" value="Submit"> </form> </div> Result Echo (placed on another place pro.php) <p><?php echo $_POST["comment"]; ?></p> Goal is to store form submission within DB. Do I place a header linking the form to the other page (pro.php)? Ive tried input text which worked but the content disappeared when refreshed. Question: How to have form submit, store, and retrieve, and display successfully without refresh? Thank ya💙
  16. @dsonesuk Thank ya kindly😊
  17. Mekaboo

    Query help

    @niche Okie Dokie
  18. Mekaboo

    Query help

    Hey @dsonesuk😊 Ive realized that I just need to do an INNER JOIN to connect the tables. My loop is right just need to do a query connect. This is what I came up with: <?php $sql = "SELECT imageId FROM output_images INNER JOIN comment ON imageId = comment.imageId ORDER BY imageId DESC;"; ?> Also @niche you are more than welcome to chime in on this😊
  19. Mekaboo

    Query help

    Hey @niche Through research Ive noticed that folks are not too keen on using multi query and say use prepared statements or separate the queries. Singular query (original setup) works perfectly. Is there a way to duplicate this code so it can connect to the comment DB table the same way this connects to the image DB table? <?php require_once "db.php"; $sql = "SELECT imageId FROM output_images ORDER BY imageId DESC;"; $result = mysqli_query($conn, $sql); // Loop thru comments and display all of them while($row = mysqli_fetch_array($result)) { printf("%s (%s)\n", $row["username"], $row["comment"],$row["imageId"]); ?>
  20. Mekaboo

    Query help

    @niche Thank ya😊 Someone in another forum helped me a few weeks with the while loop. My thing is I'm still learning and I grasp the concept somewhat but lack the knowledge to know where certain code goes in order to function especially if I'm working with pre made scripts. Will keep informed if there are errors..THANK YA again💙
  21. Mekaboo

    Query help

    @niche First off THANK YA for the help and understanding❤️ As far as the Push Array my interpretation is that I combine tables within Comment and push onto imageId (Output_images). This is updated code with push array..wanted to get your insight before I stamp as completed😁: <?php $mysqli = new mysqli(""); $a=array("imageId"); array_push($a,"userId","commentId","comment"); print_r($a); if ($mysqli -> connect_errno) { echo "Failed to connect to MySQL: " . $mysqli -> connect_error; exit(); } $sql = "SELECT imageId FROM output_images ORDER BY imageId DESC;"; $sql .= "SELECT * FROM comment"; // Execute multi query if ($mysqli -> multi_query($conn, $sql)) { do { // Store first result set if ($result = $mysqli -> store_result()) { while ($row = $result -> fetch_row()) { printf("%s (%s)\n", $row["username"],$row["imageId"],$row["comment"]); } $result -> free_result(); } // if there are more result-sets, the print a divider if ($mysqli -> more_results()) { printf("-------------\n"); } //Prepare next result set } while ($mysqli -> next_result()); } $mysqli -> close(); ?> As far as UNION that makes me think of INNER, LEFT, RIGHT JOIN. Is it possible to do both(push and union)?
  22. Mekaboo

    Query help

    @niche Separate queries more so...this is what Im trying to accomplish with the loop: https://www.w3schools.com/php/func_mysqli_multi_query.asp There are 2 seperate forms but what happens is the query will acknowledge both within the loop. Goal is to have users either post comments or images and are shown in descending order...like a social media wall post. The buttons represent 2 different forms but both will be connected to same query loop.
  23. Mekaboo

    Query help

    @niche I don't how to connect the Comment table to the loop. As of now I can comment post works but don't descend and the images don't show at all. Im trying to connect multiple queries within the loop to function together. How do I create a connection is what Im trying to do☹️ This is an image from my landing page:
  24. Mekaboo

    Query help

    Hey there😊 Im trying to connect this table: Comment(Id,userId,commentId,comment) to this code so they can loop together. Now images dont show and only one comment shows up. Goal is to have images and comment loop on a descend like in a typical social media page : <?php $mysqli = new mysqli(""); if ($mysqli -> connect_errno) { echo "Failed to connect to MySQL: " . $mysqli -> connect_error; exit(); } $sql = "SELECT imageId FROM output_images ORDER BY imageId DESC;"; $sql .= "SELECT * FROM comment"; // Execute multi query if ($mysqli -> multi_query($conn, $sql)) { do { // Store first result set if ($result = $mysqli -> store_result()) { while ($row = $result -> fetch_row()) { printf("%s (%s)\n", $row["username"],$row["imageId"]); } $result -> free_result(); } // if there are more result-sets, the print a divider if ($mysqli -> more_results()) { printf("%s (%s)\n", $row["username"],$row["comment"]); } //Prepare next result set } while ($mysqli -> next_result()); } $mysqli -> close(); ?> The output_images is from a script I implemented. This is the DB connection for that: <?php require_once "conn.php"; if(isset($_GET['image_id'])) { $sql = "SELECT imageType,imageData FROM output_images WHERE imageId=" . $_GET['image_id']; $result = mysqli_query($conn, $sql) or die("<b>Error:</b> Problem on Retrieving Image BLOB<br/>" . mysqli_error($conn)); $row = mysqli_fetch_array($result); header("Content-type: " . $row["imageType"]); echo $row["imageData"]; } mysqli_close($conn); ?> This has been the toughest part to accomplish..if you can help I would greatly appreciate it❤️
  25. @dsonesuk My issue is I'm trying to connect another table/column (Comment) to that loop...thats where Im getting stuck at
×
×
  • Create New...