Jump to content

unsider

Members
  • Posts

    610
  • Joined

  • Last visited

    Never

Everything posted by unsider

  1. there are four columns in my table* (will be adding more later, but for now I'm trying to establish something) id (int) , commenttext (text) , commentdate (datetime), username (varchar255) respectively, so i guess they are not in order.
  2. This query is frustrating me, mainly because I can't find a well written article explaining how it all works. I am trying to insert a session value into a DB, and retrieve it in a later script. I've tested everything in the script up till the query, therefore I know thats the error. Heres the output: session->username set. Able to locate database. post array was set. Error adding query: Column count doesn't match value count at row 1 Warning: Cannot modify header information - headers already sent by (output started at /home/unsider/www/andy/comment_process.php:13) in /home/unsider/www/andy/comment_process.php on line 37 Code: <?php include("include/session.php"); if(!$session->username) { header('main.php'); } else { if($session->username) { echo "session->username set." . "<br>"; } if (!@mysql_select_db('mtlc?old')) { echo 'Unable to locate the ' . 'database.'; } if (mysql_select_db('mtlc?old')) { echo 'Able to locate database.' . "<br> "; } if(isset($_POST['commenttext'])) { echo "post array was set" . "<br>"; // HELP ################################################################################ $commenttext = $_POST['commenttext']; $username = $session->$username; $sql="INSERT INTO `comments` VALUES ( '$username','$commenttext', 'NOW()' )"; // #################################################################################### if (!@mysql_query($sql)) { echo 'Error adding query: ' . mysql_error(); header('main.php'); } } } ?> Please help
  3. unsider

    hobby?

    Nice, hahah And I do it as a hobby now, but I hope when I pick up more knnowledge I can eventually get paid for it.
  4. If your client understands that, you MIGHT have a shot. And you spelled communicate correctly, too bigga word fo yas.
  5. Upload it too a web server, particularly Apache with updated PHP/mySQL, Or use your localhost. phpMyAdmin is good for interacting with your DB. umm, just google some of those terms and you're bound to string it together.
  6. I think that's ultimately what I plan to do, but I just figured I'd try to find something convinient. Makes it easier.
  7. Well I suppose you don't physically need it, but the mental capacity to solve problems, and think logically is necessary, and I generalized it into a high school education. Although that is still unusual.
  8. unsider was inspired by an aphex twin song, not sure how, but ya, started using it for games, etc.. and eventually I started using it for everything.
  9. I'm going to bed, but if anyone wants to help me out, I'd really apreciate it. G'nite all.
  10. unsider

    PREG

    Spoofed HTTP Requests Cross Site Scripting Google search some form security/overall security topics to find them all. You are simply protecting the user from input strange characters, or potientally harmful characters.
  11. unsider

    PREG

    Yes, or even take it a step further to not allow <>,!, @, #, etc... But yes, that type of validation works just fine. For the most minimal of form security.
  12. Can't help very much, but just make sure your double checking all your variable names, etc.. Thorough spell check I suppose. Sorry I can't be of much help.
  13. Ooops, wow, well I tested it without the $ on username. Not sure how it got in there, although I think I tried a new method before resorting to questions. I think my query just needs some effective rewriting.
  14. I guess thats a good way to put it. The white clouds could use some more texture, assuming you don't want to recreate your entire banner. Make the blank areas more complex, and it could potientally work for you.
  15. Not much to criticize. Looks very nice and clean. I too like the transistion between your menu tabs.
  16. Like he said, I think the site could use some nice CSS tables, and some gradiants, sparkles, etc... Get creative and look into some 'stand-out' designs. You want your user to rememeber your website.
  17. I like it, clean, easy to navigate, and for the most part pretty professional. The only thing from a design point, without be too opinionated or critical is the right hand BG. The left is blue, although the right is grey and looks uneven. I think the same color blue should fill up that whitespace when not in use. Otherwise nothing stands out to me.
  18. My DB has these 4 feilds: 'id', 'username', 'commenttext', 'commentdate' The username = the current $session->username The commenttext = the $_POST['commenttext'] The commentdate = NOW() My form action, etc.. is all working properly, I just need to fix this query that inputs the info in the DB and I'm set. Thanks. <?php // HELP FROM HERE if(isset($_POST['commenttext'])) { $commenttext = $_POST['commenttext']; $username = $session->$username; $sql="INSERT INTO comments VALUES ('$username','$commenttext', 'NOW()')"; // TO HERE if (!@mysql_query($sql)) { echo 'Error adding query: ' . mysql_error(); header('main.php'); } } ?>
  19. Javascript that allows users to collapse/expand tables, similar to the one at the top of this forum, that expands/collapses "Hello username newsbar" And I assumed people would know what I was talking about, error on my part. Example, segment of code from the source of this forum... <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ var current_header = false; function shrinkHeader(mode) { smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "97716159925285cfe60fe24bc324cc9d"); document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif"); document.getElementById("upshrinkHeader").style.display = mode ? "none" : ""; document.getElementById("upshrinkHeader2").style.display = mode ? "none" : ""; current_header = mode; } // ]]></script>
  20. The method below excuted properly, although this is the input for my DB, it's seriously flawed, and it does not redirect me back to main.php as it's supposed to. id commenttext commentdate username 48 0000-00-00 00:00:00 = NOW() And I'm not quite sure how to define NOW(), partly because it's not a PHP function. <?php include("include/session.php"); if(!$session->username) { header('main.php'); } else { if($session->username) { echo "session->username set." . "<br>"; } if (!@mysql_select_db('mtlc?old')) { echo 'Unable to locate the ' . 'database.'; } if (mysql_select_db('mtlc?old')) { echo 'Able to locate database.' . "<br> "; } if(isset($_POST['commenttext'])) { echo "post array was set" . "<br>"; $commenttext = $_POST['commenttext']; $username = $session->$username; $sql="INSERT INTO comments VALUES ('id','$username','$commenttext', '$commentdate = NOW()')"; if (!@mysql_query($sql)) { echo 'Error adding query: ' . mysql_error(); header('main.php'); } } } ?>
  21. umm, can't think of any off the top of my head, but i suppose try to google some books. and either buy them, or dl them as e-books. although im not advocating any illegal activity. good luck with your project though.
  22. <? header("example.php"); ?> ? I'm very confused by your question. Sorry
  23. You are my hero, although this error is returned, and it has to do with my DB obviously, but I've never seen it before, I'm going to google search some solutions because I want to learn, but if anyone has any ideas, let me know why. Possible solutions, etc..
×
×
  • 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.