Jump to content

SuperBlue

Members
  • Posts

    305
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

SuperBlue's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok. I'm pretty sure i have this problem solved now. Turned out the location header alone was redirecting trough a 302 response, rather than a 303. After i added the 303 thing, everything now appears to behave as expected. If the server just responds with a 302, it appears that the browser just re-loads the page from the cache, without performing the re-validation that the server originally requested for the given page. When using a 303 however, it would seem that it properly re-checks the cache headers of the page.
  2. Its a very bad idea to just place your CSS directly in a style element on your page. It does make each of your pages load faster, but when you got multiple pages using the same CSS, it quickly starts to load slower than it would with External CSS files. That's because these External files are cached by the browser. If you just got a single page, then its fine to just throw in your CSS in a style element on the page, and save the time involved in making another HTTP Request. You can however minimize your CSS files dynamically on the server-side, removing all white space and linebreaks. This can sometimes provide a huge performance increase, and still maintain readability in the raw files. Obviously it takes a little server CPU to process the files, so you shouldn't do this if your server doesn't have the resources. But for most sites, this won't be an issue, not even on shared hosts. You basically just need to deliver the correct Content-type, in this case text/css for CSS files. But you would also want to control the caching of the files manually, either based on the last-edited tag of the files themselves, or from a timestamp saved in your database. You could even save a minimized version of your CSS and deliver this directly, which would save you CPU on the minimizing process. Without the caching, there's little point using PHP to minimize the files, since the browser would just re-download the files on each request, rather than using the version from the cache. The same can be done to markup such as HTML, but this would likely require that you output the entire page at once, similar to whats done in python. For example, if you got the entire page in a variable, then its easy to remove whitespace and linebreaks where you don't want them, and increase the speed for your site even more. Can be done in PHP as well, but you would most likely want a better approach, than just escaping in and out of your HTML/Markup.
  3. Its better to just install a free CMS solution, then mess with these poor WYSIWYG tools, but even then you must be careful with the WYSIWYG tools in the CMS system. Not all CMS systems handle WYSIWYG very well, and likely most of them will still provide features in their WYSIWYG modules that shouldn't be there in the first place, simply because a user wouldn't be able to use them currectly. Beginners often make the mistake to assume that WYSIWYG tools will let them create their own website, without knowing HTML/CSS. Of cause its possible, but you mostly end up with invalid HTML, often using div in place of p and crap like that. I've even seen cases where someone would use blockquote to force indention of elements, and this is even a default feature provided in the WYSIWYG editor for indention in their CMS, (a very expensive CMS I'd might add).
  4. Yes only the LAN clients are effected. I disabled all security in the router for now, until i figure out what is going on. The router has the ability to run a loopback test, which returns with a success message. I also updated the firmware, and had to restart the router in that process, so regardless if that solved the problem, the restart it self has solved it temporarily. I'll likely get back if it turns out the update didn't fix it.
  5. Sometimes we cant access the HTTP server from its own WAN IP, this goes both when trying to enter the WAN in the browser (should throw a 403), and when trying the hosted domains. The only way to solve the problem that i know of, is to turn off the router and turn it on again (not the same as a settings reset), this is of cause a smaller inconvenience. When i try to access one of the hosted websites, or the WAN IP from the server, i simply get a connection time out error, like a firewall has blocked connections from the WAN IP. But there's no software firewall running on the server. People from the outside can still access the websites, and i can also access the websites if i use a proxy server. Pinging the WAN ip of the server, from the server also works, so it seems its only related to HTTP access for now. I made sure that the firewall in the router was disabled, and that DoS prevention was disabled as well. I was thinking that perhaps the router accidentally blocked the WAN, but that doesn't seem to be the problem. The LAN IP of the server is reserved to the MAC address of the server, but i also don't think this can be the problem, since the server still gets connections from the outside. In other words, i don't think its a conflict on the LAN. Another thing i don't really get, is why the memory usage in the router is at an all-time high, about (95%). We only got a few PCs connected.
  6. I'm having a problem with a bit of code, which works for everything else, but just doesn't work when used for deletion of comments. The relevant code: mysql_query("UPDATE $table SET LastEdited = '$time' WHERE PID = '$ID'", $Connection) or die(mysql_error()); header('Location: /'. $URL; This works, the resource is getting updated. What doesn't work is the revalidation after the redirect. The code I'm using for caching is: header("Cache-Control: must-revalidate"); header("Last-Modified: ".gmdate("D, d M Y H:i:s", $Header['LTIME'])." GMT"); header("Etag: $etag"); header('Content-type: text/html; charset=UTF-8'); if ((@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $Header['LTIME']) && ( trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag)) { header("HTTP/1.1 304 Not Modified"); exit; } Its the exact same code used when posting comments on the site, aside from the query of cause. What i don't get, is why i have to hit update in my browser, to get it to re-validate. The $etag will only be updated if the sites source have been changed.
  7. You just need to apply a min-width to your accountContent, a width would also work, but it depends on what you want to accomplish. Also remember that margin: 0 auto; will center the div. IE6 will need text-align:center; on the parent.
  8. I'd recommend a fixed min-width and a max-width, and a percentage value for the width property.. Then simply throw IE6 a fixed width in a conditional comment, and advice users to upgrade on a support page or something. Keep in mind that resolutions change over time, and are likely to continue to do so for at least years to come.
  9. You are right, strange though, because i was pretty sure i tested this when i first wrote it.. I think i have this thing figured out, i need to have e ^ for start, and $ for end, otherwise it will return true if a matching pattern was found anywhere in the string. if (preg_match("/^[a-zA-Z0-9]+$/", $_POST['title'])) { echo $_POST['title'];exit(); } Thanks.. Well now i finally get when to include the start and end stuff.
  10. I had some code that I'm pretty sure used to work, basically something like the below. if (preg_match("/[a-zA-Z0-9]+/", $_POST['title'])) { echo $_POST['title'];exit(); } Now i just don't get why it always returns true, even when entering special characters like "!#%?".. The only thing which comes to mind, is that i recently made a move to UTF-8..
  11. Ok i found a solution to my problem, I'm almost sure that this is a bug in phpMyAdmin. In any case, what i did to solve the problem, was to follow a suggestion posted on this forum http://www.developpez.net/forums/d105647-2/php/outils/phpmyadmin/utf-8-phpmyadmin-problemes-dencodage/ I can't quite make out what these people are saying, but i understood the "Merci" part, so I'll better pick up that French book again sometime. Anyway, a modification to mysql.dbi.lib.php was needed, and i just inserted the below, just before "return $link;" in the PMA_DBI_connect function. The mysql.dbi.lib.php file is located in libraries/dbi. mysql_query("SET SESSION CHARACTER_SET_RESULTS =latin1;",$link); mysql_query("SET SESSION CHARACTER_SET_CLIENT =latin1;",$link); I hate using code i don't understand, and i don't understand why they would set the character set to latin1, when its utf8 they want. But in any case, phpMyAdmin seems to be correctly saving data in UTF-8 now, and i got the desired output, so i guess this is solved, for now..
  12. Just located some information, which might be relevant. http://wiki.phpmyadmin.net/pma/garbled_data Turns out they had an old closed bug report, where this link was posted. Maybe I'll find a solution there.
  13. I'm not sure how those links should help me, mostly they contain stuff i already know (never mind the specifics, who cares about that anyway). What i want to know, is why phpMyAdmin submits the data in a wrong character set. I even tried to force my Browser to use UTF-8, but phpMyAdmin will still submit in the wrong format. I also checked in the /setup directory, and it was correctly set to use UTF-8, its also setup to use UTF-8 for MySQL connection collation. I'm not sure where else to check. And I've verified that the data that I'm submitting from my own scripts is valid UTF-8. I only got a problem with phpMyAdmin.
  14. I just successfully validated content submitted from the website, wheres the content that i submitted from phpMyAdmin fails validation. So i must have missed a setting for phpMyAdmin somewhere.
  15. I recently discovered doing a checkup in phpMyAdmin, that i couldn't enter danish letters directly from phpMyAdmin, and still have them show up correctly on my site. I suspect it must be a server configuration, or bug with phpMyAdmin it self. Isn't UTF-8 supposed to support these letters, without having to use their HTML entities? The problem is.. I can post these characters in comments from the website, and they will also show up correctly. But then they will be messed up when viewed from within phpMyAdmin. The really strange part is, when i submit these characters from phpMyAdmin, then it will be the other way around, and they will just show up as � when viewed on the website. The MYSQL default character set is UTF-8, inside of my.ini. And i also tried to change the Collation of the table, and the effected field from latin1_swedish_ci to utf8_general_ci, which made no difference whatsoever.
×
×
  • 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.