Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Fishcakes

  • Rank
  1. I tried parsing through first https://www.jadaliyya.com/Details/28167/The-Empire-of-Sexuality-An-Interview-with-Joseph-Massad then even tried www.google.com and on both I get the following returned post_url equals: www.google.compost_title equals: testpost_Threadybody equals: Enter your posts... URL equals: www.google.com www.google.com is not a valid URL Web page redirects after 2 seconds. And here is the if statement that handles my filter for URLs if(isset($_POST["submit"]) && !empty($_POST["url"]) && !empty($_POST["Title"])){ $URL =
  2. Hi I am currently mostly learning procedural PHP but had a question about security. Are hackers able to see connections to databases in procedural programming? Would connections to databases need to be called from classes and methods instead? Or does it not matter that much?
  3. Thanks yeah I managed to work out you could select just the one column like so select Posts.*, Users.avatar from Posts
  4. Hi I'm trying to figure out why this statement produces the below select Posts.id as PostsId, Posts.User as PostsUser, CommentText,IdOfThread, ParentId from Posts join Users on Users.User=Posts.User where Posts.IdOfThread = '281'; | PostsId | PostsUser | CommentText
  5. So I implemented it like this and my page loads fine however it doesn't retrieve any of the comments Also looking at the code you wrote should I have a children column on the my Posts table(comments table)? Also when I comment on my site? <!DOCTYPE html> <html> <header> <link href="styles.css" rel="stylesheet" type="text/css" media="all"> <title> Image Board</title> <div class="header"> <a href="index.php" class="logo">ONLINE</a> <div class="header-right"> <a class="active" href="#home">Home<
  6. So I wanted to create stickers on my forum where people type in say ":Blobby-Tired" and then instead of the comment showing ":Blobby-Tired" it shows an html image tag displaying a picture of Blobby in the comment box So I created the following page CommentUpload.php However my sql fails to insert it despite the fact when I "echo $new" it shows the image on the page correctly And it can't be my sql insert code as if I change $new variable for "$BodyText" int he SQL query it it inserts ":Blobby-Tired" OK? <?php include 'dbconnect.php'; session_start(); if(isset($_
  7. So I did implement this but it doesn't output anything. The page does load but the comments don't get spat out. when running at the command line "php viewthread2.php" I get this back however? PHP Warning: Undefined variable $tree in /var/www/html/Backup16042020/viewthread2.php on line 129 PHP Fatal error: Uncaught TypeError: outputPostTree(): Argument #1 ($tree) must be of type array, null given, called in /var/www/html/Backup16042020/viewthread2.php on line 129 and defined in /var/www/html/Backup16042020/viewthread2.php:132 Stack trace: #0 /var/www/html/Backup16042020/viewthread2.p
  8. That is a really nice solution I tried implementing it however and am not sure if I'm doing it correctly Also do I need to declare "children" as something? <!DOCTYPE html> <html> <header> <link href="styles.css" rel="stylesheet" type="text/css" media="all"> <title>Image Board</title> <div class="header"> <a href="index.php" class="logo">forum ONLINE</a> <div class="header-right"> <a class="active" href="#home">Home</a> <a href="#news">News</a> <a href="#contact">Educati
  9. Hi I'm wondering how I can output nested comments. I have written a viewthread.php file that works nicely so far. From index.php it gets the IDOfThread and passes this to a $number then outputs all the comments assigned to the Thread ID However I'd like to be able to respond to each comment to create nested comments This is my viewthread.php so far <!DOCTYPE html> <html> <header> <link href="styles.css" rel="stylesheet" type="text/css" media="all"> <title>test Image Board</title> <div class="header"> <a href="index.ph
  10. Doh... Answered my own question as I just input session_start() into my index.php and it now works as expected... I'm wondering why when login.php runs which looks like the below doesn't start the session though?! Login.php is as follows <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>Login</title> <link rel="stylesheet" href="style.css"/> </head> <body> <?php require('dbconnect.php'); session_start(); // When form submitted, check and create user session. if (isset($_POST['
  11. Hi thanks for the responses they are very informative However I am calling start_session() in login.php (login.php is run when they login) which is my question as to why the divs are not changing when I do an if(isset($_SESSION['username'])) in the index.php (main page) <?php require('dbconnect.php'); session_start(); // When form submitted, check and create user session. if (isset($_POST['username'])) { $username = stripslashes($_REQUEST['username']); // removes backslashes $username = mysqli_real_escape_string($conn, $username); $passwo
  12. Back with more noob questions so I was following a page in setting up a login system and so far it works how I want except for one minor thing So I want when a user is logged into the system to see Profile div instead of Login and Register and I do that in my index.php with the following <?php if(isset($_SESSION['username'])){ echo "<div class='profile'> <a href='logout.php'>Logout</a> </div> "; } else{ echo "<div class='loginregister'> <a href='login.php'>Login</a>
  13. I input the error function here to see what error it's returning //Update SQL db by setting the thumbnail column to equal $Thumbnail $update = $conn->query("update Threads set thumbnail = '$Thumbnail' where filename = '$fileName'"); if($update){ $statusMsg = "Updated the thumbnail to sql correctly."; echo $statusMsg . "<br> </br>"; echo "Error : " . $_FILES['file']['error'] . "<br>"; } and the output I get is Updated the thumbnail to sql correctly. Error : Updated the thumbnail to sql correctly. Which is weird as it definite
  14. So far I have managed to create an upload process which uploads a picture, updates the database on file location and then tries to upload the db a 2nd time to update the Thumbnails file location (i tried updating the thumbnails location in one go and for some reason this causes failure) But the main problem is that it doesn't upload some files Here is my upload.php <?php include 'dbconnect.php'; $statusMsg = ''; $Title = $conn -> real_escape_string($_POST['Title']) ; $BodyText = $conn -> real_escape_string($_POST['ThreadBody']) ; // File upload path $targetDir =
  • 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.