Jump to content

Colourtheory

Members
  • Posts

    39
  • Joined

  • Last visited

Posts 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. 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>

  3. <?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);?>

  4. 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

  5. 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

  6. 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');     } ?>

  7. 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?

  8.  <?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..

  9. 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>"; ?>

  10. 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...