Jump to content

unsider

Members
  • Posts

    610
  • Joined

  • Last visited

    Never

Everything posted by unsider

  1. Like daniel0 said, any error messages, anything else for us to go on, there may be dozens of possible problems, possibly even out of our scope.
  2. They're working on the site, it will most likely be back soon.
  3. This will be my last post, I'm going out for a bit. Here is what you need to do set values for the cookie setcookie(name,value,expire,path,domain,secure) <?php $value = "cookie value"; // cookie that expires in 24 hours setcookie("valid_user",$value, time()+3600*24); ?> <?php // Print cookie echo $_COOKIE["valid_user"]; echo "<br />"; echo $HTTP_COOKIE_VARS["valid_user"]; echo "<br />"; print_r($_COOKIE); ?> wrote this pretty quickly, so might include some type of syntax errors, but maybe another user will be able to help you. Sorry I couldn't do more, if you're still having trouble when I get back I can try to help, otherwise, good luck.
  4. I don't see any error, I'll keep looking, but it looks as if everything would work properly.
  5. whereyoustarted.php <?php if (isset($_COOKIE["valid_user"])) { // show content } else { header("whereyouwannago.php"); } ?> whereyouwannago.php <?php setcookie( /* set whatever */ ); header("whereyoustarted.php"); ?> From that point the content will be showed. Until the user deletes the cookie, and you can choose to destroy the cookie within a specific time frame, etc.., plenty of possiblities. I don't have much time, and I'm not exactly sure what you want to do, but that's the most basic layout for this type of activity. And I don't want your money, go learn though. This stuff is pretty simple.
  6. Look up on: 1. cookies 2. if(isSet(....) { // content } else { 3. header("blah.php"); } 4. if statements It checks if the cookie has been set, if not it most likely uses header to redirect you. I would write a script, but I think it'd be better for you to look up a few things and learn about it, and then come back for questions.
  7. Thanks, ya I will eventually be looking into learning some OOP for frameworks, so I'll keep that in mind, but as of now, I'm not at that stage.
  8. I will not be able to bring a computer, but I will have plenty of free time at the hotel room before sleep, and I want to bring a book so that I can learn some things. (Trying to learn as much as possible, as quickly as possible). I currently have three, but unfortunately this is a school trip so I'm being limited to one carry-one (limited space). Note: My goal is to learn how to make a site function effeciiently and properly, best coding techniques, and plenty of material for learning everything from global arrays to sessions, to cookies, etc. Very little OOP, considering I'm not dealing that right now. Thanks.
  9. Ok. So let's assume I have three users. Tim Bob Chad They each are allowed to post comments once they have registered. Well once they post, there $_SESSION['username'] is displayed, and with it a link to their 'profile'. That's where the error is. EDIT: no error in code, just the manner in which it functions, continue reading. <?php $username = $_SESSION['username']; while($row = mysql_fetch_array($result)) { echo '<tr class="tr' . $tr . '"><td>' . '<img src="http://example.com/main/images/post.gif">' . "<a href='userinfo.php?user=$username'>" . $row["username"] . '</a>' . '<br>' . ' posted on: ' . '<br><br>' . ' ' . $row["commenttext"] . '</td></tr>'; ?> If no user is not logged in, it displays to everyone: http://example.com/main/userinfo.php?user=Guest If the user is logged in as Tim, but clicks the link to Bob's profile it displays his (Tim's) profile. And vise versa. I am trying to establish unique properties between each user, so that no matter who you are logged in as, you will be able to view that person's profile. I unfortunately do not know how to explain this, but think of this website, you can be logged on and click on someone else's profile and view their info. Ask questions if I have not clarified something correctly, otherwise, I really need help with this problem.
  10. Thanks all, it does help, and that was the problem
  11. I currently am trying to create a more interconnected site, and what better way to do that than to have a link to that particular user's profile than when he submits a comment. The link to his profile will be in in his username, I'm sure you've all seen a system that works this way. <a href="example.com/main/index.php?userinfo=$displayed username">$displayed username</a> Excerpt from code, but it's all that is necessary. <?php $query = "SELECT id, commenttext, username FROM comments LIMIT $offset, $rowsPerPage"; $result = mysql_query($query) or die('Error, query failed'); echo '<table div class="tborder">'; $username = $_SESSION['username']; while($row = mysql_fetch_array($result)) { echo '<tr class="tr' . $tr . '"><td>' . '<img src="http://example.com/main/images/post.gif">' . '<a href="userinfo.php?user=$username">' . $row["username"] . '</a>' . '<br>' . ' posted on: ' . '<br><br>' . ' ' . $row["commenttext"] . '</td></tr>'; // etc.... ?> NO ERRORS, but this is the URL it displays: http://example.com/main/userinfo.php?user=$username Any help is appreciated.
  12. I enjoyed that album more than I thought I would've, mainly because of the stuff they had put out prior to the album release/ I thought it was possible (not likely), but possible that they might create an album similar to the song "Country Boner" (which I did not like) - considering maynard's sense of humor.
  13. Still haven't found anything. Bump.
  14. Not sure that I really know what genres things like Tool and Radiohead fall in, but I'd say my favorite has to be Electonic, and hate to use the term IDM. Similar to Aphex Twin, it just fascinates me.
  15. Does it really matter, by random I'm guessing you wouldn't know the output anyway so would you be fine with a mathematical extraction? Example: every odd, every other odd, etc... That's the only other possible solution I know of. How large is this database exactly? I'd just google search some possible alternatives. or mysql.com?
  16. I only noticed one thing, isn't it more proper to use || as opposed to AND? Two different things && = AND || = OR Oh whoops, I'm glad you caught me, that would have been a horrible mistake.
  17. Ran into a problem. About to go read up on it, but I figure I can do two things at once. $self = $_SERVER['HTTP_HOST']; echo '<a href="$self\star_rating.php">Star Rating</a>'; URL Output: http://example.com/main/$self/index.php
  18. Hmm, that simple? I suppose I expected something more. Maybe I should go do some more reading.
  19. No one else wants to discuss their music
  20. Noticed that as well. $username = $_POST['username'];
  21. I only noticed one thing, isn't it more proper to use || as opposed to AND?
  22. K, let's assume that i am currently using example.com/main/index.php as my index page. If I call $_SERVER['PHP_SELF'] It returns example.com/main/index.php/..... correct? Well is it possible to load just example.com/ as opposed to the full filepath from this? Is so, how?
  23. like a footer? // html code <div id='footer'> // define properties, place at bottom, etc.. <?php // code here, displayed at bottom ?> </div> I think you may need to do some more reading you don't know how to place php at the bottom of a page. Sorry if that came off as rude.
×
×
  • 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.