php-general Digest 7 Sep 2008 13:13:33 -0000 Issue 5668
php-general Digest 7 Sep 2008 13:13:33 - Issue 5668 Topics (messages 279605 through 279610): Re: Path of the class file of an object 279605 by: Stut 279606 by: Ali Çevik 279608 by: ANR Daemon Re: Geometrical library 279607 by: Manuel Lemos 279609 by: Yannick Warnier php image and javascript include 279610 by: javasac Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On 6 Sep 2008, at 20:08, Ali Çevik wrote: I need a procedure or an implementation that gives path of the class file of an object which I pass as a parameter. Example; Assume I have a class file located at C:\htdocs\Foo.class.php In code after I include Foo.class.php; ?php $foo = new Foo(); Echo some_procedure($foo); ? I'm looking an implementation for that some_procedure, which would make this program to print C:\htdocs\Foo.class.php . I have been googling around and also checked php.net but I wasn't able to find anything about this subject. It would be really helpful if someone knows that kind of procedure or at least has an implementation of it. The only way I know to do this would be to add a method to your class to give it to you. class Foo { public function getClassFilename() { return __FILE__; } } -Stut -- http://stut.net/---End Message--- ---BeginMessage--- Hmm, that should do the trick. Thanks a lot! But still, I wish there were a way of doing that, without altering the class behaviour. Ali Cevik. On Sat, Sep 6, 2008 at 11:58 PM, Stut [EMAIL PROTECTED] wrote: On 6 Sep 2008, at 20:08, Ali Çevik wrote: I need a procedure or an implementation that gives path of the class file of an object which I pass as a parameter. Example; Assume I have a class file located at C:\htdocs\Foo.class.php In code after I include Foo.class.php; ?php $foo = new Foo(); Echo some_procedure($foo); ? I'm looking an implementation for that some_procedure, which would make this program to print C:\htdocs\Foo.class.php . I have been googling around and also checked php.net but I wasn't able to find anything about this subject. It would be really helpful if someone knows that kind of procedure or at least has an implementation of it. The only way I know to do this would be to add a method to your class to give it to you. class Foo { public function getClassFilename() { return __FILE__; } } -Stut -- http://stut.net/ ---End Message--- ---BeginMessage--- Greetings, Ali Çevik. In reply to Your message dated Sunday, September 7, 2008, 1:51:33, I need a procedure or an implementation that gives path of the class file of an object which I pass as a parameter. Example; Assume I have a class file located at C:\htdocs\Foo.class.php In code after I include Foo.class.php; ?php $foo = new Foo(); Echo some_procedure($foo); ? I'm looking an implementation for that some_procedure, which would make this program to print C:\htdocs\Foo.class.php . I have been googling around and also checked php.net but I wasn't able to find anything about this subject. It would be really helpful if someone knows that kind of procedure or at least has an implementation of it. The only way I know to do this would be to add a method to your class to give it to you. class Foo { public function getClassFilename() { return __FILE__; } } Hmm, that should do the trick. Thanks a lot! But still, I wish there were a way of doing that, without altering the class behaviour. (top posting fixed) Ok, if you prefer backward solution - hook your own error-handler and cause an error in class, then you'll have path to it's file in backtrace. I mean, knowing the filename of this or that function absolutely meaningless, unless you're running into problem of some sort. -- Sincerely Yours, ANR Daemon [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- Hello, on 09/03/2008 01:54 PM Yannick Warnier said the following: Hi there, I've been looking for a PHP library that would allow me to calculate superpositions of geometrical surfaces defined by polygones (defined themselves by points bound with lines) in 2D (surface of a polygone, intersections between two vectors, surface of intersection - considering the polygons could be complex and superpose themselves in more than one point). The closest to what I'm looking for, I guess, would be the PEAR Math_Vector package, but it is mainly based on vectors as mathematical arrays, whereas I would need calculations based on surfaces. Does anyone know of something that could help me? I think this PHP class does exactly what you need: http://www.phpclasses.org/polygon -- Regards, Manuel
[PHP] php image and javascript include
Hi All, Strange issue here. I m including images and javascript in my php file. None of them show/work up. If i change the .php file to .html, both thing start working. So no issues with path and all. Any idea? Thanks, Sachin -- View this message in context: http://www.nabble.com/php-image-and-javascript-include-tp19357706p19357706.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php image and javascript include
Do you have an excerpt of the PHP code you have preceeding the HTML you are using to include the JavaScript images? Ash www.ashleysheridan.co.uk ---BeginMessage--- Hi All, Strange issue here. I m including images and javascript in my php file. None of them show/work up. If i change the .php file to .html, both thing start working. So no issues with path and all. Any idea? Thanks, Sachin -- View this message in context: http://www.nabble.com/php-image-and-javascript-include-tp19357706p19357706.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Length of Exception text?
ANR Daemon schreef: Greetings, All. I've been working on some PEAR-based app last week and I ran into problem. While I debugging app, my backtrace always trimmed at some point. First time I though it was my mistake, and switched back to standard Exception class. But nothing changed. If I print everything by hands, it's all full and good, but if I let PHP print what do you mean by: 1. print by hand 2. let PHP print exception message, it getting trimmed at 1015 characters, rendering backtrace almost useless. Say, only my own code producing 4-5 lines, PEAR stuff adding about 8, plus converting PEAR_Error to Exception at least 2 lines. All-in-all, up to 15 lines so far, and backtrace trimmed at 6'th or 7'th line. Is there any way to affect this behaviour without recompiling PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursive Iteration over a collection of objects
David Lidstone schreef: Hi I am getting myself quite confused while trying to use SPL to recursively iterate through a collection of objects, and any help would be greatly appreciated! My collection of objects is contained in a class (which I frequently use to iterate through objects stored in an array in the class), and I think my hasChildren() and getChildren() methods are working ok, but I am unable to make it recursive. I am particularly confused by where I have to use RecursiveIteratorIterator (do I have to at all?), something like: $c = new Categories; $c-loadAll(); foreach (new RecursiveIteratorIterator($c) as $item) var_dump($item); and the getIterator() method (again, do I need it and why?). Am I going about this totally the wrong way to start with? I have tried to summarise my code below. Sorry for the long post, and thanks again. David == Script... == $categories = new RecursiveIteratorIterator(new Categories); $categories-loadAll(); foreach ($categories as $category) { echo 'ID: ' . $category-getID(); echo 'Level: ' . $category-getLevel(); } === classes... = abstract class ObjCollection implements RecursiveIterator { // class stores objects in an array public $objs = array(); public function current(); public function hasChildren(); // etc etc } class Categories extends ObjCollection { // concrete class which loads the Category objects into // the ObjCollection array public function loadAll() {// ...load Category classes // into parent:: !} } class Category { private $id; private $level public function getID() {return $this-id;} public function getLevel() {return $this-level;} } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php image and javascript include
Thanks for the reply. here is the php file. I am using wamp server 2.0 http://www.nabble.com/file/p19360339/signin.jpg signin.jpg Ashley Sheridan-3 wrote: Do you have an excerpt of the PHP code you have preceeding the HTML you are using to include the JavaScript images? Ash www.ashleysheridan.co.uk Hi All, Strange issue here. I m including images and javascript in my php file. None of them show/work up. If i change the .php file to .html, both thing start working. So no issues with path and all. Any idea? Thanks, Sachin -- View this message in context: http://www.nabble.com/php-image-and-javascript-include-tp19357706p19357706.html Sent from the PHP - General mailing list archive at Nabble.com. -- 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 http://www.nabble.com/file/p19360339/signup.php signup.php -- View this message in context: http://www.nabble.com/php-image-and-javascript-include-tp19357706p19360339.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php image and javascript include
html head meta http-equiv=Content-Type content=text/html; charset=windows-1252 titleSPIDR/title script language=javascript var prev_Item_1d; prev_Item_1d = ''; var prev_div_Item_1d; prev_div_Item_1d = ''; function Call_MyFunction(div_Item_1d, item_1d) { if(prev_div_Item_1d != '') { document.getElementById(prev_div_Item_1d).style.display = 'none'; document.getElementById(prev_Item_1d).style.backgroundImage = 'url(images/login_07.jpg)'; document.getElementById(prev_Item_1d).style.borderBottomColor = #808080; } if(prev_div_Item_1d == div_Item_1d) { prev_div_Item_1d = ''; prev_Item_1d = ''; } else { document.getElementById(div_Item_1d).style.display = ''; document.getElementById(item_1d).style.backgroundImage = 'url(images/main_menu_bgwhite.jpg)'; document.getElementById(item_1d).style.borderBottomColor = #FF; prev_div_Item_1d = div_Item_1d; prev_Item_1d = item_1d; setTimeout(On_T1mer(), 5000); } } function On_T1mer() { if(prev_div_Item_1d != '') { document.getElementById(prev_div_Item_1d).style.display = 'none'; document.getElementById(prev_Item_1d).style.backgroundImage = 'url(images/login_07.jpg)'; document.getElementById(prev_Item_1d).style.borderBottomColor = #808080; prev_div_Item_1d = ''; prev_Item_1d = ''; } } /script link href=style.css rel=stylesheet type=text/css /head body bgcolor=#FF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 div class=innerTEXT style=display: none; border-left:1px solid #808080; border-right:1px solid #808080; border-bottom:1px solid #808080; position: absolute; width: 168px; z-index: 1; left:91px; top:94px; background-color:#FF id=div_Item2 table id=tbl_Top width=100% border=0 cellpadding=0 cellspacing=0 tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 1/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 2/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor =
Re: [PHP] Recursive Iteration over a collection of objects
On Sun, Sep 7, 2008 at 11:05 AM, Jochem Maas [EMAIL PROTECTED] wrote: David Lidstone schreef: Hi I am getting myself quite confused while trying to use SPL to recursively iterate through a collection of objects, and any help would be greatly appreciated! My collection of objects is contained in a class (which I frequently use to iterate through objects stored in an array in the class), and I think my hasChildren() and getChildren() methods are working ok, but I am unable to make it recursive. I am particularly confused by where I have to use RecursiveIteratorIterator (do I have to at all?), something like: $c = new Categories; $c-loadAll(); foreach (new RecursiveIteratorIterator($c) as $item) var_dump($item); make sure to pass the appropriate mode when instantiating RecursiveIteratorIterator; the default is LEAVES_ONLY, which i presume is not what people want in most cases. here is the list of modes from the spl docs, *mode* Operation mode (one of): - LEAVES_ONLY only show leaves - SELF_FIRST show parents prior to their childs - CHILD_FIRST show all children prior to their parent so, i typically use SELF_FIRST, and then Jochem's example would become, .. foreach(new RecursiveIteratorIterator($c, RecursiveIteratorIterator::SELF_FIRST) as $item) .. -nathan
Re: [PHP] php image and javascript include
On 7 Sep 2008, at 18:35, javasac wrote: snip code I see no PHP in there. Please post the piece of PHP code you're having a problem with. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php image and javascript include
javasac wrote: snip Where is the PHP? There's nothing between ?php and ? tags. Nothing between PHP short tags ( ? and ? ), either. Reese -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php image and javascript include
You generally need some PHP to have PHP errors, but you don't have any here. What was the code that actually gave you the errors? Ash www.ashleysheridan.co.uk ---BeginMessage--- html head meta http-equiv=Content-Type content=text/html; charset=windows-1252 titleSPIDR/title script language=javascript var prev_Item_1d; prev_Item_1d = ''; var prev_div_Item_1d; prev_div_Item_1d = ''; function Call_MyFunction(div_Item_1d, item_1d) { if(prev_div_Item_1d != '') { document.getElementById(prev_div_Item_1d).style.display = 'none'; document.getElementById(prev_Item_1d).style.backgroundImage = 'url(images/login_07.jpg)'; document.getElementById(prev_Item_1d).style.borderBottomColor = #808080; } if(prev_div_Item_1d == div_Item_1d) { prev_div_Item_1d = ''; prev_Item_1d = ''; } else { document.getElementById(div_Item_1d).style.display = ''; document.getElementById(item_1d).style.backgroundImage = 'url(images/main_menu_bgwhite.jpg)'; document.getElementById(item_1d).style.borderBottomColor = #FF; prev_div_Item_1d = div_Item_1d; prev_Item_1d = item_1d; setTimeout(On_T1mer(), 5000); } } function On_T1mer() { if(prev_div_Item_1d != '') { document.getElementById(prev_div_Item_1d).style.display = 'none'; document.getElementById(prev_Item_1d).style.backgroundImage = 'url(images/login_07.jpg)'; document.getElementById(prev_Item_1d).style.borderBottomColor = #808080; prev_div_Item_1d = ''; prev_Item_1d = ''; } } /script link href=style.css rel=stylesheet type=text/css /head body bgcolor=#FF leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 div class=innerTEXT style=display: none; border-left:1px solid #808080; border-right:1px solid #808080; border-bottom:1px solid #808080; position: absolute; width: 168px; z-index: 1; left:91px; top:94px; background-color:#FF id=div_Item2 table id=tbl_Top width=100% border=0 cellpadding=0 cellspacing=0 tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 1/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 2/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color = '#33';nbsp; Item 3/td /tr tr height=22px td class=innerTEXT bgcolor=#FF onmousemove=this.style.backgroundColor = 'darkblue'; this.style.color = '#FF'; onmouseout=this.style.backgroundColor = '#FF';this.style.color =
Re: [PHP] php image and javascript include
javasac wrote: [lots of stuff ...] I'm guessing that was the *output* of the PHP file, not the script itself. You've got a couple different errors here. The first is that you're not creating img tags. All you have here is the path to the image. A browser isn't going to do anything with that. td width=10 height=7 images/box_bottom_lft.jpg /td Second, at least one of the image paths is relative to your own desktop computer's drive (why is it that this always happens on a Windows box?) td width=11 C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg /td Also, in the future, it'd be better to trim out the completely unnecessary bits. That's an awful lot of (bloated) HTML and javascript to wade through. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php image and javascript include
b wrote: javasac wrote: [lots of stuff ...] Second, at least one of the image paths is relative to your own desktop computer's drive (why is it that this always happens on a Windows box?) td width=11 C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg /td PEBKAC error? I've seen it happen when an inexperienced developer copied a file to another location, from within Dreamweaver, on a Mac. Dreamweaver updates the file path(s) if permitted and depending on a couple of variables, puts in an absolute path to the location on that particular machine. Reese -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php image and javascript include
Reese schreef: b wrote: javasac wrote: [lots of stuff ...] Second, at least one of the image paths is relative to your own desktop computer's drive (why is it that this always happens on a Windows box?) td width=11 C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg /td PEBKAC error? I've seen it happen when an inexperienced developer copied a file to another location, from within Dreamweaver, on a Mac. Dreamweaver updates the file path(s) if permitted and depending on a couple of variables, puts in an absolute path to the location on that particular machine. at the opposite end of the stick you have Eclipse users (mac or otherwise) whose machines freeze up when moving or renaming stuff as Eclipse tries to refactor code that references the resource. It's no wonder that dreamweaver screws such stuff up ... with Eclipse you seem to have to sell your soul in order get the arcane settings related to these kinds of 'productivity' tools even close to working. mines the one with 'not for sale' on the back. Reese -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re[2]: Path of the class file of an object
Hi, I guess the word meaningless depends on what you are trying to do. So, I guess I have to describe what I'm trying to do. The problem is, I need to pass a php object to javascript via json and then back to php again using json. However, while doing that, I lose the type of the object (because json_encode method or json_decode works independent from the object's class). Thus, I somehow need to typecast. I thought I might hold class name as a property of the object so it would be passed inside json, but type casting would work if and only if I have class file of the object included. In case I add a getClassPath() like variable to each php class, it would be a great mess. Moreover, what I'm trying to do is developing a framework. Thus, I don't want to force my users to alter their classes and their behaviours. This was my solution to keep the type persistent. However, I would also thankfully appreciate if you have an idea to do that in a better way. thanks, Ali. On Sun, Sep 7, 2008 at 5:35 AM, ANR Daemon [EMAIL PROTECTED] wrote: Greetings, Ali Çevik. In reply to Your message dated Sunday, September 7, 2008, 1:51:33, I need a procedure or an implementation that gives path of the class file of an object which I pass as a parameter. Example; Assume I have a class file located at C:\htdocs\Foo.class.php In code after I include Foo.class.php; ?php $foo = new Foo(); Echo some_procedure($foo); ? I'm looking an implementation for that some_procedure, which would make this program to print C:\htdocs\Foo.class.php . I have been googling around and also checked php.net but I wasn't able to find anything about this subject. It would be really helpful if someone knows that kind of procedure or at least has an implementation of it. The only way I know to do this would be to add a method to your class to give it to you. class Foo { public function getClassFilename() { return __FILE__; } } Hmm, that should do the trick. Thanks a lot! But still, I wish there were a way of doing that, without altering the class behaviour. (top posting fixed) Ok, if you prefer backward solution - hook your own error-handler and cause an error in class, then you'll have path to it's file in backtrace. I mean, knowing the filename of this or that function absolutely meaningless, unless you're running into problem of some sort. -- Sincerely Yours, ANR Daemon [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php image and javascript include
Dreamweaver? Eclipse? Pah, it's all about using a text editor! Kate (on KDE) is my preference ;) Ash www.ashleysheridan.co.uk ---BeginMessage--- Reese schreef: b wrote: javasac wrote: [lots of stuff ...] Second, at least one of the image paths is relative to your own desktop computer's drive (why is it that this always happens on a Windows box?) td width=11 C:/wamp/www/yojoe-web/html/site/images/box_top_rht.jpg /td PEBKAC error? I've seen it happen when an inexperienced developer copied a file to another location, from within Dreamweaver, on a Mac. Dreamweaver updates the file path(s) if permitted and depending on a couple of variables, puts in an absolute path to the location on that particular machine. at the opposite end of the stick you have Eclipse users (mac or otherwise) whose machines freeze up when moving or renaming stuff as Eclipse tries to refactor code that references the resource. It's no wonder that dreamweaver screws such stuff up ... with Eclipse you seem to have to sell your soul in order get the arcane settings related to these kinds of 'productivity' tools even close to working. mines the one with 'not for sale' on the back. Reese -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Open MSSQLCE database file on desktop
Hi all, Is there a way to open Mssql database file foo.sdf on desktop, not through the Mssql server or ODBC source, suppose the codes like below: $link = open_datafile('uri:file:///somepath/foo.sdf'); $query_result = query('some sql query',$link); thanks for your help :D -- get along unaided. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending out mass emails
Hello, on 09/04/2008 10:47 AM Angelo Zanetti said the following: Hi all, We would like to send out mass emails for some of our clients, these are HTML email and text alternative for the email clients that cant read those HTML emails. We have developed some scripts to send the emails using phpmailer. Now we anticipate sending emails in batches but not sure how many at once. This depends on what is your goal is sending it in batches. If it is to avoid server overload, you need to watch your server load and suspend delivery when it has too much load. But if you have other concerns, you need to tell what are those concerns so we can advise. Also what is the best way about going around being black listed due to spam issues. If you do not send messages to people that do not want them, that reduces the chances of being blacklisted. I know that the headers need to be set to avoid being detected as spam. That is a problem mostly with malformed messages. As long as the receipient address is in a visible header (To or Cc), at least Hotmail will not junk your messages for that. Therefore you should be sending separate messages to each recipient so you can personalize at least the To header. If your message is the same to all recipients, you should cache the MIME message data for the message body. I do that using this MIME message class when sending newsletters that are the same for all recipients. Internally the class can cache the message body even when the headers vary for instance the To: and Return-Path: . It saves a lot of server load that otherwise would be wasted rebuilding the same message body. http://www.phpclasses.org/mimmessage -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending out mass emails
Hello, The right class address below is http://www.phpclasses.org/mimemessage . on 09/04/2008 10:47 AM Angelo Zanetti said the following: Hi all, We would like to send out mass emails for some of our clients, these are HTML email and text alternative for the email clients that cant read those HTML emails. We have developed some scripts to send the emails using phpmailer. Now we anticipate sending emails in batches but not sure how many at once. This depends on what is your goal is sending it in batches. If it is to avoid server overload, you need to watch your server load and suspend delivery when it has too much load. But if you have other concerns, you need to tell what are those concerns so we can advise. Also what is the best way about going around being black listed due to spam issues. If you do not send messages to people that do not want them, that reduces the chances of being blacklisted. I know that the headers need to be set to avoid being detected as spam. That is a problem mostly with malformed messages. As long as the receipient address is in a visible header (To or Cc), at least Hotmail will not junk your messages for that. Therefore you should be sending separate messages to each recipient so you can personalize at least the To header. If your message is the same to all recipients, you should cache the MIME message data for the message body. I do that using this MIME message class when sending newsletters that are the same for all recipients. Internally the class can cache the message body even when the headers vary for instance the To: and Return-Path: . It saves a lot of server load that otherwise would be wasted rebuilding the same message body. http://www.phpclasses.org/mimmessage -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] translations for PHP app
Hi All, I'm looking for professional translations from English of the following: - admin.php lang file just under 150 PHP defines - user.php lang file just under 30 PHP defines - a javascript file with about 25 single word defines - about 19 PHP files with 2 defines in each Most defines are 1 or 2 words with a few being sentences. I need translations from English into the most common languages of my users: Spanish, French, Italian, Chinese, Indian, Russian. Also, anyone having expertise in other languages, I would love to have them, please contact me. I also have a 30+ page user guide for using my software. Many pages contain large graphics, but the English text I woul love to have translated. Of course I will pay. PayPal only. Thanks! -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen in phpmailer and tls
On Sat, 2008-09-06 at 14:53 -0400, Robert Cummings wrote: On Sat, 2008-09-06 at 14:38 -0400, Larry Brown wrote: On Sat, 2008-09-06 at 14:06 -0400, Robert Cummings wrote: On Sat, 2008-09-06 at 14:02 -0400, Larry Brown wrote: OK. So I broke down and re-created my mail server due to its age. I am now running the latest sendmail and it is still failing. The message in the sendmail log is ...remoteMachineIP] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA A little research is leading me to believe the client (php client script) opened the socket but didn't send anything. Now the certificate that I'm using for the server is a self signed certificate. Evolution asked if I wanted to accept the certificate when I first connected and I did. After which it worked fine. Is there a setting I must enable to accept unknown certificates when a site is first connected to? Any other ideas? Sounds like an email client issue and most likely may differ for each and every one of them. Cheers, Rob. -- I am the email client. In this case which is what I'm trying to figure out. The script fails with the original string I posted: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I'm using the smtpmailer class and it is trying to execute fsockopen. So to simplify troubleshooting I used the following code: if(fsockopen(tls://serverName,25,$errno,$errstr, 30)) { echo Made it!\n; } else { echo Nope!\n; echo $errno.\n; echo $errstr.\n; } I get the above warning from PHP and $errno has 0 as a value and there is $errstr is empty. PHP is v5.2.6 and phpinfo shows that ssl and tls support are both compiled in. Ah, I see, I misunderstood when you mentioned Evolution. Sorry, I can't really help you, you're in foreign territory to me :/ Cheers, Rob. For posterity and to thank Robert... I have determined that the mechanism in PHP does not allow you to specify tls for a connection that initially starts off as a clear text connection. When you set up sendmail to use tls for smtp auth it allows a connecting client to send connection details specifying tls at which point it will start talking tls. PHP expects the connection to be dedicated tls. So if you specify in sendmail to use a separate port for tls and you point PHP to that port it works like a champ. Thanks to Robert for at least giving it a shot. Hopefully this will be helpful to the next poor soul... Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: fsockopen in phpmailer and tls
Hello, on 09/05/2008 12:20 AM Larry Brown said the following: I am having a ball of a time trying to figure this one out... If anyone has dealt with this before I'd love to get some morsels of wisdom from you... I am trying to connect to a postfix server I have set up remotely using smtp auth with tls. The postfix appears to be configured correctly at this point. I can telnet to port 25 and it will list tls as an option as the howto describes it should. I try to connect from php and get: PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /opt/scriptsMain/include/class.smtp.php on line 122 I suspect that you are using the wrong port to send messages via SSL . The fact that port 25 SMTP connections list TLS as available mode, that is for starting TLS after the connection was started. I use this class to send messages via SMTP using SSL to Gmail, but the port is not 25. You may want to try it to see if it works for your server. Take a look at the test_smtp_message.php example script. http://www.phpclasses.org/mimemessage You also need this for SMTP deliveries: http://www.phpclasses.org/smtpclass and this to initiate authentication: http://www.phpclasses.org/sasl -- Regards, Manuel Lemos Find and post PHP jobs http://www.phpclasses.org/jobs/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php