Jump to content

Colourtheory

Members
  • Content Count

    39
  • Joined

  • Last visited

Everything posted by Colourtheory

  1. I give up, it's just not working.. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, maker) VALUES (hi,hi,1)' at line 1 Sucks, I worked so hard on this website.
  2. Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/u705429760/public_html/newdiscussion.php on line 35
  3. This is the new version <?php include('themesys.php') ?> <br><Br><div class="bbox"> <center> <?php session_start(); if (isset($_SESSION['user_id'])){ $con = mysql_connect("mystuff","mystuff","mypw");if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mydb", $con); $id = $_SESSION['user_id']; $sql="INSERT INTO discussions (name, desc, maker)VALUES($_POST['namevalue'],$_POST['descvalue'],'$id')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "Discussion started!"; mysql_close($con); }else{header('Location: login.php');}?> </div></body>
  4. Yeah, this is really upsetting because this is one of the main parts of the website, and something so small is ruining it.
  5. This is so consfusing.. the script came off of a w3 example. I just edited it.
  6. Let me check.. Also, a few variables have the same name could this be causing the problem?
  7. <?php session_start(); require_once 'db.php';if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("u705429760_main", $con); $id = $_SESSION['user_id']; $sql="INSERT INTO discussions (name, desc, maker)VALUES('$_POST[name]', '$_POST[desc]', $id)"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "Discussion started!"; mysql_close($con);?>
  8. Maybe there is a problem with the PHP part..
  9. The second one turns out to be the exact same as the first error
  10. It whites out the entire page and says Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/u705429760/public_html/newdiscussion.php on line 23
  11. You might want to block a browser that's not supported by your product.
  12. I've tried everything I can think of, any idea what's wrong? $sql="INSERT INTO discussions (name, desc, maker)VALUES('$_POST[name]', '$_POST[desc]', '$id')"; Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, maker) VALUES ('yo', 'yolo', '1')' at line 1
  13. Maybe I should start over.. I think this script needs to be scrapped.
  14. Colourtheory

    SQL Injection

    So I've been warned a few times about this, and I was wondering, how do I stop/prevent them? What methods are dangerous?
  15. No error is coming up, but it doesn't change the value. <?phprequire_once 'db.php';$page_mode = isset($_POST['page_mode']) ? $_POST['page_mode'] : ''; if ($page_mode == 'setbio'){ $id = $_SESSION['id'];$find = mysql_query("SELECT bio FROM users WHERE id='$id'");$bio = mysql_fetch_assoc($find);$biotext = $_GET['bio'];$update = db_query("UPDATE users SET bio='$biotext'WHERE id='$id'"); } ?><?php session_start(); if (isset($_SESSION['user_id'])){?><h1>Customize your profile, <?php echo "" . $_SESSION['user_name'] . "!"; ?><br><form action="myprofile.php" method="post"><input type="hidden" name="page_mode" value="setbio"><input type="text" text="Bio" name="bio"><br><input type="submit" name="submit"></form><?php} else{header('Location: login.php'); } ?>
  16. Colourtheory

    Background

    How do I make a background that doesn't move or scroll down with the page? Kind of like twitter, the page contents scroll and move down but the background doesn't. How can I do this?
  17. Got it, forgot to fetch email. My bad.
  18. <?phpsession_start();require_once 'db.php';$id = $_GET['id'];$user = mysql_query("SELECT name FROM users WHERE id='$id'");$result = mysql_fetch_assoc($user);$email = $result['email'];echo "<p>Username: " . $result['name'] . "<br>";echo "Email:" . $result['email'] . "<br>"; ?> Still not working.. hmm..
  19. Wait, I made the username load but not the email. Confusing me..
  20. Colourtheory

    Profile page

    So I tried to make a profile page.. it's not working out so well. Here is the profile page's source, and note: the address bar when you click the link comes out to be ?id= and even if I type the ?id=1 it still doesn't work <?phpsession_start();require_once 'db.php'; $id = $_GET['id'];$user = mysql_query("SELECT name FROM users WHERE id='$id'"); echo "<h1>User Info</h1>"; echo "<p>Username:" . $user['name'] . "<br>";echo "Email:" . $user['email'] . "<br>"; ?>
  21. I set the position to relative then 0px top and 0px left, thanks!
  22. Colourtheory

    Header issue

    I made a header, but for some reason it has spacing on the top, left and right (probably bottom too) and I want it to be like Twitters, on the top with no spacing. I know it's probably basic, but how would I fix this?
×
×
  • Create New...