Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. 1) There is a sticky in this forum for webhosts. 2) Yes, guaranteed ram, at least on the surface anyways, is better than straight shared ram. Basically what guaranteed ram means is that even if some other person/company sharing the server is being a ram hog, it should only affect your website's performance so much, because you are guaranteed to be allotted at least X, as opposed to on a straight shared server where if someone is being a ram hog for whatever reason, it could cause your website to not be served at all. On the surface that seems cool, but I mean come on. If someone on your shared server is being a memory hog on purpose or maybe someone targeted him for a DNS attack or whatever reason out there that they are consuming ram, there's a really good possibility that no matter what, you're gonna feel it. And if they are not being a memory hog for whatever reason, you're not gonna feel it. So overall, "guaranteed ram" is more of a gimmick. It's technically true, but you pretty much face the same conditions whether you have it or not.
  2. well according to the script you posted there is no username session var. You used $_SESSION['logged'] so shouldn't you be checking for that?
  3. .josh

    Javascript

    I'm fairly certain that the default for JS has been 'enabled' for a while now, for all the major browsers. I could be wrong, but I do clean installs of FF, IE and Opera on a reg basis and I don't really remember having to enable it. http://www.w3schools.com/browsers/browsers_stats.asp If you scroll down a bit you will see that % of people who have it disabled are pretty low, and though I don't have any hard facts to back it up, I have a sneaking suspicion that most of those people are of the senior citizen variety, who don't really know anything about it and probably rarely even open their browser all that often to begin with. IMO. While it is always a necessity to guard against exploits (by doing form validation on the server, etc..) I think we are long past the "Javascript is EVIIIIIL" phase... And TBH, I think the worse threat during "that time" was from like, applets and activeX controls, and TBH I think javascript just kind of got thrown into the mix more than it should have, due to people's ignorance.
  4. you sanitize a variable to prevent sql injection attacks. you use die/trigger_error for error handling to not only make your life easier for debugging, but also to control what happens and what's being shown to the user when errors happen.
  5. I don't know, but I do seem to see a fairly steady amount of complaints about goDaddy, in general. I think I would start out by coding $message in a cleaner way, like using heredoc syntax. But uh, so I was looking at your table tags and stuff, and it seems that there are 2 tr tags that should be closing tags instead of opening tags. That might possibly have something to do with it, though I can't really explain why it would randomly work or not work.
  6. print($_GET['gold'])
  7. would help if you told us what the error is.
  8. Ah you guys are right, I guess I had a foobar moment. I checked the manual and there it was, just like you said. Thing is, I already knew that...don't know what caused me to think that right now...maybe it's cuz I haven't gone to bed yet...
  9. I don't think he's trying to do bb codes I think he's trying to keep his text from losing his html tags so he thinks if he replaces them with non-html tags they will be marked and he can later convert them back...which is in essence what bb code does, but I think he's just wanting to preserve his format.
  10. He had it right the first time. You use mysql_num_rows on the result source, not the query string. re: "Even if info is correct, they still get redirected back to login page" Do you have session_start() before trying to logged in check on userpage.php? If so, please post the part of your userpage.php that checks whether someone is logged in or not.
  11. best resource ever
  12. mysql_query will return a result source on a select query if results are returned, and FALSE if nothing is returned. If nothing is returned, your condition should fail. Your code block is written correctly, which means the problem is not in the condition, but somewhere else. Perhaps you can start with doing some kind of var dump on $result inside the condition (comment out the redirect, of course), and taking a look at what's being returned.
  13. The idea is that you have one variable and the value of that variable is the state code for the current iteration of your loop that lists the states out. You already have that variable somewhere in your script. That is, whichever variable you use in your script to print out "AZ" or "TX" or "FL", that's the variable I'm talking about. But let's assume it's called $statecode. And the goal here is that you have a list and it's saying for instance AZ AZ AZ TX .. oh damn, we hit TX, let's make a new div, right? So the idea is that inside your loop that's listing things out, you assign $statecode to another variable, which we will call $currentcode ($currentcode = $statecode;). But before we actually do that, we are first going to compare those two variables (if ($currentcode != $statecode)). If those two variables do not equal each other, it means that your state code has changed from AZ to TX. We use $currentcode as a means for php to 'remember' what the previous state code was, before you had it move on to the next entry. That's why we assign $statecode to $currentcode after the condition instead of before. If you assign it before the condition and then run the condition, it's always going to be true, and your "make a new div" code will execute every loop iteration. If we put it after the condition, the values will be staggered when the loop gets to a new entry. $statecode was AZ but the next entry (next loop iteration) will now assign TX to $statecode, and then we will compare it to $currentcode, which will still be AZ, because we are comparing it before assigning the new value to it. If they are not equal, that's where we want to make a new div. The only thing you should have to do is somewhere inside your while loop (after the $statecode var is assigned, if it's not being assigned in the loop condition itself), is drop in that code I provided before. Just change $statecode to whatever the real variable is, and put the actual echo "</div><div>"; code inside the if statement, and you should be good to go. So...I'm really not sure what you mean by "I don't get it." If all that typing did not somehow enlighten your status of not getting it, then perhaps you need to let me know what exactly it is you don't get?
  14. okay it looks like $username is not showing up for the same reason as opi: you need to use $_POST['username'] in the appropriate place(s) because that's what your form var is going to be called when the form is submitted. I also notice in your insert query you have a bunch of $a7xx vars being inserted but I don't see anywhere in that script where those are coming from, be it a form or some other assignment; that is, the only place in your script I see mention of those vars is in your insert query, so unless those vars are somehow being assigned in your require files at the top of your script, nothing is going to be inserted into the db in those fields.
  15. Well the code you posted here looks like it's been changed alot from the code in that link, so perhaps you should post your most current version?
  16. and you are using $_POST['opi'] right? If so, then we're going to have to move on to looking at football-predictions.php
  17. and anyways, what's wrong with resorting to flash? Your clock would look cleaner, since it's vector based, and it puts the processing load onto the client instead of the server, and it keeps your script from constantly requesting the server...
  18. well you could like, do a meta tag refresh for every like, 1 second...
  19. What about your other hidden var username? is that going through? If not, perhaps your condition is somehow not being met.
  20. well if it were a matter of permissions it would say something like access denied but 404 means it's not found at all so either the path or the file itself is not being recognized. Perhaps on your server it is logo.JPG instead of .jpg? edit: actually I'm getting a 404 even just trying ../assets/ with no filename so for some reason it's not recognizing your folder
  21. Nope. You can't get it to keep running (refreshing) w/out client constantly sending a request. You could make a cronjob to constantly execute it but that's not really relevant to your problem... edit: And on that note, I would suggest you consider putting even more of it onto the client. Like for instance, making a swf that does the same thing and just imbedding it.
  22. view source shows me this: <div><table bgcolor="black" width="92%"> <tbody style="text-align: center;"> <tr id="header" width="100%" height="64"> <td width="25%"><img src="../assets/logo.jpg"></td> <td width="50%"><img src="../assets/header1.jpg"> <img src="../assets/header3.jpg"> <img src="../assets/header6.jpg"> <img src="../assets/header7.jpg"> <img src="../assets/header4.jpg"> <img src="../assets/header5.jpg"> </td> <td width="25%"><img src="../assets/peaceful.jpg"></td> </tr> </tbody> </table></div> is that not from your header.php? edit: and I'm getting a 404 on http:// apeacefulpride dot com /assets /logo dot jpg so I assume the trouble might be a wrong path
  23. I'm not really gonna go through your code to figure out which var actually holds your state code, but assuming it's called for example $statecode, just include inside your loop something like this: (pseudo code) while (blahblahblah) { if ($currentcode != $statecode) { // end prev div and start new one here } $currentcode = $statecode; // rest of code here }
  24. also just fyi you should look into mysql_fetch_assoc instead of using a combo of _num_rows and mysql_result. It's cleaner and much more efficient. <?php mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbactual); $query = "SELECT * FROM logs WHERE level = 8"; $result = mysql_query($query); echo "<table><tr>"; echo "<td><strong>Log ID</strong></td><td><strong>User</strong></td><td><strong>User Level</strong></td><td><strong>Date</strong></td><td><strong>Time</strong></td><td><strong>Action</strong></td></tr>"; while ($r = mysql_fetch_assoc($result)) { extract($r); echo "<tr><td>$id</td><td>$user_id</td><td>$level</td><td>$date</td><td>$time</td><td>$action</td></tr>"; } echo "</table>"; ?>
  25. you never increment $i
×
×
  • 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.