Jump to content

unsider

Members
  • Posts

    610
  • Joined

  • Last visited

    Never

Everything posted by unsider

  1. I really need some help. Parse error: syntax error, unexpected $end in /home/unsider/www/andy/comment_process.php on line 31 <?php include("include/session.php"); if(!$session->username) { header('main.php'); } else { if (!@mysql_select_db("mtlc?old")) { echo 'Unable to locate the ' . 'database.'; } if(isset($_POST['commenttext'])) { $commenttext = $_POST['commenttext']; $username = $session->username;` $sql ="INSERT INTO comments VALUES ('$username','$commenttext')"; if (!@mysql_query($sql)) { echo 'Error adding query: ' . mysql_error(); header('main.php'); } } } ?>
  2. PHP is server-side, how would you accomplish that? As far as I know you can't. maybe I'm confused by your question.
  3. kirupa.com I think has a few tutorials on this if I'm not mistaken. That is, if you can't find what your looking for with gotoandlearn.
  4. Unfortunately you may have to work on your own script and ask for help. I'm not sure anyone here will do 100% of the work, mainly because you wouldn't be learning anything, and you wouldn't be able to really add to it if you don't understand how it works. I guess my only advice is pick up a book and work on a 'shopping cart-esque' type tutorial that takes the order $$ and creates a grand total. Then come back and people will be more than willing to help you succeed.
  5. Hi. Pick up a manual and get to work
  6. Alright, well I went to bed last night, and have come to work on it again this morning. How is everyone main.php (form works just fine, no errors) comment_process (has an error) - Parse error: syntax error, unexpected $end in /home/unsider/www/andy/comment_process.php on line 30 Only has 30 lines, so can someone run my code for errors? <?php include("include/session.php"); if(!$session->username) { header('main.php'); } else { if (!@mysql_select_db("mtlc?old")) { echo 'Unable to locate the ' . 'database.'; } if(isset($_POST['commenttext'])) { $commenttext = $_POST['commenttext']; $username = $session->username;` $sql ="INSERT INTO comments VALUES ('$username','$commenttext')"; if (!@mysql_query($sql)) { echo 'Error adding query: ' . mysql_error(); header('main.php'); } } ?>
  7. Ok, so I know you have all seen this before. The user is only allowed to post a comment after being logged in, and once logged in he can post the comment, and after the comment is input into the DB it is output with his username, and a link to his profile. and that is exactly what I'm trying to do. A question. How do you keep the the users input in the form, assuming you submit it, but you are redirected back to the form because you were not logged in? I am going to accomplish this with two scripts, and a DB table. main.php <form action="comment_process.php" method="post" id="commentform"> <p><textarea name="commenttext" id="commenttext" cols="60" rows="10" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> <input type="hidden" name="comment_post_ID" value="13" /></p> </form> comment_process.php (processes the form, and inputs the info, redirecting it back to main.php) if(!$session->username) { header('main.php'); } // HELP!!!! // i need to input the $session->username into the DB as the 'username', and once complete redirect back to main. then back to main.php $query = "SELECT username FROM comments"; $result = mysql_query($query) or die('Error, query failed'); while($row = mysql_fetch_array($result)) { // MORE HELP! echo '<a href=\"userinfo.php?user=$session->username\">' . '$username ' </a>; // echo the $session->username with it linked to their profile } If I'm not clear, please ask questions, I'm going to work on it in here, so any help is appreciated.
  8. Oh, I see, well that sucks. Now that I've derailed this thread enough, I'll let you get back to the real question. Sorry bout that
  9. Oh, but I'm curious on tests? you couldn't blantantly cheat right there in class, copying homework, worksheets, etc.. can only get you so far. Ya it's bad thing to waste. It's getting so much harder (seems that way), pre-calculus with a hard teacher is a real challenge.
  10. I've been looking for a good script online that I can incorporate into my site that has all of these artibutes: does not affect url smooth transistion (some can be rough, i think, maybe it was the site, sorry for my ignorance) incorporates image into it (up, down/plus, negative) all similar to this website, but without the URL change Sorry if this question has been asked plenty of times before. Thanks.
  11. Just curious, sorry for the irrelevance, but... how do you cheat your way through math..?
  12. run phpinfo() umm, I"ve never seen this error before, but I suppose check with your host. Reread your code and make sure you've close tags, or any smaller errors? *shrug* good luck figuring it out.
  13. ^ Same Error A Miscellaneous error has rendered our website unavailable, it will be up again with the upmost punctuatation.
  14. Hmm, on second observation I guess it fits with the site, blends well, etc.. I just don't particularly care for it.
  15. VALUES('$name', '$last', '$gender', '$month', '$day') Wouldn't you need $? EDIT: nevermind it's been covered.
  16. He must be fixing it again because I looked a day ago and it was working fine.
  17. I should probably post the correct coding if anyone stumbles upon this later. $query = "SELECT username FROM users ORDER BY TIMESTAMP DESC LIMIT 1"; $result = mysql_query($query) or die('Error, query failed'); echo "$result";
  18. Like Barand said, give us an estimate of how long it will take YOU, and what you might be doing to recreate something like this. Then we can give a more accurate price. We'd only be speculating now.
  19. I have a timestamp set up for my users, so I'll go ahead and use that. Correct? $query = "SELECT 'username' FROM 'users' ORDER BY TIMESTAMP DESC LIMIT 1"; echo "$query";
  20. I am trying to add a feature to my website, and I'm curious how you would select the last entry or last id from your DB table and output the $username. I will be checking this again soon, but I've gotta go, and would like to work on it when I get back. Thanks.
  21. For overall look, the only thing I see that I don't particularly like is the banner, otherwise, nice color assortment. I haven't registered considering I have little time at the moment, but I will do so later. Will add more input later, as for now, good job.
  22. Yes it's possible, with 2 if statements you could achieve that. Or the database solution laffin showed you.
  23. unsider

    Colour Vote!

    I personally would like to see either Shadows Grey [#36393D] or Mozilla Blue [#3F4C6B] for the footer, allowing the white text to stand out a little more, and it would be a nice balance for the rest of the site.
  24. Making a website for your local congregational church, or just a personal project? Just curious
×
×
  • 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.