[PHP] displaying flash from db
Hi all! Does anyone know where can i find some information about displaying flash from a db? I'm breaking my head over it, searching at newsgroups, searching at the net, addressing newsgroups but still nothing! Help b4 im cutting my hands off!!! With hopes to be saved :P Yonatan Ben-Nes
[PHP] CURL + https
Hi, I'm currently building an e-commerce site and I need to create the connection between the site and the server which validate the credit card. I'm trying to do it with CURL which will post all the information from a secured page (https) to another secure page, the code that i succeded to create so far is able to send from one secured page to another at my server but from some reason isnt able to connect to the cc server, when i tried to use curl through the shell i succeded to connect. The code that im trying is (i reduced the amount of variables for the snippet): $OrderID = "OrderID=".$OrderID."&"; $total = "total=".$total."&"; $URL = "URL=http://www.curtaincallproductions.com/ccall08/html/order/auth.phtml&";; $email = "email=".$b_email."&"; $Cardnum1 = "Cardnum1=".$Cardnum[1]."&"; $Cardnum2 = "Cardnum2=".$Cardnum[2]."&"; $Cardnum3 = "Cardnum3=".$Cardnum[3]."&"; $Cardnum4 = "Cardnum4=".$Cardnum[4]."&"; $Cardname = "Cardname=".$Cardname; $params = $OrderID.$total.$URL.$email.$Cardnum1.$Cardnum2.$Cardnum3.$Cardnum4.$Cardname; $params = str_replace(" ", "%20", $params); $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $ch = curl_init('https://www.goemerchant7.com/cgi-bin/gateway/direct.cgi'); curl_setopt($ch, CURLOPT_POST, 1); // make a regular post curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); //"user-agent" header to be used curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $result = curl_exec ($ch); curl_close ($ch); } Anyone know what can be the problem? I also know that if i just create a static form which post to the cc server the cc return me an error, with curl i cant know what is the error... or can i? Thanks Alot in advance, -- "My friends are worth gold to me, so I prefer to sell them and get rich!" Ben-Nes Yonatan Canaan Surfing Ltd Tel: 972-4-6991122 Fax: 972-4-6990098 http://sites.canaan.co.il --
Re: [PHP] CURL + https
well when i try to work with curl through the shell it work fine without any problems more then that when i use the curl with php at my server to another page at my server its working fine also, just when i try to use it through php it make the problems so i think that its installed, or i mistake? - Original Message - From: "Marek Kilimajer" <[EMAIL PROTECTED]> To: "Yonatan Ben-Nes" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, October 01, 2003 1:04 PM Subject: Re: [PHP] CURL + https > Did you compile php with openssl support? > > Yonatan Ben-Nes wrote: > > > Hi, > > > > I'm currently building an e-commerce site and I need to create the connection between the site and the server which validate the credit card. > > I'm trying to do it with CURL which will post all the information from a secured page (https) to another secure page, the code that i succeded to create so far is able to send from one secured page to another at my server but from some reason isnt able to connect to the cc server, when i tried to use curl through the shell i succeded to connect. > > > > The code that im trying is (i reduced the amount of variables for the snippet): > > $OrderID = "OrderID=".$OrderID."&"; > > $total = "total=".$total."&"; > > $URL = "URL=http://www.curtaincallproductions.com/ccall08/html/order/auth.phtml&";; > > $email = "email=".$b_email."&"; > > $Cardnum1 = "Cardnum1=".$Cardnum[1]."&"; > > $Cardnum2 = "Cardnum2=".$Cardnum[2]."&"; > > $Cardnum3 = "Cardnum3=".$Cardnum[3]."&"; > > $Cardnum4 = "Cardnum4=".$Cardnum[4]."&"; > > $Cardname = "Cardname=".$Cardname; > > > > $params = $OrderID.$total.$URL.$email.$Cardnum1.$Cardnum2.$Cardnum3.$Cardnum4.$Cardnam e; > > $params = str_replace(" ", "%20", $params); > > $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; > > > > $ch = curl_init('https://www.goemerchant7.com/cgi-bin/gateway/direct.cgi'); > > curl_setopt($ch, CURLOPT_POST, 1); // make a regular post > > curl_setopt($ch, CURLOPT_POSTFIELDS, $params); > > curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); //"user-agent" header to be used > > curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); > > curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); > > > > $result = curl_exec ($ch); > > curl_close ($ch); > > } > > > > Anyone know what can be the problem? > > I also know that if i just create a static form which post to the cc server the cc return me an error, with curl i cant know what is the error... or can i? > > > > Thanks Alot in advance, > > -- > > "My friends are worth gold to me, so I prefer to sell them and get rich!" > > > > Ben-Nes Yonatan > > Canaan Surfing Ltd > > Tel: 972-4-6991122 > > Fax: 972-4-6990098 > > http://sites.canaan.co.il > > -- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing random variables names
Hi all, I made a form which pass constant variables which never change (Ex. product_name) and dynamic variables which i withdraw from the db (Ex. attribute_id = 1, value = color). Now my problem is with the passing of the dynamic variables. Because the fields can change their name (id's) i need to design my functions so they will "know" how to receive them. I used to make an array in the form (Ex. attribute_id[0], attribute_id[1] where the numbers in the [] are the id numbers from the db) and then at the function i used to $_POST['attribute_id'] and then withdraw from them their id's and values. I read that this kind of passing variables is making problems with javascripting (and maybe it violate W3C standards). Is there a way that i can pass names like attribute_id_X where X is the changing name and the function will be able to withdraw it like $_POST['attribute_id_X'], or any other way which doesnt violate W3C standards? Any help will be greatly appreciated, Thanks -- "My friends are worth gold to me, so I prefer to sell them and get rich!" Ben-Nes Yonatan Canaan Surfing Ltd Tel: 972-4-6991122 Fax: 972-4-6990098 http://www.canaan.net.il --
[PHP] PDO::prepare deallocate & PDOStatement::closeCursor()
Hi all, I got 2 questions about PDO: 1. Let's say that I create the following prepared statement: $PDOStatement = $DB_Conn->prepare("INSERT INTO test (name) values (?)"); And after 50,000 inserts (with $PDOStatement->execute(array('somevalue'));) I want the database to analyze, compile and optimize it's plan again so it will be more efficient for it's next inserts (actually is that true at all?!?), does repeating the same command will deallocate the prepared statement at the database & replace it with the new prepared statement? (new plan). If not, how can I deallocate it then? 2. At the PHP manual of PDOStatement::closeCursor it's written that "This method is useful for database drivers that do not support executing a PDOStatement object when a previously executed PDOStatement object still has unfetched rows. If your database driver suffers from this limitation, the problem may manifest itself in an out-of-sequence error.". Anyone know if the PostgreSQL suffer from this problem or not? Thanks a lot in advance, Ben-Nes Yonatan
[PHP] Creating multidimensional array
Hi all, I got a problem with creating a multidimensional array which it's size is unknown. I already made it work like this (example): = 0; $i--) { $array_keys_string_representation .= '["'.$array[$i].'"]'; } eval('$new_array'.$array_keys_string_representation.'["node_title"] = "string value";'); ?> The problem is that I don't like using eval() cause it's slow & insecure. I want to do something like this (doesn't work): = 0; $i--) { $array_keys_string_representation .= '["'.$array[$i].'"]'; } $new_array.$array_keys_string_representation.'["node_title"] = "string value"; ?> Anyone got any idea how can I build such an array without eval()? Thanks a lot in advance, Ben-Nes Yonatan
[PHP] PHP Framework
Hi All, I want to start using a framework to my future sites and I saw that there are quite alot of options out there at the net, if anyone got any experience with frameworks I would really like to receive some suggestions, recommenditions and even ideas. The framework need to achieve the following goals (Doesn't have to be all of them): 1. Reusability of codes as components. 2. OO. 3. PHP 5. 4. Code & logic should be seperated from design (MVC and such..). 5. Easy to use & learn. 6. Extreme flexibility to handle also special requirements. 7. Easy usage of PEAR. 8. Should have a good living community. (I don't want to choose a project which will fall in a year...) I've already saw the following options and I would like to receive comments about them also: 1. PRADO - http://www.xisc.com/ 2. MOJAVI - http://www.mojavi.org/ 3. XARAYA - http://www.xaraya.com/index.php 4. FUSEBOX - http://www.fusebox.org/ 5. InterJinn - http://www.interjinn.com/about/index.phtml 6. PHP2GO - http://php2go.sourceforge.net/ 7. P4A - http://p4a.sourceforge.net/ Thanks in advance, Yonatan Ben-Nes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Framework
Richard Davey wrote: Hi Yonatan, Tuesday, November 15, 2005, 2:54:27 PM, you wrote: I want to start using a framework to my future sites and I saw that there are quite alot of options out there at the net, if anyone got any experience with frameworks I would really like to receive some suggestions, recommenditions and even ideas. The framework need to achieve the following goals (Doesn't have to be all of them): I'll add a criteria to your list (which nearly all the frameworks out there lack) - *DOCUMENTATION* There are so many recent PHP apps out there in the wild (not just frameworks) that have virtually no real, solid, *useful* documentation for them. The vast majority of PEAR components suffer from this, lots of the frameworks have virtually no good documentation at all, some of the blog apps, the wiki apps, etc etc etc. Stick your finger anywhere in the PHP pie and you'll hit a cherry, but more often than not have no help at all on how to consume it, without ripping the thing apart. I'm sure this isn't unique to PHP, but it gets my goat :) We've got security consortiums, framework groups, component repositories, class files a go-go - maybe it was time someone started a PHP Documentation Group! Err, apologies for diversifying from your original thread a bit. Cheers, Rich Don't be sorry it's actually a good criteria :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Framework
Robert Cummings wrote: On Tue, 2005-11-15 at 09:54, Yonatan Ben-Nes wrote: Hi All, I want to start using a framework to my future sites and I saw that there are quite alot of options out there at the net, if anyone got any experience with frameworks I would really like to receive some suggestions, recommenditions and even ideas. The framework need to achieve the following goals (Doesn't have to be all of them): 1. Reusability of codes as components. 2. OO. 3. PHP 5. 4. Code & logic should be seperated from design (MVC and such..). 5. Easy to use & learn. 6. Extreme flexibility to handle also special requirements. 7. Easy usage of PEAR. 8. Should have a good living community. (I don't want to choose a project which will fall in a year...) 5. InterJinn - http://www.interjinn.com/about/index.phtml Since I'm the InterJinn guy :) I'll comment on your list of reqs... 1. Re-usability is more a symptom of the developer, but InterJinn does generally provide a nice design for creating small chunks of highly re-usable and adaptble code. 2. InterJinn is 99% OO except for a few functions that are used mostly by the framework itself. A list of all services, components, classes, and functions can be viewed here. http://www.interjinn.com/jinnDoc/index.phtml Unfortunately as mentioned by Richard Davey older stuff isn't well documented as far as the API goes, although there's plenty of documentation about services in general. 3. InterJinn was NOT written to exploit PHP5 in particular, however it has been updated to be cleanly compatible (though I haven't checked with the most recent version of PHP5). That said such updates are usually fairly trivial due to it's clean nature :) 4. Modules are comprised of components, components implement the MVC paradigm. The template engine was specifically designed with said modules/components for easy interfacing with the data. Unlike Smarty, the code never touches templates, but rather makes data available, that a template may or may not use. Modules and components are imported/bound by templates, not the other way around. 5. InterJinn is not particularly easy to learn, but once you do it is easy to use -- although your mileage may vary since a lot of the "easy to use" people out there are cut and paste goons. 6. Very flexible with highly modular and customizable service/modules. Services are akin to cross application libraries which are registered in the project configuration. This makes it possible to share often used code across the application, with the exception that since the service is requested by registered name it is easy to drop in functionally different (yet API equivalent) replacements. To date I've patched in support for InterJinn into existing legacy web applications and in some cases into existing dirty frameworks like the eZ framework system with no problem. In these cases InterJinn is treated like a drop in super library. 7. PEAR is a library of it's own, there's no reason why it couldn't be easily used anywhere. InterJinn especially makes consideration for other libraries by having an extremely small footprint in the globals names space. Additionally classes and functions are named such that they generally don't conflict. With respect to PEAR interJinn also provides a wrapper for the PEAR:DB API for it's own database service which can act as a drop in replacement. http://www.interjinn.com/jinnDoc/interjinn.service.PearDbManager.phtml 8. InterJinn does NOT have a good community *lol*. But it's not about to fail since I'm using it actively with several clients and for my own projects. Although I must say, releases are slow, but then I usually use the most up to date snapshots since I know they are more stable than the last release version, as well as having many more undocumented features. Either way if you decide to try it out more I'm always available to answer questions. Feel free to email me directly. The Future... While the API documentation sucks for most of the existing code, future service/components/whatever will be documented nicely. For instance I recently found myself working with a lot of XML feeds and so I knocked up my own SimpleXML service to simplify the tedium of working with XML. This illustrates how future code (and slowly but surely older code) will be documented: http://www.interjinn.com/jinnDoc/interjinn.service.JinnSimpleXml.phtml You can click on the "Implemented via Class JinnSimpleXml" for full class API documentation (or click the following:) http://www.interjinn.com/jinnDoc/interjinn.class.JinnSimpleXml.phtml Currently I am working towards adding a convenient Javascript integration system that will allow to include javascript modules via a system similar to
Re: [PHP] Re: PHP Framework
Aaron Greenspan wrote: Yonatan, And since I'm the Lampshade guy, I'll throw Lampshade out there, as well: http://www.thinkcomputer.com/software/lampshade/index.html Unlike a lot of frameworks, Lampshade is entirely procedural, and it's designed specifically for use with MySQL. I suppose that makes it less flexible than some people would want, but if it fits your application specs, then it's very fast and straightforward. In general, it's been around since 2002 (no plans to go away next year), it's in use at Harvard and at very large companies, and at very small ones, too, and there's a whole lot of documentation, in both HTML and PDF format. I also happen to think that as far as programming frameworks go, it's pretty easy to learn. The Lampshade Starter Kit, which you can download alongside the core files, gives you an example application that you can work with and modify. Good luck with your search! Aaron Aaron Greenspan President & CEO Think Computer Corporation http://www.thinkcomputer.com Thanks Aaron it sounds promising but sadly it won't fit to my needs cause I use PostgreSQL as my database... I guess that I should have written that at my requirements... Thanks again anyway :) Yonatan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP PDO functions
Hi all, After searching for a framework which work with PostgreSQL & PHP I've found Framewerk (http://svn.framewerk.org/) which seem to fit my needs, the only problem that I've found is that it use the PDO functions. Now maybe I'm wrong but I understood that database abstraction layers like PEAR::DB got their disadvantages, does PDO got disadvantages also compared for using specific pg_ functions? Thanks in advance, Yonatan Ben-Nes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php