Jump to content

dgoosens

Members
  • Posts

    230
  • Joined

  • Last visited

Everything posted by dgoosens

  1. I guess you forgot this then: $result = mysql_query('SET NAMES utf8'); $result = mysql_query('SET CHARACTER SET utf8'); read the whole page !!
  2. if you work in Unicode, you will not have to worry about this. Have a look here: http://www.richnetapps.com/php-mysql-speak-unicode/ Basically, 1. use the mb_ string functions in PHP 2. make sure your DB uses the Unicode charset 3. make sure your HTML has the correct UTF-8 header If you do all of this... you will not have to convert anything
  3. hi freaks, Not quite sure if this is the correct place for this... So my apologies if it isn't. I just stumbled upon a very nice, and in my opinion, helpful application to easily create website wireframes. http://pencil.evolus.vn/en-US/Home.aspx Up to now I had always been doing this with Inkscape... and this just is not that easy. Pencil functions as a standalone app. or as a FireFox extension (download the version of the website, not from the Mozilla website, it is not up to date). Hope other freaks will find this helpful... dGo
  4. lol little disappointed here guys... not one reply... was it that mysterious or unclear ??? well anyway, it seems like I've found a workable solution here http://w-shadow.com/blog/2007/10/16/how-to-run-a-php-script-in-the-background/ the annoying part is that I have to serialize() and urlencode() my params in the URL... is there a smarter way to pass the params along with the request ? // sendaction public function sendAction() { $this->_helper->getHelper('layout')->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $mailId = $this->_request->getParam('mailId'); $session = Zend_Registry::get(Zend_Registry::get('sessionName')); $mailContacts = $session->mailContacts; $senderDetails = $session->senderDetails; $url = $this->_helper->url('sendmails', 'mails', 'wikiwi', array( 'mailId' => $mailId, 'dGoKey' => md5('W!kiwI2401198dG0'), 'senderdetails' => urlencode(serialize($senderDetails)), 'contacts' => urlencode(serialize($mailContacts)))); if(self::backgroundPost($url, $senderDetails, $mailContacts)) { $this->_helper->FlashMessenger('L\'envoi du mailing a commencé.'); $this->_helper->redirector('index'); } } the contacts array could contain thousands of entries... and it seems that this way of doing is kind of limited... any ideas ? thanks dGo
  5. hi freaks, 43 views... no replies... all ideas are welcome, even bad ones !! the basic question is: Is it possible to launch a PHP script on the server without it "bothering" the user ? thanks, dGo
  6. me again... so I tried another way and implemented the following JQuery script: <script type="text/javascript"> $(function(){ $('#sendMailing').click(function(){ $(location).attr('href', '/wikiwi/mails/'); $.ajax({ url: "/wikiwi/mails/asyncsend/mailId/<?php echo $this->mailId; ?>", }); return false; }); }); </script> this seems to work... although... can I be sure that the mails will be sent this way ? Also, I am facing a new problem... as long as the mails aren't sent, it seems that I am unable to navigate to any other page... I am not quite sure I understand where this new issue comes from... why is it the server does not accept any other calls while the mails are being sent ? any help would be greatly appreciated... thanks dGo
  7. hi freaks, I have spend two days on this and did not find any solution yet... Hope you can help me out here. This is the situation: For one of my customers I need to create an interface for sending newsletters. I am working with Zend Framework 1.10 for this... The last step of the whole process is the sending... Knowing there might be thousands of contacts, I do not want to wait for it to be done... Thus, I'd need to have the sendAction() to run in the background (quite easy - even if I close the browser the mails are sent)... and redirect the user to the indexAction() immediately. I have been trying to do this with JQuery and an ajax call... To do so, I figured I'd just have to disable the buffering protected function _initDisableoutputbuffering() { $fc = Zend_Controller_Front::getInstance(); $fc->setParam('disableOutputBuffering', true); } in the bootstrap and use ob_flush(); flush(); in the action to send a simple "ok" public function asyncsendAction() { $this->_helper->getHelper('layout')->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $mailId = $this->_request->getParam('mailId'); $this->_helper->FlashMessenger('The mails are being sent now... You\'ll be notified by mail when it is done.'); echo "ok"; ob_flush(); flush(); $i = 0; // simple test send while($i < 15) { $mail = new Zend_Mail('utf-8'); $mail->setBodyHtml('test test'); $mail->setFrom('me@me.com', 'me'); $mail->addTo('you@you.com'); $mail->setSubject('test' . $i); $mail->send(); $i++; } } to the ajax script which would then redirect: <script type="text/javascript"> $(function(){ $('#sendMailing').click(function(){ $.ajax({ url: "/site/mails/asyncsend/mailId/<?php echo $this->mailId; ?>", success: function(data) { if(data == "ok") { $(location).attr('href', '/site/mails/'); } } }); return false; }); }); </script> I think I tried a thousand possible variations on this... but it simply does not work. The redirect is working, but only when all the mails have been sent. This does not have anything to do with my PHP.ini settings as the output_buffer is set on "off". So, either it is the browser that does not want to redirect before the end of the action OR it is my Action that is not sending the "ok" before the end of it. I know I could handle this with a cron job... But I would really like to avoid this as much as possible. Any of you have any thoughts on this ? Thanks, dGo ps: do not worry, this app will not be used for spamming I would not want to develop it otherwise.
  8. have a look at this: http://adldap.sourceforge.net/
  9. no, there is nothing to change in your form script... but you should write a little function that returns a valid XML containing the form input then you'll be able to attach this XML file to the mail (I'd suggest you ZIP it though)
  10. maybe a PHP timout then or something like that... I can't see anything in your code that would cause this... try to alter your PHP limits with ini_set(); http://uk.php.net/manual/en/function.ini-set.php or directly in your php.ini file (if you have access to it)
  11. it is because of the float in this CSS property: .groupShip .groupShipAddressBox .header p
  12. have a look at XMLWriter http://uk.php.net/manual/en/book.xmlwriter.php or at the Document Object Model (DOM) http://uk.php.net/manual/en/book.dom.php both are rather easy to use...
  13. looks like a Google limitation... I am not aware of how much you are allowed to "ask" them
  14. ok... I think I start to get this... I would, in this case, create a column for each type of finish... this will make your queries much simpler.
  15. you are right... they are not needed... sorry about that
  16. the length of the text should not be an issue... try like this: function content1($txtid, $txt) { global $txtid; global $txt; return '<div class="contentbox" id="'.$txtid.'">' . translate($txt, $txtid) . '</div>'; } and function translate($txt, $txtid) { // [...] return ' <!-- MESSAGE TRANSLATION STARTS--> <script type="text/javascript"> google.load("language", "1"); function toptext() { google.language.translate("'.$txt.'", "en", "'.$lang.'", function(welcomemsg) { if (!welcomemsg.error) { var container = document.getElementById("'.$txtid.'"); container.innerHTML = welcomemsg.translation; } }); } google.setOnLoadCallback(toptext); </script> <!-- MESSAGE TRANSLATION ENDS--> '; }
  17. $sql="SELECT '<column_name>' FROM $tbl_name ORDER BY fid"; for instance $sql="SELECT 'forum' FROM $tbl_name ORDER BY fid"; and if you want more than one column, concatenate them with a comma: $sql="SELECT 'fid', 'forum' FROM $tbl_name ORDER BY fid";
  18. hi, maybe you could post us your database table definition... that should help
  19. depends on what you are trying to achieve... this kind of things should be possible with Java or Flash... client side scripting languages
  20. well that would be the kind of limitation one could eventually encounter on Windows... but never heard about something like that for PHP... sounds like nonsense I am guessing there is something wrong with your code... but you should post it so that we could have a look at it...
  21. indeed the script runs on the server and it is impossible for it to directly interact with you personal computer... this can not be done with PHP...
  22. don't forget to change if (count($where) > 0) $q = substr($q,0,-4); into if (count($where) > 0) $q = substr($q,0,-3); as OR is one letter shorter
  23. Oh... just got it... in fact, it is because you print out everything right away try something like this: while ($i < $num) { $f1=mysql_result($result,$i,"first"); $i++; $xml[] = simplexml_load_file("http://xboxapi.duncanmackenzie.net/gamertag.ashx?GamerTag=".urlencode($f1)); } then, after that, do a foreach loop on $xml and then you'll be able to put them aside as I explained above
  24. what output are you getting ? and... on an other matter... try to avoid this kind of inline styling in your html: <table border="2" cellspacing="2" cellpadding="2"> <th><font face="Arial, Helvetica, sans-serif">Tag</font></th> [...] do use CSS, inline if you like: <table style="border:2px solid #000000; margin:2px; padding:2px;"> <th style="font-family:Arial, Helvetica, sans-serif;">Tag</th> [...]
×
×
  • 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.