Jump to content

php_nub_qq

Members
  • Posts

    54
  • Joined

  • Last visited

php_nub_qq's Achievements

Member

Member (2/5)

0

Reputation

  1. Basically my website is worldwide and I need to be able to detect users' time zones and display accurate times. I have this really neat script which used to work flawlessly well until now. It needs a timezone offset which I fetch with javascript and pass through a cookie. if(!empty($_COOKIE['tz']) && $_COOKIE['tz']>=-12 && $_COOKIE['tz']<=13){ $offset = $_COOKIE['tz']; $tz = timezone_name_from_abbr(null, $offset * 3600, true); if($tz === false) $tz = timezone_name_from_abbr(null, $offset * 3600, false); date_default_timezone_set($tz); }else{ date_default_timezone_set('UTC'); } The problem is that currently the timezone I'm testing in is Europe/Helsinki, which is UTC+2 (without daylight savings), but for some reason timezone_name_from_abbr() decides 2*3600 is Europe/Paris. I'm really bad with dates and time zones, I desperately need help, please!
  2. You can't link external stuff in emails, the least it will treat it as spam if it accepts it at all.
  3. I started having this problem including my base css file into my emails when I minified it. After a brief research I found out that SMTP has a restriction on string length or columns. So I figured I need to add new lines to my css in order to be able to load it into the mails without it getting cut off. $css = str_replace('}',"}\r\n",file_get_contents(base.'css/style.css')); $html = "<style>{$css}</style> ......" style.css is a valid MINIFIED css file with about 9000 characters length. If I debug $css before sending the email I get the full length of the css, however if I inspect the email in my mailbox I see that there are new lines, but the css is still being cut off. If i beautify style.css then the whole style gets included? This is really confusing, I really need some help.. Thanks!
  4. Thank you for the reply #Ch0cu3r, I'm using a hosting service and I have no access to httpd.conf. I will ask them if the module is available, but it is a very popular hosting company so I truly believe it is. I will post again if I'm right and the cause of the problem is still unknown.
  5. I have just added, or tried to add, gzip compression to my website in order to make it faster. This is the code I have put into .htaccess <IfModule mod_deflate.c> #The following line is enough for .js and .css AddOutputFilter DEFLATE js css #The following line also enables compression by file content type, for the following list of Content-Type:s AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml #The following lines are to avoid bugs with some browsers BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html </IfModule> So now I'm using a firebug extension called PageSpeed to monitor gzip compression and it is not working. I also use http://gtmetrix.com/ and the results are the same. Can anyone explain to me what more I have to do to enable gzip compression? Big thanks!
  6. I gave up and tried jquery as well, it didn't work. SOP is causing the same errors
  7. I cannot access contentWindow of child, I get this Unsafe JavaScript attempt to access frame with URL file:///C:/blabla/chatHistory/history/08-05-2013.html from frame with URL file:///C:/blabla/chatHistory/index.html. Domains, protocols and ports must match.
  8. I know, but it is possibly a css/javascript/html issue and since html is in the center of all of that I thought I should post here. Anyway the problem is that these Iframes are OFFLINE. Users of my site have the option to download a full chat history to their computer and that consists of separate files for each day, if the user has not a strong enough machine to open them all at once, and a file which has all files ( whole history ) in it as IFRAMES because I know not of another way to include HTML into HTML without a server? And thus comes all my trouble of accessing child/parent frames I get a bunch of errors not allowing me to do anything... I'm starting to lose hope
  9. Hello. I had my doubts where to post this but anyway I am going insane because I have been struggling with this for more than 4 HOURS !!! I want to extend an IFRAME so that its height matches its content's height. I've crawled the whole entire web and read every single possible solution so you're my last hope. All solutions don't work in CHROME Please you're my last hope! EDIT: NO jquery
  10. when I do ini_set('memory_limit', '-1'); there is no error but the mail doesn't get sent, which I suppose is due to the mail size limit. I will contact my hosting provider to see if I can negotiate something. Thank you guys for all the help!
  11. That's not an option because the conversation is in the database and if I were to create a file on demand I would not be able to detect when it's download has been finished thus I cannot delete it, and even if I could if the user for some reason loses the file he has to generate a new one and that's just wasting resources and bandwidth, which is limited in my case. I just need to figure what's causing this error and how to prevent it and I'll manage from then on. REMINDER: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 76903277 bytes)
  12. Well is there any way I can verify the given maximum size of the outgoing emails? I also believe that the error I'm getting isn't related to this limit, and I'd really need help with that too. Thank you!
  13. How do I chunk it to 1MB and wouldn't that send 50 emails ( for 50 mb file ) ? Here's the code as well: $file = 'ads2.zip'; // 60mb file for testing purposes $file_name = $file; // file name and file path match $to = 'myemail@asd.com'; $subject = 'the subject'; $from = 'dgd@dgd.dgd'; $message = "<h1>some HTML</h1>"; $headers = "From: $from"; // boundary $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // headers for attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // multipart boundary $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"utf-8\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; $message .= "--{$mime_boundary}\n"; // preparing attachments $content = chunk_split(base64_encode(file_get_contents($file))); $message .= "Content-Type: {\"application/octet-stream\"};\n" . " name=\"$file_name\"\n" . "Content-Disposition: attachment;\n" . " filename=\"$file_name\"\n" . "Content-Transfer-Encoding: base64\n\n" . $content . "\n\n"; // send $ok = @mail($to, $subject, $message, $headers); if ($ok) { echo "<p>mail sent to $to!</p>"; } else { echo "<p>mail could not be sent!</p>"; } the code is gotten from here https://gist.github.com/optikalefx/5149537 and was modified a little
  14. Hi, I recently made a function to my website where users can download a full chat history with a certain friend of theirs instead of just showing the whole history in the browser and most probably crashing it ( if they've chatted for quite some time ). So everything works well except the fact that I can't send large files. I suppose the largest I could send was 10mb or something like that ( could be lying ). Anyway that's way less than I need so it doesn't really matter. What I need is to be able to send around 50mb of data and I believe the changes that need to be done are a matter of the mailing server. Unfortunately I'm using a hosting service and I have limited access to those things. Can anyone help me out? EDIT: I just saw that the allowed size is in the error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 76903277 bytes) EDIT 2: Actually the allowed is larger than the filesize, now I'm confused
×
×
  • 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.