Jump to content

dgoosens

Members
  • Posts

    230
  • Joined

  • Last visited

Everything posted by dgoosens

  1. yes but then you need to use a form: <form method="GET" action="page2.php"> <input type="text" name="message" value="message"> <input type="submit" name="submit" value="Submit"> </form>
  2. Hi guys, Nobody has a clue ? thanks once more !
  3. hi freaks, This is my situation... I am trying to dive into Zend Framework and to do so I got Zend Framework in Action by Rob ALLEN. I am now playing around with Zend_Services, namely Zend_Service_Flickr. Everything works great, getting the images etc. But, as this is rather heavy, I'd need to cache my Flickr result. This is my Flickr class: class Flickr { protected $apikey; public function __construct() { $this->apikey = Zend_Registry::get('config')->flickr_api_key; } public function search($keywords, $amount = 6) { if(empty ($this->apikey)) { return null; } try { $flickr = new Zend_Service_Flickr($this->apikey); $results = $flickr->tagSearch($keywords, array( 'per_page' => $amount, 'tag_mode' => 'all', 'license' => 3 )); if($results->totalResults() > 0) { return $results; } } catch (Zend_Service_Exception $e) { return null; } return null; } } and this is the part of my controller that should deal with caching the result: $frontendOptions = array( 'lifetime' => 300, 'automatic_serialization' => true ); $backendOptions = array( 'cache_dir' => ROOT_DIR . '/var/cache/' ); $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions); if(!$results = $cache->load('flickr')) { $flickr = new Flickr; $results = $flickr->search($article->keywords); if($results != null) { $cache->save($results, 'flickr'); } } $this->view->flickr = $results; When there is no cache, the images show up without any problem. In my cache directory, two files are created: - zend_cache---flickr - zend_cache---internal-metadatas---flickr However, when reloading my page, and thus trying to get the data out of the cache, no images show up. When I print_r($this->result) in my view, I allways get the same array: Zend_Service_Flickr_ResultSet Object ( [totalResultsAvailable] => 139778 [totalResultsReturned] => 6 [firstResultPosition] => 1 [_results:protected] => DOMNodeList Object ( ) [_flickr:private] => Zend_Service_Flickr Object ( [apiKey] => XXXX_API_KEY_XXXX [_restClient:protected] => Zend_Rest_Client Object ( [_data:protected] => Array ( ) [_uri:protected] => Zend_Uri_Http Object ( [_username:protected] => [_password:protected] => [_host:protected] => www.flickr.com [_port:protected] => 80 [_path:protected] => /services/rest/ [_query:protected] => [_fragment:protected] => [_regex:protected] => Array ( [escaped] => %[[:xdigit:]]{2} [unreserved] => [A-Za-z0-9-_.!~*'()\[\]] [segment] => (?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])* [path] => (?:\/(??:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])*)?)+ [uric] => (?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\];\/?:@&=+$,]) ) [_scheme:protected] => http ) ) ) [_currentIndex:private] => 0 ) ... but the images just don't show up. Now, I am figuring that there might be some kind of problem with the serialization/unserialization of the Flickr object. Zend_Cache works fine - tried a string and an array. Any clues why the images just don't show up ? Thanks a lot in advance freaks ! dGo
  4. all the radio buttons should be part of the same form... thus you should move this line <form id="form4" name="form4" method="post" action=""> and this line </form> out of your loop
  5. Example::instance()->foo()->bar()->get()->something(); well, to put it simply it is "short" for this: $example = Example::instance(); $foo = $example->foo(); $bar = $foo->bar(); $get = $bar->get(); $something = $get->something();
  6. 1. make sure that everything is in UNICODE (scripts, headers, database...) 2. for Arabic, remember that it is a RTL language... if you designed your website correctly, it should not be hard to make the needed adaptations within the CSS (otherwise, you have a lot of work !) 3. next, there are quite a few ways to make a website multilingual. duplicate DB tables, duplicate DB columns, some frameworks offer a translate() function (Zend Framework at least) etc. etc.
  7. well it does state so it is quite logical that everything you try after that goes wrong... you can also try the new EasyPHP, if you are working in Winblows, obviously... http://www.easyphp.org/index.php
  8. hi, I am not sure... but I think PHPLIVEDOCX will be able to help you out: http://www.phplivedocx.org/2009/02/03/generate-pdf-docx-doc-and-rtf-files-with-php/ otherwise, go for the ODT format (OpenOffice) and use odtPHP http://www.odtphp.com/
  9. is php enabled in your Apache configuration ?
  10. I think the service is still active... and blocking port 80 if you can't find what goes wrong... you can always set another port for Apache for instance :8080
  11. in MySQL make the data DATETIME in PHP $date = date("Y-m-d H:i:s"); (for instance) http://uk.php.net/manual/en/function.date.php
  12. I personally have always been convinced that, one day, PHP would become more than just a web-language... I have been reading a little about PHP-GTK and am actually waiting for RoadSend to fully support GTK2. Next to that, M$ recently spent quite some money on PHP... and I wonder where that is going ? It would be nice to see projects as PHP4Mono go a little further and maybe allow, one day, to do full .NET development in our favorite language ?? Any thoughts on this ?
  13. that's because that is what you want from reading you style line you tell the hover applies only to "a" try td.hov:hover{...}
  14. well this simply says that you can not connect to your MySQL database... are you sure you changed the user and login details when transfering your scripts from localhost to the online server ?
  15. I believe that when you use Google Ads, you're not allowed to put any other kind of adds... But I can be wrong...
  16. have a look at this: http://www.phpfreaks.com/forums/index.php/topic,276321.msg1306903.html#msg1306903
  17. makes me think you have not included your db_connect.php file correctly... Check this... Maybe try by coding the $username, $password etc. directly in the file...
  18. we'd need to see the HTML code the script applies to...
  19. try mysql_connect('localhost',$username,$password); with the quotes
  20. if the name is in the $_SESSION then why are you using $_GET['name'] instead of $_SESSION['name'] ?
  21. well... as I said, the code is rather well documented: http://phpexcel.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=10718#DownloadId=90450 Otherwise, it should be possible to "convert" your HTML table into an Excel table just by changing the header to Content-Type: application/vnd.ms-excel
  22. http://www.codeplex.com/PHPExcel is exactly what you are looking for... I would not say it is "easy" though... but it allows you to do what you want in Excel with PHP... and it is really well documented...
  23. I think you'd be much better off with a PDF... Have a look at PHPLiveDocX http://www.phplivedocx.org/2009/02/03/generate-pdf-docx-doc-and-rtf-files-with-php/ Haven't used it in a while... so I am not aware of the latest modifications... But it used to work really nice...
  24. dgoosens

    cursor help

    use a little onload javascript that focuses on the scan box...
  25. hi, I might be wrong, but it seems to me that you are missing an argument here if(mail($to_email, $email_subject, $email_content, "-f$from_email")) Could you try like this: if(mail($to_email, $email_subject, $email_content, $from_email, "-fmartin@mcgdesignstudio.com"))
×
×
  • 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.