php-general Digest 22 May 2009 08:07:18 -0000 Issue 6134
php-general Digest 22 May 2009 08:07:18 - Issue 6134 Topics (messages 292908 through 292918): Re: PHP class question 292908 by: Peter van der Does 292911 by: Shawn McKenzie 292912 by: Shawn McKenzie 292914 by: Nathan Rixham Re: CSS tables 292909 by: Jessi Berkelhammer 292910 by: Ashley Sheridan 292915 by: Al Re: SECURITY PRECAUTION BEFORE SUBMITTING DATA IN DATABASE 292913 by: Michael A. Peters Re: Parse ini file problem 292916 by: Jim Lucas Re: Forms validation and creation- easier solution? 292917 by: Manuel Lemos Re: table-less layouts; Ideas welcome 292918 by: Manuel Lemos Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- On Thu, 21 May 2009 14:08:11 -0500 Shawn McKenzie nos...@mckenzies.net wrote: This doesn't make sense. You say class A needs to be extended with another class, however what you show below is class A extending framework_class. I worded it wrong, I apologize. Class A needs to be an extension of the framework class. -- Peter van der Does GPG key: E77E8E98 IRC: Ganseki on irc.freenode.net Blog: http://blog.avirtualhome.com Forums: http://forums.avirtualhome.com Jabber ID: pvanderd...@gmail.com GetDeb Package Builder http://www.getdeb.net - Software you want for Ubuntu ---End Message--- ---BeginMessage--- Peter van der Does wrote: On Thu, 21 May 2009 14:08:11 -0500 Shawn McKenzie nos...@mckenzies.net wrote: This doesn't make sense. You say class A needs to be extended with another class, however what you show below is class A extending framework_class. I worded it wrong, I apologize. Class A needs to be an extension of the framework class. Well I guess from my point of view there are several ways depending upon the requirements. Others that are better with OOP will chime in I'm sure. This I'll get flamed for, but you can use one instance of core as a global: class A extends framework_class { var $core; function A() { $this-core = $GLOBALS['core']; $this-core-go(); } } //in global scope in bootstrap or whatever $core = new core(); Along the same lines but more OOP and without globals, maybe use a registry class and store core in the registry. This also uses one instance of core: class Registry { protected $_objects = array(); function set($name, $object) { $this-_objects[$name] = $object; } function get($name) { return $this-_objects[$name]; } } class A extends framework_class { var $core; function A($registry) { //dunno if you need a reference here or not $this-core = $registry-get('core'); $this-core-go(); } //i guess you could also pass in core, but registry will give you all objects in the registry //function A(core) { //$this-core = $core; //$this-core-go(); //} } //this is in your bootstrap or whatever $core = new core(); $registry = new registry(); $registry-set('core', $core); Or, if you don't need an object, call it statically: class A extends framework_class { function A() { core::go(); } } -- Thanks! -Shawn http://www.spidean.com ---End Message--- ---BeginMessage--- Shawn McKenzie wrote: Peter van der Does wrote: On Thu, 21 May 2009 14:08:11 -0500 Shawn McKenzie nos...@mckenzies.net wrote: This doesn't make sense. You say class A needs to be extended with another class, however what you show below is class A extending framework_class. I worded it wrong, I apologize. Class A needs to be an extension of the framework class. Well I guess from my point of view there are several ways depending upon the requirements. Others that are better with OOP will chime in I'm sure. This I'll get flamed for, but you can use one instance of core as a global: class A extends framework_class { var $core; function A() { $this-core = $GLOBALS['core']; $this-core-go(); } } //in global scope in bootstrap or whatever $core = new core(); Along the same lines but more OOP and without globals, maybe use a registry class and store core in the registry. This also uses one instance of core: class Registry { protected $_objects = array(); function set($name, $object) { $this-_objects[$name] = $object; } function get($name) { return $this-_objects[$name]; } } class A extends framework_class { var $core; function A($registry) { //dunno if you need a reference here or not $this-core = $registry-get('core'); $this-core-go(); } //i guess you could also pass in core, but registry will give you all objects in the registry //function A(core) {
Re: [PHP] Forms validation and creation- easier solution?
Hello, on 05/20/2009 11:09 AM Paul M Foster said the following: Both this class and Manuel Lemos' form generation class (from phpclasses.org) will create beautiful forms for you. However, you may find that the amount of [repetitive] typing you do will be equivalent or greater than simply creating the form by hand. The best solution would probably be a form you fill out which asks you about all the fields you want, and then generates the code to paint the form. There are commercial solutions which do this, and some (not that great) free solutions. I'm working on one myself, which will eventually be a sourceforge/freshmeat project. Thank you for mentioning my package, but I am not sure what you mean. The Forms Generation and Validation package seems to do exactly what you describe and more. IMHO, creating forms by hand is by no means simpler, especially if you want to include browser side (Javascript) validation. I mean, I am not masochist to create something that will give me more work in the end to develop PHP forms based applications than if I would type HTML manually. Furthermore, the plug-ins that come with the package dramatically reduce the amount of code you need to type to achieve the same generating common HTML inputs manually. Anyone can judge by yourself by going here and see several example forms and the actual code that it takes to generate them: http://www.meta-language.net/forms-examples.html For instance this scaffolding plug-in generates CRUD forms that you often need to manage data stored for instance in databases. http://www.meta-language.net/forms-examples.html?example=test_scaffolding_input For those interested to check it out, the actual class package can be downloaded from here: http://www.phpclasses.org/formsgeneration Here you may watch an extensive tutorial video that covers practically all features: http://www.phpclasses.org/browse/video/1/package/1.html -- 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
Re: [PHP] Shared memory - linx and PHP newbie
Thanks Daniel for your suggestions. What I have found are: 1) I'm assuming the key is good. A value of 1947143245 is returned. 2) I have set the permission of the shared memory (program.SCShared) to 777 octal (full read/write/execute access). The group and owner of the file is my login ('eclipse'). According to the PHP manual for shmop_open(..), I do not need to set the 'mode' parameter of this function (eg, to 0777) because I'm trying to connect to an existing shared memory block. Despite this, I've tried setting mode=0777, but errors were generated when I ran the code. I event tried changing the user and group to 'www-data' with no luck. 3) I added the debug_backtrace and the display result was array(0) {} inserted where debug_backtrace() was added as shown, but I'm not sure what the result really means: CODE ?php $shm_key = ftok(/dev/shm/program.SCShared, 't'); var_dump(debug_backtrace()); if ($shm_key 0) { echo \nftok failed. Error message is $php_errormsg br; } $shm_id = shmop_open ($shm_key,w,0,0); if ($shm_id == FALSE) { echo \n Shared memory doesnt exists br; } else { echo \n Shared memory exists br; } $shm_size = shmop_size ($shm_id); var_dump(debug_backtrace()); echo \n the size of shared memory is $shm_size br; $shm_data = shmop_read($shm_id, 0, 32); if ($shm_data == FALSE) { echo \nCould not read data. : $php_errormsg br; } else { echo \nRead successful br; } echo \n read1 is $shm_data br; $shm_data = unserialize($shm_data); echo \n read2 is $shm_data br; $i = strpos($shm_data, \0); if ($i === FALSE) { echo \n String is NULL br; } else { $result = substr($shm_data, 0, $i); print_r($result); echo br; } shmop_close($shm_id); echo \nDetached from shared memory; ? = ===RESULT OF CODE array(0) { } Shared memory exists array(0) { } the size of shared memory is 1 Read successful read1 is PHP_SM�' read2 is String is NULL Detached from shared memory = 4) The data I expecting to read is 9876.54321 because this is the first string in memory. A 'cat' of the shared memory is shown: r...@ts7800:shm# cat program.SCShared 9876.5432101.230034.50678.9010002345.678900 5) Is there anything else that can try? Regards, Richard. On Thu, May 21, 2009 at 11:17 PM, Daniel Brown danbr...@php.net wrote: On Thu, May 21, 2009 at 10:15, Richard W rw180...@gmail.com wrote: Any help will be greatly appreciated, especially answering 2) as to why I can't read the data. Are you certain that the problem lies within the shmop reading? Check to see if the file is actually being accessed properly, the key is good from your ftok(), etc. You may also want to make sure that things as basic as permissions and 'who created' vs. 'who can read' (since you're trying to run it from the web server) match up appropriately. With just a cursory glance, the shmop_read() piece itself looks fine, which suggests to me that there may be other problems. See if the logs spit anything out, or try to debug the things with an `or die(Here's the error.\n);` tacked onto the end of the suspected lines. If it's crashing out, consider a cachegrind or debug_backtrace() run. As for the memory being read, I'd agree that it does seem that it is, since shm_open() is returning something other than FALSE, but that doesn't mean that it's `=== TRUE` either. It may instead be returning a message or another unexpected result that, in empty(), may evaluate to TRUE and allow it to echo out the message in your test condition. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1
[PHP] reference variables
i have this script ?php $x = 1; $y = 2; $a1 = array($x, $y); $a2 = array($x, $y); $a2[0] = 3; print_r($a1); print_r($a2); ? i am expecting Array ( [0] = 3 [1] = 2 ) Array ( [0] = 3 [1] = 2 ) while i m getting Array ( [0] = 1 [1] = 2 ) Array ( [0] = 3 [1] = 2 ) any ideas why this is happening?? or am i missing something..? the same is the case when i replace $a2[0] = 3; with $a1[0] = 3; $x = 3; Kranthi.
[PHP] session.auto_start
Hi All, are there any *disadvantages of setting session.auto_start to true in terms of system resources or security or any other*. I have set this element to true in php.ini as follows. session.auto_start = 1. Millions of thanks, Sumit
Re: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA IN DATABASE
WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t On Fri, May 22, 2009 at 11:28 AM, Sumit Sharma sumitp...@gmail.com wrote: Thanks to [0] = Ashley, [1] =Bruce, [2] = Michael, [3] = Shawn, [4] = Eddie and php-general list for all your support from bottom of my heart. Now it seems as if I will be able to design my project more secured than before. If you get any other idea please suggest me. Thanks, Sumit. -- Forwarded message -- From: Michael A. Peters mpet...@mac.com Date: Fri, May 22, 2009 at 4:50 AM Subject: Re: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA IN DATABASE To: Eddie Drapkin oorza...@gmail.com Cc: php-general@lists.php.net Eddie Drapkin wrote: Suhosin is completely not-related to SQL, though, I don't know why you'd bring it up... I brought it up because suhosin catches many exploits that otherwise get through, including exploits that allow inclusion of remote files that can then be used to run arbitrary commands on the server, send include files (such as the db authentication script) as plain text, all kinds of nasty can result. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best Wishes A Williams
[PHP] apache user cannot execute useradd via sudo :(
Hi all My server is centos 5.1 with php 5.1.6. In my app I want apache to add user through sudo. My sudoers file is: %apache ALL=(ALL) NOPASSWD: ALL %tony ALL=(ALL) NOPASSWD: ALL My test.php í: ?php $username=hixhix; system(/usr/bin/sudo /usr/sbin/useradd -s /sbin/nologin -M $username,$returnvalue); echo return value: $returnvalue; However, user 'hixhix' not created by apache at all, it always returned 1. how can I make my apache tu add user using sudo? Please help me. I need your help. Thanks and regards. -- View this message in context: http://www.nabble.com/apache-user-cannot-execute-useradd-via-sudo-%3A%28-tp23668764p23668764.html Sent from the PHP - General mailing list archive at Nabble.com.
RE: [PHP] Forms validation and creation- easier solution?
-Original Message- From: Manuel Lemos [mailto:mle...@acm.org] Sent: 22 May 2009 09:56 To: Paul M Foster Cc: php-general@lists.php.net; Angelo Zanetti Subject: Re: [PHP] Forms validation and creation- easier solution? Hello, on 05/20/2009 11:09 AM Paul M Foster said the following: Both this class and Manuel Lemos' form generation class (from phpclasses.org) will create beautiful forms for you. However, you may find that the amount of [repetitive] typing you do will be equivalent or greater than simply creating the form by hand. The best solution would probably be a form you fill out which asks you about all the fields you want, and then generates the code to paint the form. There are commercial solutions which do this, and some (not that great) free solutions. I'm working on one myself, which will eventually be a sourceforge/freshmeat project. Thank you for mentioning my package, but I am not sure what you mean. The Forms Generation and Validation package seems to do exactly what you describe and more. IMHO, creating forms by hand is by no means simpler, especially if you want to include browser side (Javascript) validation. I mean, I am not masochist to create something that will give me more work in the end to develop PHP forms based applications than if I would type HTML manually. Furthermore, the plug-ins that come with the package dramatically reduce the amount of code you need to type to achieve the same generating common HTML inputs manually. Anyone can judge by yourself by going here and see several example forms and the actual code that it takes to generate them: http://www.meta-language.net/forms-examples.html For instance this scaffolding plug-in generates CRUD forms that you often need to manage data stored for instance in databases. http://www.meta-language.net/forms-examples.html?example=test_scaffolding_in put For those interested to check it out, the actual class package can be downloaded from here: http://www.phpclasses.org/formsgeneration Here you may watch an extensive tutorial video that covers practically all features: http://www.phpclasses.org/browse/video/1/package/1.html Thanks manuel. I will check out the class. Much appreciated your response. Thanks Angelo Elemental http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] urgent CSS question
Sorry, but no one suggested a mailing list for CSS and the W3 Schools Forum has problems. This is the only reliable mailing list with professionals, so please excuse my off-path question as it is rather urgent. Why do I get completely different formatting with two identical classes? I want to change part of the formatting on just one page on the site using the exact same class with some changes so I don't modify other pages. I copied div#frame to div#frame1 and changed the class on the page to id=frame1. But now the page no longer displays the formatting as with id=frame - e.g. p produces 16px font-size instead of 12px. TIA -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
On 22/5/09 12:49, PJ wrote: Sorry, but no one suggested a mailing list for CSS and the W3 Schools Forum has problems. Actually, I did: http://www.css-discuss.org/ Why do I get completely different formatting with two identical classes? I want to change part of the formatting on just one page on the site using the exact same class with some changes so I don't modify other pages. I copied div#frame to div#frame1 and changed the class on the page to id=frame1. But now the page no longer displays the formatting as with id=frame - e.g.p produces 16px font-size instead of 12px. This description is confusing. Can you please link to a minimal test case showing the problem you're talking about, so that we can view your code and ideally probe it with DOM inspectors like Firebug? http://webkit.org/quality/reduction.html may help you produce one. In general, I'd suggest creating page-specific style variations by sticking a class on the body (e.g. body class=article ) and using that as a hook to modify the styling of the class whose formatting you want to be different. .thing { font-weight: bold; } .article .thing { font-style: italic; } for example. -- Benjamin Hawkers-Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apache user cannot execute useradd via sudo :(
vuthecuong wrote: Hi all My server is centos 5.1 with php 5.1.6. In my app I want apache to add user through sudo. My sudoers file is: %apache ALL=(ALL) NOPASSWD: ALL %tony ALL=(ALL) NOPASSWD: ALL My test.php í: ?php $username=hixhix; system(/usr/bin/sudo /usr/sbin/useradd -s /sbin/nologin -M $username,$returnvalue); echo return value: $returnvalue; However, user 'hixhix' not created by apache at all, it always returned 1. how can I make my apache tu add user using sudo? Please help me. I need your help. Thanks and regards. That's not a very secure sudoers file. But you probably don't want to use sudo to this anyway. What you probably should do is write a shell script (IE w/ perl) that is suid root and executable by apache that adds the user to your system. I don't know what your sudo error is, but have you looked at your sudo log file? Make damn sure you validate the $username variable whatever solution you end up using. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
PJ wrote: Sorry, but no one suggested a mailing list for CSS and the W3 Schools Forum has problems. This is the only reliable mailing list with professionals, so please excuse my off-path question as it is rather urgent. Why do I get completely different formatting with two identical classes? I want to change part of the formatting on just one page on the site using the exact same class with some changes so I don't modify other pages. I copied div#frame to div#frame1 and changed the class on the page to id=frame1. But now the page no longer displays the formatting as with id=frame - e.g. p produces 16px font-size instead of 12px. TIA If I recall - it is illegal to end a css class name is a number. I'm not positive though. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
On 22/5/09 13:02, Michael A. Peters wrote: If I recall - it is illegal to end a css class name is a number. Those are actually id names not class names, but it's not illegal in either case. HTML id attributes must follow this: http://www.w3.org/TR/html401/types.html#type-id XML id attributes must follow this: http://www.w3.org/TR/REC-xml/#NT-Name The class attribute is a CDATA list: http://www.w3.org/TR/html401/types.html#type-cdata Pretty much the only thing illegal in a classname is whitespace. You may be thinking of the restriction that HTML/XML id attributes may not /begin/ with a number. -- Benjamin Hawkes-Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET
Andrew Williams wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t Isn't it common knowledge that places such as marc.info carry archives of e.g. php-general? I'm sure the list is also available at gmane.org. Why are you writing in capitals - are you angry? /Per -- Per Jessen, Zürich (18.3°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
Benjamin Hawkes-Lewis wrote: On 22/5/09 12:49, PJ wrote: Sorry, but no one suggested a mailing list for CSS and the W3 Schools Forum has problems. Actually, I did: http://www.css-discuss.org/ My apologies... wasn't at the top of my attention at that point. :-[ Why do I get completely different formatting with two identical classes? I want to change part of the formatting on just one page on the site using the exact same class with some changes so I don't modify other pages. I copied div#frame to div#frame1 and changed the class on the page to id=frame1. But now the page no longer displays the formatting as with id=frame - e.g.p produces 16px font-size instead of 12px. This description is confusing. Can you please link to a minimal test case showing the problem you're talking about, so that we can view your code and ideally probe it with DOM inspectors like Firebug? Ok, I have duplicate classes - #frame and #frame1. What I don't understand is why switching from #frame to #frame1 should change formatting. The two classes are absolutely the same, the only difference is the 1 in the name. I would logically assume that the interpreter or whoever is operating this stuff would understand that the page is using a different class, whether it is the same name as another or not. If I create still another class and start to format the various sections of that class, I will wind up with the identical class as #frame1. So where is the logic here? This is utterly incomprehesible and seems to the the typical mess that we find in using CSS. It seems to me that what I am trying to do is logically and intuitively clear and simple. I think you can see the implications of such confusion in creating a different class - how can I rely on it doing what one would expect? http://webkit.org/quality/reduction.html may help you produce one. In general, I'd suggest creating page-specific style variations by sticking a class on the body (e.g. body class=article ) and using that as a hook to modify the styling of the class whose formatting you want to be different. .thing { font-weight: bold; } .article .thing { font-style: italic; } for example. -- Benjamin Hawkers-Lewis -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET
Most likely afraid that his clients will find out he doesn't know what he is doing. -Original Message- From: Per Jessen [mailto:p...@computer.org] Sent: Friday, May 22, 2009 8:22 AM To: php-general@lists.php.net Subject: Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET Andrew Williams wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t Isn't it common knowledge that places such as marc.info carry archives of e.g. php-general? I'm sure the list is also available at gmane.org. Why are you writing in capitals - are you angry? /Per -- Per Jessen, Zürich (18.3°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from ESET Smart Security, version of virus signature database 4096 (20090522) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET
I have no problem with it at least user email address should be removed off the publication. - Show quoted text - On Fri, May 22, 2009 at 1:21 PM, Per Jessen p...@computer.org wrote: Andrew Williams wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t Isn't it common knowledge that places such as marc.info carry archives of e.g. php-general? I'm sure the list is also available at gmane.org. Why are you writing in capitals - are you angry? /Per -- Per Jessen, Zürich (18.3°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best Wishes A Williams
Re: [PHP] urgent CSS question
On 22/5/09 13:27, PJ wrote: Ok, I have duplicate classes - #frame and #frame1. Let's get our terminology straight: ids are not classes; classes are not ids. ids look like: id=thing and are selected like: #thing classes look like: class=thing other-thing and are selected like .thing An element may have zero or one IDs. An element may have zero or more classes. id is supposed to be unique within a given document. The same classname may be used multiple times in the same document. See: http://css.maxdesign.com.au/selectutorial/advanced_idclass.htm What I don't understand is why switching from #frame to #frame1 should change formatting. #frame targets an element with id=frame while frame1 targets an element with id=frame1. So I'm not sure what these have to do with one another. The two classes are absolutely the same, the only difference is the 1 in the name. Which is to say they are utterly different, since they have different names. I would logically assume that the interpreter or whoever is operating this stuff would understand that the page is using a different class, whether it is the same name as another or not. I'm sorry, I don't know what you mean. If I create still another class and start to format the various sections of that class, I will wind up with the identical class as #frame1. Again, I don't know what you mean. So where is the logic here? Without seeing some clear test case links that reproduces the problem for us, I really can't comment about that. It seems to me that what I am trying to do is logically and intuitively clear and simple. What you're trying to do really isn't clear to me. Being able to see the problem (and the underlying code) might help. -- Benjamin Hawkes-Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: reference variables
kranthi wrote: i have this script ?php $x = 1; $y = 2; $a1 = array($x, $y); $a2 = array($x, $y); $a2[0] = 3; print_r($a1); print_r($a2); ? i am expecting Array ( [0] = 3 [1] = 2 ) Array ( [0] = 3 [1] = 2 ) while i m getting Array ( [0] = 1 [1] = 2 ) Array ( [0] = 3 [1] = 2 ) any ideas why this is happening?? or am i missing something..? the same is the case when i replace $a2[0] = 3; with $a1[0] = 3; $x = 3; Kranthi. $a2[0] was assigned the value of $x or 1, so when you change $a2[0], that's all that changes. You have changed the value 1 to 3. $a1[0] is a reference to $x, so if you change $a1[0] it will change $x, but not $a2[0] because it is not a reference to $x. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET
Full disclosure: Marc Christopher Hall 1824 Windsor Park Lane Havertown, PA 19083 610.446.3346 Owner of HallMarc Websites since 2002 I was only making an observation based on a previous statement by the poster regarding their wishes of not being found out by the client that they were coming here for help. Thank you for asking! From: help [mailto:izod...@gmail.com] Sent: Friday, May 22, 2009 8:50 AM To: HallMarc Websites Cc: php-general@lists.php.net Subject: [SPAM] Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET HallMarc, why are you not using your name? How many client do you have on your website? On Fri, May 22, 2009 at 1:32 PM, HallMarc Websites m...@hallmarcwebsites.com wrote: Most likely afraid that his clients will find out he doesn't know what he is doing. -Original Message- From: Per Jessen [mailto:p...@computer.org] Sent: Friday, May 22, 2009 8:22 AM To: php-general@lists.php.net Subject: Re: [PHP] WHY ARE lists.php.ne http://lists.php.ne/ USER EMAIL BEING PUBLISH ON THE INTERNET Andrew Williams wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.com http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-f fie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t sourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t Isn't it common knowledge that places such as marc.info http://marc.info/ carry archives of e.g. php-general? I'm sure the list is also available at gmane.org http://gmane.org/ . Why are you writing in capitals - are you angry? /Per -- Per Jessen, Zürich (18.3°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from ESET Smart Security, version of virus signature database 4096 (20090522) __ The message was checked by ESET Smart Security. http://www.eset.com http://www.eset.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best Wishes A Williams
Re: [PHP] Re: reference variables
thank you for the reply. i had a small misunderstanding regarding variable reference...now its clear but.. the output of ?php $x = 1; $a1 = array($x); var_dump($a1); ? is array(1) { [0]= int(1) } while for ?php $x = 1; $a1 = array($x); var_dump($a1[0]); ? it is int(1) can u tell me what signifies here??
Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET
HallMarc, why are you not using your name? How many client do you have on your website? On Fri, May 22, 2009 at 1:32 PM, HallMarc Websites m...@hallmarcwebsites.com wrote: Most likely afraid that his clients will find out he doesn't know what he is doing. -Original Message- From: Per Jessen [mailto:p...@computer.org] Sent: Friday, May 22, 2009 8:22 AM To: php-general@lists.php.net Subject: Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET Andrew Williams wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t Isn't it common knowledge that places such as marc.info carry archives of e.g. php-general? I'm sure the list is also available at gmane.org. Why are you writing in capitals - are you angry? /Per -- Per Jessen, Zürich (18.3°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from ESET Smart Security, version of virus signature database 4096 (20090522) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best Wishes A Williams
Re: [PHP] Re: reference variables
On Fri, 2009-05-22 at 07:44 -0500, Shawn McKenzie wrote: kranthi wrote: i have this script ?php $x = 1; $y = 2; $a1 = array($x, $y); $a2 = array($x, $y); $a2[0] = 3; print_r($a1); print_r($a2); ? i am expecting Array ( [0] = 3 [1] = 2 ) Array ( [0] = 3 [1] = 2 ) while i m getting Array ( [0] = 1 [1] = 2 ) Array ( [0] = 3 [1] = 2 ) any ideas why this is happening?? or am i missing something..? the same is the case when i replace $a2[0] = 3; with $a1[0] = 3; $x = 3; Kranthi. $a2[0] was assigned the value of $x or 1, so when you change $a2[0], that's all that changes. You have changed the value 1 to 3. $a1[0] is a reference to $x, so if you change $a1[0] it will change $x, but not $a2[0] because it is not a reference to $x. -- Thanks! -Shawn http://www.spidean.com To get the results you expect, you should remove the from the assignment, as this is assigning by reference, rather than by value like Shawn said, or use an for $a2 as well. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apache user cannot execute useradd via sudo :(
On Fri, 2009-05-22 at 05:01 -0700, Michael A. Peters wrote: Make damn sure you validate the $username variable whatever solution you end up using. Yeah, I have a funny story along those lines. I was doing the same sort of thing, but allowing it to change passwords for a user. Luckily it was an internal system, but I was still miffed at the smart-alec who thought it would be funny to change the root password! Needless to say, I added a lot of safeguards into the both the PHP script and the Bash script to protect the system users and enforce a strict naming policy on what was allowed to change, so that only users in the form 'prefix_joebloggs', 'prefix_simon', etc were allowed. Luckily the system was all still in testing when that little gem was found. I hit myself for being so stupid afterwards! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
On Fri, 2009-05-22 at 12:59 +0100, Benjamin Hawkes-Lewis wrote: On 22/5/09 12:49, PJ wrote: Sorry, but no one suggested a mailing list for CSS and the W3 Schools Forum has problems. Actually, I did: http://www.css-discuss.org/ Why do I get completely different formatting with two identical classes? I want to change part of the formatting on just one page on the site using the exact same class with some changes so I don't modify other pages. I copied div#frame to div#frame1 and changed the class on the page to id=frame1. But now the page no longer displays the formatting as with id=frame - e.g.p produces 16px font-size instead of 12px. This description is confusing. Can you please link to a minimal test case showing the problem you're talking about, so that we can view your code and ideally probe it with DOM inspectors like Firebug? http://webkit.org/quality/reduction.html may help you produce one. In general, I'd suggest creating page-specific style variations by sticking a class on the body (e.g. body class=article ) and using that as a hook to modify the styling of the class whose formatting you want to be different. .thing { font-weight: bold; } .article .thing { font-style: italic; } for example. -- Benjamin Hawkers-Lewis That hook on the body tag is a good one, which I wish I'd thought of a few weeks back! I've been using PHP to pull in external stylesheets based on the current script name for a project I'm working on, as each page has unique tweaks on common elements. It's not like I don't even use selectors even now! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
On Fri, 2009-05-22 at 13:19 +0100, Benjamin Hawkes-Lewis wrote: On 22/5/09 13:02, Michael A. Peters wrote: If I recall - it is illegal to end a css class name is a number. Those are actually id names not class names, but it's not illegal in either case. HTML id attributes must follow this: http://www.w3.org/TR/html401/types.html#type-id XML id attributes must follow this: http://www.w3.org/TR/REC-xml/#NT-Name The class attribute is a CDATA list: http://www.w3.org/TR/html401/types.html#type-cdata Pretty much the only thing illegal in a classname is whitespace. You may be thinking of the restriction that HTML/XML id attributes may not /begin/ with a number. -- Benjamin Hawkes-Lewis There are certain bugs in IE that can cause problems with using what it considers reserved words for ID's or class names. I've run into problems before, particularly when using DXHTML (you know what I mean!) with elements that had ID's called 'name', etc, even when referencing the elements correctly with the getElementByID() DOM call. Also, I believe there used to be a bug in IE (not sure what versions) where classnames that were the same as ID's caused problems. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Forms validation and creation- easier solution?
On Fri, May 22, 2009 at 04:56:01AM -0300, Manuel Lemos wrote: Hello, on 05/20/2009 11:09 AM Paul M Foster said the following: Both this class and Manuel Lemos' form generation class (from phpclasses.org) will create beautiful forms for you. However, you may find that the amount of [repetitive] typing you do will be equivalent or greater than simply creating the form by hand. The best solution would probably be a form you fill out which asks you about all the fields you want, and then generates the code to paint the form. There are commercial solutions which do this, and some (not that great) free solutions. I'm working on one myself, which will eventually be a sourceforge/freshmeat project. Thank you for mentioning my package, but I am not sure what you mean. The Forms Generation and Validation package seems to do exactly what you describe and more. IMHO, creating forms by hand is by no means simpler, especially if you want to include browser side (Javascript) validation. I mean, I am not masochist to create something that will give me more work in the end to develop PHP forms based applications than if I would type HTML manually. Furthermore, the plug-ins that come with the package dramatically reduce the amount of code you need to type to achieve the same generating common HTML inputs manually. Anyone can judge by yourself by going here and see several example forms and the actual code that it takes to generate them: http://www.meta-language.net/forms-examples.html For instance this scaffolding plug-in generates CRUD forms that you often need to manage data stored for instance in databases. http://www.meta-language.net/forms-examples.html?example=test_scaffolding_input For those interested to check it out, the actual class package can be downloaded from here: http://www.phpclasses.org/formsgeneration Here you may watch an extensive tutorial video that covers practically all features: http://www.phpclasses.org/browse/video/1/package/1.html Here's what I was talking about. Assuming you simply type out your form fields like this: input type=text name=address size=30 value=123 Main St./ Now, if you do it with a class like yours: $arr = array('type' = 'text', 'name' = 'address', 'size' = 30, 'value' = '123 Main St.'); $form-AddInput($arr); (I haven't looked at your class in a while, so I may have invoked it slightly incorrectly.) If you compare the typing involved in the first case with the typing involved in the second case, you can see that it's more in the second case. Yes, your forms generation class includes a tremendous amount of proven code, including a bunch of Javascript validation, all of which the programmer doesn't have to develop himself. The only real complaint I have about your class is that the class file itself (forms.php) is 158+ K bytes, which must be loaded every time you surf to a page for the first time. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET
Does it really matter? Even the best programmers communicate amongst themselves. If your customers don't understand that, then they're going to be sorely disappointed pretty much anywhere they go. On Fri, May 22, 2009 at 9:06 AM, HallMarc Websites m...@hallmarcwebsites.com wrote: Full disclosure: Marc Christopher Hall 1824 Windsor Park Lane Havertown, PA 19083 610.446.3346 Owner of HallMarc Websites since 2002 I was only making an observation based on a previous statement by the poster regarding their wishes of not being found out by the client that they were coming here for help. Thank you for asking! From: help [mailto:izod...@gmail.com] Sent: Friday, May 22, 2009 8:50 AM To: HallMarc Websites Cc: php-general@lists.php.net Subject: [SPAM] Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET HallMarc, why are you not using your name? How many client do you have on your website? On Fri, May 22, 2009 at 1:32 PM, HallMarc Websites m...@hallmarcwebsites.com wrote: Most likely afraid that his clients will find out he doesn't know what he is doing. -Original Message- From: Per Jessen [mailto:p...@computer.org] Sent: Friday, May 22, 2009 8:22 AM To: php-general@lists.php.net Subject: Re: [PHP] WHY ARE lists.php.ne http://lists.php.ne/ USER EMAIL BEING PUBLISH ON THE INTERNET Andrew Williams wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.com http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-f fie=UTF-8rlz=1B3GGGL_enGB303GB303aq=thttp://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-f%0Afie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t sourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t Isn't it common knowledge that places such as marc.info http://marc.info/ carry archives of e.g. php-general? I'm sure the list is also available at gmane.org http://gmane.org/ . Why are you writing in capitals - are you angry? /Per -- Per Jessen, Zürich (18.3°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Information from ESET Smart Security, version of virus signature database 4096 (20090522) __ The message was checked by ESET Smart Security. http://www.eset.com http://www.eset.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best Wishes A Williams
Re: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA IN DATABASE
On Fri, May 22, 2009 at 6:35 AM, Andrew Williams andrew4willi...@gmail.com wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t On Fri, May 22, 2009 at 11:28 AM, Sumit Sharma sumitp...@gmail.com wrote: Thanks to [0] = Ashley, [1] =Bruce, [2] = Michael, [3] = Shawn, [4] = Eddie and php-general list for all your support from bottom of my heart. Now it seems as if I will be able to design my project more secured than before. If you get any other idea please suggest me. Thanks, Sumit. -- Forwarded message -- From: Michael A. Peters mpet...@mac.com Date: Fri, May 22, 2009 at 4:50 AM Subject: Re: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA IN DATABASE To: Eddie Drapkin oorza...@gmail.com Cc: php-general@lists.php.net Eddie Drapkin wrote: Suhosin is completely not-related to SQL, though, I don't know why you'd bring it up... I brought it up because suhosin catches many exploits that otherwise get through, including exploits that allow inclusion of remote files that can then be used to run arbitrary commands on the server, send include files (such as the db authentication script) as plain text, all kinds of nasty can result. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Best Wishes A Williams Because the lists are archived by several sites, and those archives are indexed by search engines. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why are lists.php.net user email being publish on the internet
Andrew Williams wrote: I have no problem with it at least user email address should be removed off the publication. - Show quoted text - Don't worry, at e.g. marc.info the addresses have been appropriately obscured. /Per -- Per Jessen, Zürich (20.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DOM Source of Selection
Hi I am working on a project wherein i have to extract information from a webpage and use it for processing. However that information becomes available only when i manually select a part of the webpage and view its source information (DOM source of selection ). Now i want this to be automated . Is there any way in PHP by which i can directly refer to that particular DOM and load its source , say directly into a variable . Thank You. -- N.Harihara Krishnan B.Tech (III year ) CSE NIT Trichy
Re: [PHP] Why are lists.php.net user email being publish on the internet
Per Jessen wrote: Andrew Williams wrote: I have no problem with it at least user email address should be removed off the publication. - Show quoted text - Don't worry, at e.g. marc.info the addresses have been appropriately obscured. Bottom line is when using a public list, if you don't want your e-mail address to be public you use something like yahoo or gmail for the list mail. Spam bots can and do subscribe to public lists to harvest e-mail addresses, if you are subscribed to a popular public list the spambots have your e-mail. That's just the way of things. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session.auto_start
1. If you do turn on session.auto_start then you cannot put objects into your sessions since the class definition has to be loaded before starting the session in order to recreate the objects in your session. but the official php manual suggests a workaround... http://in2.php.net/manual/en/intro.session.php 2. if u use session.auto_start u'll not be able to use named sessions. but since you have access to php.ini i dont think that will be much of a problem. 3. url may look messy if the client does not support cookies -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA IN DATABASE
not related to SQl but u may want to look at http://php-ids.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
On Fri, May 22, 2009 at 08:02, Michael A. Peters mpet...@mac.com wrote: If I recall - it is illegal to end a css class name is a number. I'm not positive though. You are correct. They just executed a man in Texas for this. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
On Fri, 2009-05-22 at 10:37 -0400, Daniel Brown wrote: On Fri, May 22, 2009 at 08:02, Michael A. Peters mpet...@mac.com wrote: If I recall - it is illegal to end a css class name is a number. I'm not positive though. You are correct. They just executed a man in Texas for this. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 They executed someone for this and still voted Bush in? Sheesh! I've never had any problems with ending classes with numbers, actually using it on a site at the moment that highlights keywords, by enclosing said words within span class=highlightx tags, where x is a number. No bugs in any browsers we've tested: IE, Fx, Opera, Safari, Chrome, Konqueror. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DOM Source of Selection
http://www.jonasjohn.de/lab/htmlsql.htm ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET
On Fri, May 22, 2009 at 06:42, Andrew Williams andrew4willi...@gmail.com wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t This has been the case for many, many years, and will not be changed. Further, it's beyond our control, as this is a public mailing list with all communications conducted openly, with allowances for content publishers to syndicate the content of this list as they see fit. As with most Internet communications, common sense tells you that if you don't want your words to be immortalized online, unplug your computer. ;-P You do have the right, however, to request (in writing to the third-party sites) that your personal information be removed from their systems --- including Google. For CAPS LOCK, see also: RFC 1855 (http://tools.ietf.org/html/rfc1855) -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reference variables
kranthi wrote: thank you for the reply. i had a small misunderstanding regarding variable reference...now its clear but.. the output of ?php $x = 1; $a1 = array($x); var_dump($a1); ? is array(1) { [0]= int(1) } while for ?php $x = 1; $a1 = array($x); var_dump($a1[0]); ? it is int(1) can u tell me what signifies here?? In the first instance you are var_dumping the entire array so it shows the structure/values of the array elements thus showing a reference to a var that is int(1). In the second instance you are var_dumping a specific var so you get the value of the var int(1). I'm not sure if there is a reason that it doesn't show that it is a reference, but the same is true here: $x = 1; $y = $x; var_dump($y); int(1) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IE can't download, FF can: SSL ? Need special headers?
The following code has been working for about 6 years. The only change I am aware of is that now it is being served from a server requiring SSL to access it. header(Content-type: $type); header(Content-length: $size); header(Content-Disposition: attachment; filename=\$name\); echo $data; It still works in FF, so I assume the variables are being filled in. For example: header(Content-type: application/pdf); header(Content-length: 75485); header(Content-Disposition: attachment; filename=\test.pdf\); In DebugBar HTTP(S) after the GET request which had to be authorized by htaccess it reports: HTTP/1.1 200 OK Date: Fri, 22 May 2009 14:38:18 GMT Server: Apache/2.0.50 (Fedora) X-Powered-By: PHP/5.1.6 Set-Cookie: PHPSESSID=743ba4d8e056873c4da52b123df4b1ad; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-length: 7359 Content-Disposition: attachment; filename=test.pdf Connection: close Content-Type: application/pdf Should HTTP/1.1 200 OK be HTTPS/1.1 200 OK? If so, how can I get that set? Is there some funky header I need? Oh, the IE 7 error is: Internet Explorer cannot download my_php_file.php?a_name=a_value from my.site.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. FYI: If the user cannot choose a filename to save as, it gets saved as my_php_file.php which needs to be renamed to extension .pdf to be viewed in a PDF viewer. So if you have any helpful headers to force the filename, I'd appreciate that too. Apparently Content-Disposition: attachment; filename=test.pdf doesn't work (on FF and maybe other browsers). There is an issue with Internet Explorer 6 http://support.microsoft.com/?kbid=816037 that seems to relate, but this is for IE 7, and I can't verify if it is also failing on IE 6. But I found this (which didn't work for me) http://www.vistaheads.com/forums/microsoft-public-internetexplorer-general/313324-downloading-ftp-files-ie7.html Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IE can't download, FF can: SSL ? Need special headers?
SSL occurs a layer above HTTP, so HTTP/1.1 is correct. HTTPS is not a different data protocol, but a different transport protocol. HTH, Kyle -Original Message- From: Dee Ayy [mailto:dee@gmail.com] Sent: Friday, May 22, 2009 11:05 AM To: php-general@lists.php.net Subject: [PHP] IE can't download, FF can: SSL ? Need special headers? The following code has been working for about 6 years. The only change I am aware of is that now it is being served from a server requiring SSL to access it. header(Content-type: $type); header(Content-length: $size); header(Content-Disposition: attachment; filename=\$name\); echo $data; It still works in FF, so I assume the variables are being filled in. For example: header(Content-type: application/pdf); header(Content-length: 75485); header(Content-Disposition: attachment; filename=\test.pdf\); In DebugBar HTTP(S) after the GET request which had to be authorized by htaccess it reports: HTTP/1.1 200 OK Date: Fri, 22 May 2009 14:38:18 GMT Server: Apache/2.0.50 (Fedora) X-Powered-By: PHP/5.1.6 Set-Cookie: PHPSESSID=743ba4d8e056873c4da52b123df4b1ad; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-length: 7359 Content-Disposition: attachment; filename=test.pdf Connection: close Content-Type: application/pdf Should HTTP/1.1 200 OK be HTTPS/1.1 200 OK? If so, how can I get that set? Is there some funky header I need? Oh, the IE 7 error is: Internet Explorer cannot download my_php_file.php?a_name=a_value from my.site.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. FYI: If the user cannot choose a filename to save as, it gets saved as my_php_file.php which needs to be renamed to extension .pdf to be viewed in a PDF viewer. So if you have any helpful headers to force the filename, I'd appreciate that too. Apparently Content-Disposition: attachment; filename=test.pdf doesn't work (on FF and maybe other browsers). There is an issue with Internet Explorer 6 http://support.microsoft.com/?kbid=816037 that seems to relate, but this is for IE 7, and I can't verify if it is also failing on IE 6. But I found this (which didn't work for me) http://www.vistaheads.com/forums/microsoft-public-internetexplorer-gener al/313324-downloading-ftp-files-ie7.html Regards. -- 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
Re: [PHP] WHY ARE lists.php.ne USER EMAIL BEING PUBLISH ON THE INTERNET
Andrew Williams wrote: WHY IS php-general@lists.php.net PUBLISHING USER EMAIL ON THE INTERNET: http://www.google.co.uk/search?q=sumitphp5%40gmail.comsourceid=navclient-ffie=UTF-8rlz=1B3GGGL_enGB303GB303aq=t Many private lists are redistributed via archive services. Not a lot we can do about it as the information is quite open. When you have been around a few more years you will reach a decent figure on your own email name search ;) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
On Fri, May 22, 2009 at 11:07 AM, kyle.smith kyle.sm...@inforonics.comwrote: SSL occurs a layer above HTTP, so HTTP/1.1 is correct. HTTPS is not a different data protocol, but a different transport protocol. HTH, Kyle -Original Message- From: Dee Ayy [mailto:dee@gmail.com] Sent: Friday, May 22, 2009 11:05 AM To: php-general@lists.php.net Subject: [PHP] IE can't download, FF can: SSL ? Need special headers? The following code has been working for about 6 years. The only change I am aware of is that now it is being served from a server requiring SSL to access it. header(Content-type: $type); header(Content-length: $size); header(Content-Disposition: attachment; filename=\$name\); echo $data; It still works in FF, so I assume the variables are being filled in. For example: header(Content-type: application/pdf); header(Content-length: 75485); header(Content-Disposition: attachment; filename=\test.pdf\); In DebugBar HTTP(S) after the GET request which had to be authorized by htaccess it reports: HTTP/1.1 200 OK Date: Fri, 22 May 2009 14:38:18 GMT Server: Apache/2.0.50 (Fedora) X-Powered-By: PHP/5.1.6 Set-Cookie: PHPSESSID=743ba4d8e056873c4da52b123df4b1ad; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-length: 7359 Content-Disposition: attachment; filename=test.pdf Connection: close Content-Type: application/pdf Should HTTP/1.1 200 OK be HTTPS/1.1 200 OK? If so, how can I get that set? Is there some funky header I need? Oh, the IE 7 error is: Internet Explorer cannot download my_php_file.php?a_name=a_value from my.site.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. FYI: If the user cannot choose a filename to save as, it gets saved as my_php_file.php which needs to be renamed to extension .pdf to be viewed in a PDF viewer. So if you have any helpful headers to force the filename, I'd appreciate that too. Apparently Content-Disposition: attachment; filename=test.pdf doesn't work (on FF and maybe other browsers). There is an issue with Internet Explorer 6 http://support.microsoft.com/?kbid=816037 that seems to relate, but this is for IE 7, and I can't verify if it is also failing on IE 6. But I found this (which didn't work for me) http://www.vistaheads.com/forums/microsoft-public-internetexplorer-gener al/313324-downloading-ftp-files-ie7.htmlhttp://www.vistaheads.com/forums/microsoft-public-internetexplorer-gener%0Aal/313324-downloading-ftp-files-ie7.html Regards. -- 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 I have had the same issue with IE. What I did was save the file to the hard disk and then attempt the download. That has worked well. -- Bastien Cat, the other other white meat
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
Kyle, Well I guess that is good news. But I don't trust these headers since the filename is not being set. But that was even before this IE issue. Bastien, I don't understand how I could save the file to the hard disk from IE. But yes, I save the file (it gets saved as my_php_file.php on the hard disk when using FF) which I then rename to my_php_file.pdf, and then I open that in a PDF viewer. But IE claims that the site is either unavailable or cannot be found. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
On Fri, May 22, 2009 at 11:04 AM, Dee Ayy dee@gmail.com wrote: The following code has been working for about 6 years. The only change I am aware of is that now it is being served from a server requiring SSL to access it. header(Content-type: $type); header(Content-length: $size); header(Content-Disposition: attachment; filename=\$name\); echo $data; It still works in FF, so I assume the variables are being filled in. For example: header(Content-type: application/pdf); header(Content-length: 75485); header(Content-Disposition: attachment; filename=\test.pdf\); In DebugBar HTTP(S) after the GET request which had to be authorized by htaccess it reports: HTTP/1.1 200 OK Date: Fri, 22 May 2009 14:38:18 GMT Server: Apache/2.0.50 (Fedora) X-Powered-By: PHP/5.1.6 Set-Cookie: PHPSESSID=743ba4d8e056873c4da52b123df4b1ad; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-length: 7359 Content-Disposition: attachment; filename=test.pdf Connection: close Content-Type: application/pdf Should HTTP/1.1 200 OK be HTTPS/1.1 200 OK? If so, how can I get that set? Is there some funky header I need? Oh, the IE 7 error is: Internet Explorer cannot download my_php_file.php?a_name=a_value from my.site.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later. FYI: If the user cannot choose a filename to save as, it gets saved as my_php_file.php which needs to be renamed to extension .pdf to be viewed in a PDF viewer. So if you have any helpful headers to force the filename, I'd appreciate that too. Apparently Content-Disposition: attachment; filename=test.pdf doesn't work (on FF and maybe other browsers). There is an issue with Internet Explorer 6 http://support.microsoft.com/?kbid=816037 that seems to relate, but this is for IE 7, and I can't verify if it is also failing on IE 6. But I found this (which didn't work for me) http://www.vistaheads.com/forums/microsoft-public-internetexplorer-general/313324-downloading-ftp-files-ie7.html Regards. I'm not sure about IE7 specifically, but IE is touchy about downloading documents - especially PDFs. Here are a few things I keep in mind that have worked so far: For all browsers, we send the following headers (which you appear to be setting): - Content-Type with the correct MIME type - Content-Disposition as attachment with the file name. I have found that the filename should be urlencoded to prevent problems with the file name not being recognized by the browser. - Content-Length - Content-Transfer-Encoding: binary For MSIE, identified by user-agent* we also add cache control since IE has a problem handling PDF documents when the headers direct it to not cache the document: - Expires: date('r', strtotime('+3 hours')) - Cache-Control: max-age=60 - Pragma: public * Yes, I know user-agent isn't very reliable, but generally it won't hurt other browsers if these headers are added to someone who happens to be spoofing IE. This has worked pretty well for us so far, and these are being served via SSL. (Not that they need to be, since they are just blank forms, but it prevents warnings since the rest of the site is SSL.) From what I can tell, IE has a problem with PDFs that are not cached. It seems that to handle the documents, it saves a copy in the temp folder and then directs Adobe to open that file when it spawns the reader. When you tell IE not to cache the document, it dutifully obliges, but it still tells Adobe to open the file from the temp folder. At least, that's what it looks like it tries to do. To get around the filename problems, you could also use some sort of mod_rewrite where the URL requested is the actual PDF name but let PHP handle the request if the above doesn't work for you. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
On Fri, May 22, 2009 at 11:21 AM, Dee Ayy dee@gmail.com wrote: Kyle, Well I guess that is good news. But I don't trust these headers since the filename is not being set. But that was even before this IE issue. Bastien, I don't understand how I could save the file to the hard disk from IE. But yes, I save the file (it gets saved as my_php_file.php on the hard disk when using FF) which I then rename to my_php_file.pdf, and then I open that in a PDF viewer. But IE claims that the site is either unavailable or cannot be found. Why are you saving the file first as PHP and then renaming to PDF? Below is the code that I use (which uses the DOMPDF class from digitaljunkies.ca ?php /* createPDF creates a pdf and streams it to the user if FF / O / S or saves it and forces a download if IE $html - the html page used to create the content $thisFileName - is the name of the file to be saved $hash - hash of the user to use as the path to the save the file to */ function createPDF($html,$thisFileName,$hash) { require_once(includes/dompdf_config.inc.php); // Turn off all error reporting //error_reporting(0); $dompdf = new DOMPDF(); $dompdf-load_html($html); $dompdf-render(); // The next call will store the entire PDF as a string in $pdf $pdf = $dompdf-output(); // You can now write $pdf to disk, store it in a database or stream it // to the client. //check if IE,since it doesn't like the stream, so we save it to disk and then stream the saved file $browserCheck = browserDetection(); if ($browserCheck) { if (!is_dir(../data/$hash)) { mkdir(../data/$hash); } // end is_dir check // save the file if(!file_put_contents(../data/$hash/$thisFileName, $pdf)) { echo failed to write new pdf file; } // output to the browser showPDF(../data/$hash/$thisFileName); }else{ $dompdf-stream($thisFileName); }// if user agent }//end function createPDF function browserDetection() { $UA = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; $SF = strstr($UA, 'Safari') ? true : false; $OP = strstr($UA, 'Opera') ? true : false; $OPV = $OP ? preg_split('/opera\//i', $UA) : false; $OPV = $OPV ? floatval($OPV[1]) : false; $FF = !$OP strstr($UA, 'Firefox') ? true : false; $FFV = $FF ? preg_split('/firefox\//i', $UA) : false; $FFV = $FFV ? floatval($FFV[1]) : false; $IE = !$OP !$FF strstr($UA, 'MSIE') ? true : false; $IEV = $IE ? preg_split('/msie/i', $UA) : false; $IEV = $IEV ? floatval($IEV[1]) : false; if ($IE){ return true; }else{ return false; } }//end function broswerDetection function showPDF($file) { $name = basename($file); header(Cache-Control: maxage=1); //In seconds header(Pragma: public); // We'll be outputting a PDF header('Content-type: application/pdf'); // It will be called $name.pdf header('Content-Disposition: attachment; filename=$name'); // The PDF source is in original.pdf readfile($file); }//end function showPDF ? -- Bastien Cat, the other other white meat
[PHP] Legal $_SESSION names
Hi gang: While we're discussing what's legal in css, here's a couple of things I've found about sessions. I found that starting a session with a number doesn't work. $myvar = $_SESSION['1myvar']; I also found that dumping a session to a variable with the same name may cause problems, such as: $myvar = $_SESSION['myvar']; Regardless of what anyone may say to the contrary, it doesn't work everywhere. I found that out the hard way. The fix is simply to use a different name for the variable, such as: $my_var = $_SESSION['myvar']; Hopes this help someone. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Legal $_SESSION names
On Fri, 2009-05-22 at 11:30 -0400, tedd wrote: Hi gang: While we're discussing what's legal in css, here's a couple of things I've found about sessions. I found that starting a session with a number doesn't work. $myvar = $_SESSION['1myvar']; I also found that dumping a session to a variable with the same name may cause problems, such as: $myvar = $_SESSION['myvar']; Regardless of what anyone may say to the contrary, it doesn't work everywhere. I found that out the hard way. The fix is simply to use a different name for the variable, such as: $my_var = $_SESSION['myvar']; Hopes this help someone. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com The second case won't work if you have register globals turned on I believe, as it will attempt to create $_SESSION['myvar'] as $myvar. I believe that RG might have something to do with the first as well. I seem to remember a thread a while back talking about sessions not being able to use numbered indexes because they are a special super global. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
Daniel Brown wrote: On Fri, May 22, 2009 at 08:02, Michael A. Peters mpet...@mac.com wrote: If I recall - it is illegal to end a css class name is a number. I'm not positive though. You are correct. They just executed a man in Texas for this. Yes we did, however that infraction is what led to the discovery of his multiple rapes and brutal murders. Damn yanks. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
Moral of the story: if you use css classes ending in numbers, you're probably a rapist and/or murderer. On Fri, May 22, 2009 at 11:46 AM, Shawn McKenzie nos...@mckenzies.netwrote: Daniel Brown wrote: On Fri, May 22, 2009 at 08:02, Michael A. Peters mpet...@mac.com wrote: If I recall - it is illegal to end a css class name is a number. I'm not positive though. You are correct. They just executed a man in Texas for this. Yes we did, however that infraction is what led to the discovery of his multiple rapes and brutal murders. Damn yanks. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
On Fri, May 22, 2009 at 11:50 AM, Eddie Drapkin oorza...@gmail.com wrote: Moral of the story: if you use css classes ending in numbers, you're probably a rapist and/or murderer. On Fri, May 22, 2009 at 11:46 AM, Shawn McKenzie nos...@mckenzies.net wrote: Daniel Brown wrote: On Fri, May 22, 2009 at 08:02, Michael A. Peters mpet...@mac.com wrote: If I recall - it is illegal to end a css class name is a number. I'm not positive though. You are correct. They just executed a man in Texas for this. Yes we did, however that infraction is what led to the discovery of his multiple rapes and brutal murders. Damn yanks. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Or don't go to Texas! -- Bastien Cat, the other other white meat
Re: [PHP] Legal $_SESSION names
At 4:52 PM +0100 5/22/09, Ashley Sheridan wrote: On Fri, 2009-05-22 at 11:30 -0400, tedd wrote: Hi gang: While we're discussing what's legal in css, here's a couple of things I've found about sessions. I found that starting a session with a number doesn't work. $myvar = $_SESSION['1myvar']; I also found that dumping a session to a variable with the same name may cause problems, such as: $myvar = $_SESSION['myvar']; Regardless of what anyone may say to the contrary, it doesn't work everywhere. I found that out the hard way. The fix is simply to use a different name for the variable, such as: $my_var = $_SESSION['myvar']; Hopes this help someone. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com The second case won't work if you have register globals turned on I believe, as it will attempt to create $_SESSION['myvar'] as $myvar. I believe that RG might have something to do with the first as well. I seem to remember a thread a while back talking about sessions not being able to use numbered indexes because they are a special super global. Ash www.ashleysheridan.co.uk Ash: You are right, but here's the rub -- when you have register globals turned on and you use: $myvar = $_SESSION['myvar']; This sometimes works and sometimes fails. I had an entire site where I had been using the same names for attributes and variables throughout and suddenly one page didn't work. All other pages worked just fine, but this single page didn't. I searched high and low for an answer and found a vague reference where someone else had run into a similar problem and found the solution was to change the variable name. So I did with that single page and everything worked. Why did that single page not work and everything else did? I haven't a clue, but I will say that I reduced the problem to that specifically and that *was* the problem. Additionally, why was that problem not realized in the other pages on the same site -- I don't know, but this was an example of sometimes it works, and sometimes it doesn't -- a heck of a way to run a railroad. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] urgent CSS question
Date: Fri, 22 May 2009 11:55:55 -0400 From: phps...@gmail.com To: oorza...@gmail.com CC: nos...@mckenzies.net; php-general@lists.php.net Subject: Re: [PHP] urgent CSS question On Fri, May 22, 2009 at 11:50 AM, Eddie Drapkin oorza...@gmail.com wrote: Moral of the story: if you use css classes ending in numbers, you're probably a rapist and/or murderer. On Fri, May 22, 2009 at 11:46 AM, Shawn McKenzie nos...@mckenzies.net wrote: Daniel Brown wrote: On Fri, May 22, 2009 at 08:02, Michael A. Peters mpet...@mac.com wrote: If I recall - it is illegal to end a css class name is a number. I'm not positive though. You are correct. They just executed a man in Texas for this. Yes we did, however that infraction is what led to the discovery of his multiple rapes and brutal murders. Damn yanks. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Or don't go to Texas! Or simply avoid CSS and revert to pure HTML. At least there won't be convictions for that. Alugo Abdulazeez. _ Drag n’ drop—Get easy photo sharing with Windows Live™ Photos. http://www.microsoft.com/windows/windowslive/products/photos.aspx
Re: [PHP] Legal $_SESSION names
On Fri, 2009-05-22 at 12:01 -0400, tedd wrote: At 4:52 PM +0100 5/22/09, Ashley Sheridan wrote: On Fri, 2009-05-22 at 11:30 -0400, tedd wrote: Hi gang: While we're discussing what's legal in css, here's a couple of things I've found about sessions. I found that starting a session with a number doesn't work. $myvar = $_SESSION['1myvar']; I also found that dumping a session to a variable with the same name may cause problems, such as: $myvar = $_SESSION['myvar']; Regardless of what anyone may say to the contrary, it doesn't work everywhere. I found that out the hard way. The fix is simply to use a different name for the variable, such as: $my_var = $_SESSION['myvar']; Hopes this help someone. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com The second case won't work if you have register globals turned on I believe, as it will attempt to create $_SESSION['myvar'] as $myvar. I believe that RG might have something to do with the first as well. I seem to remember a thread a while back talking about sessions not being able to use numbered indexes because they are a special super global. Ash www.ashleysheridan.co.uk Ash: You are right, but here's the rub -- when you have register globals turned on and you use: $myvar = $_SESSION['myvar']; This sometimes works and sometimes fails. I had an entire site where I had been using the same names for attributes and variables throughout and suddenly one page didn't work. All other pages worked just fine, but this single page didn't. I searched high and low for an answer and found a vague reference where someone else had run into a similar problem and found the solution was to change the variable name. So I did with that single page and everything worked. Why did that single page not work and everything else did? I haven't a clue, but I will say that I reduced the problem to that specifically and that *was* the problem. Additionally, why was that problem not realized in the other pages on the same site -- I don't know, but this was an example of sometimes it works, and sometimes it doesn't -- a heck of a way to run a railroad. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com It's an odd one, no doubt about that! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
I went with this, modified from http://php.he.net/readfile docs example 1: header('Content-Description: File Transfer'); header('Content-Type: '.$type); header('Content-Disposition: attachment; filename='.basename($name)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: '.$size); echo $data; And it works in FF 3.0.10 and IE 7 and Safari 3.2.1. I thought it would be some header magic. Bastien, I think because I was not urlencoding or not basenaming the filename, it would come through as the name of the script if the name had a space in it. test.pdf actually came through with the name test.pdf. But the real filenames are like QUOTE Part 1-2 Prospect Name.pdf. Thanks everybody. I was looking up those other header names and case sensitivity when I found the readfile example. DebugBar reports a different case than what I sent, so I thought that could be an issue too (like Content-Length versus Content-length). Moot for me now though. Re-RTFM I guess. Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
Acceptable results, but could be better. basename works correctly for only Safari (filenames with spaces are correct). FF truncates the name starting with the first space. IE puts an underscore in place of a space. urlencode puts a plus sign in place of a space for all 3 browsers. But I've always had a note telling the user to rename the file to something useful, so I'll keep basename and not check the agent. Thoughts? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
Find the Computed Style and how it was inherited (cascaded). In Safari, use Web Inspector. In Firefox, use Firebug. In Internet Explorer, use DebugBar. All free as in $0. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
On Fri, May 22, 2009 at 1:36 PM, Dee Ayy dee@gmail.com wrote: Acceptable results, but could be better. basename works correctly for only Safari (filenames with spaces are correct). FF truncates the name starting with the first space. IE puts an underscore in place of a space. urlencode puts a plus sign in place of a space for all 3 browsers. But I've always had a note telling the user to rename the file to something useful, so I'll keep basename and not check the agent. Thoughts? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php what about just CamelCasing the name? no spaces. -- Bastien Cat, the other other white meat
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
or even just str_replace(' ' , '_', $name) consistent and works, no? On Fri, May 22, 2009 at 2:21 PM, Bastien Koert phps...@gmail.com wrote: On Fri, May 22, 2009 at 1:36 PM, Dee Ayy dee@gmail.com wrote: Acceptable results, but could be better. basename works correctly for only Safari (filenames with spaces are correct). FF truncates the name starting with the first space. IE puts an underscore in place of a space. urlencode puts a plus sign in place of a space for all 3 browsers. But I've always had a note telling the user to rename the file to something useful, so I'll keep basename and not check the agent. Thoughts? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php what about just CamelCasing the name? no spaces. -- Bastien Cat, the other other white meat
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
On Fri, May 22, 2009 at 1:24 PM, Eddie Drapkin oorza...@gmail.com wrote: or even just str_replace(' ' , '_', $name) consistent and works, no? Good one. Put it back on me rather than the browser developers. But that's in line with my requesting the user to use underscores. I'll implement this str_replace. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unsubscribe from php-general@lists.php.net
-- Tom Merriam Cell: 512.639.5589 Home: 512.869.6401 twmerr...@gmail.com
Re: [PHP] IE can't download, FF can: SSL ? Need special headers?
On Fri, 2009-05-22 at 13:26 -0500, Dee Ayy wrote: Thoughts? -- what about just CamelCasing the name? no spaces. -- Bastien I've asked the user to use underscores, but they really shouldn't have to. Safari gets it right. I've found that header(Content-Disposition: attachment; filename=\$filename\); seems to work for me note, that's untested as i wrote it there, but i had a similar problem at work and found that enclosing the filename in double quotes worked for all the browsers i tested on. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unsubscribe from php-general@lists.php.net
On Fri, 2009-05-22 at 15:06 -0400, Eddie Drapkin wrote: :( On Fri, May 22, 2009 at 2:55 PM, Tom Merriam twmerr...@gmail.com wrote: -- Tom Merriam Cell: 512.639.5589 Home: 512.869.6401 twmerr...@gmail.com I don't think this worked for him, else we wouldn't have got this message :-/ Tom, the right address to send this to is in the email headers you get sent from the list. Instructions are online as to the form of the email you send it. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
Benjamin Hawkes-Lewis wrote: On 22/5/09 13:27, PJ wrote: Ok, I have duplicate classes - #frame and #frame1. Let's get our terminology straight: ids are not classes; classes are not ids. ids look like: id=thing and are selected like: #thing classes look like: class=thing other-thing and are selected like .thing An element may have zero or one IDs. An element may have zero or more classes. id is supposed to be unique within a given document. The same classname may be used multiple times in the same document. See: http://css.maxdesign.com.au/selectutorial/advanced_idclass.htm What I don't understand is why switching from #frame to #frame1 should change formatting. #frame targets an element with id=frame while frame1 targets an element with id=frame1. So I'm not sure what these have to do with one another. The two classes are absolutely the same, the only difference is the 1 in the name. Which is to say they are utterly different, since they have different names. They may have different names, but does that change their functionality? They are identical except for the 1 in the title of the id. So, if I change the one id to the other in the same code, I don't understand why the formatting would change? Obviously, the parents and the children have not changed unless there's some weird hanky-panky going on. The simple reason to change the id is to avoid messing up the appearance of other pages that are using the same css file. Or do I have to make a new css file for every page; that would be a little ridiculous, wouldn't it? And to follow the logic here, if I create a different id and in the end it turns out to be identical to the original frame except for the name, shouldn't it function the same. There is no need to see sample code because the code does not change THE ONLY THING THAT IS CHANGED IS THE ID NAME ! and, I mean only the name... the only plausible explanation would be the change within the css file and that implies that there is something funny going on within that file. Or are there unseen elements being kept alive when there is a change in the nomenclature of the id? Or does the browser keep things in memory or are the memory modules having neuron crises? As I have stated before, this is the kind of thing that drives one crazy trying to understand the un-understandable. I would logically assume that the interpreter or whoever is operating this stuff would understand that the page is using a different class, whether it is the same name as another or not. I'm sorry, I don't know what you mean. If I create still another class and start to format the various sections of that class, I will wind up with the identical class as #frame1. Again, I don't know what you mean. So where is the logic here? Without seeing some clear test case links that reproduces the problem for us, I really can't comment about that. It seems to me that what I am trying to do is logically and intuitively clear and simple. What you're trying to do really isn't clear to me. Being able to see the problem (and the underlying code) might help. -- Benjamin Hawkes-Lewis -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Rogue 'if - elseif' code
Hi, I'm having problems with a chunk of 'rogue' code that does not perform as expected (it does not pass the expected date, but an empty value). Most of the time, it works - so I'm wondering whether it might be a browser issue. (The latest failure occurred with Firfeox 3.0 browser on an NT 5.1 OS.) The code is stored on an Unix server, running PHP 5.x. I've isolated it down to multiple if - elseif statements that check long dates for completeness, day month and year. The code then applies it results printing one of following: the full date - 22 May 2009, month-year - May 2009, or just the year, 2009. My question is whether the ORDER of checking is important, i.e, whether checking for the null sets BEFORE full sets or AFTER. I've added debugging code to be able to get the raw POST values so I can manually enter it into the db, but I would really appreciate some help here. The code is old -- I wrote it seven years ago, and had worked well until I modified it, but I no longer have the original working code. [The first conditional line of the code checks whether the user has entered the birth date, then it checks for the death date. The $_SESSION stuff is debugging code.] ?php $yd = $_POST['death']; $yb = $_POST['birth']; if ($_POST['bday'] == Day $_POST['bmonth'] == Month $_POST['birth'] == Year) { if ($_POST['dday'] != Day $_POST['dmonth'] != Month $_POST['death'] != Year) { $_POST['rdod'] = ({$_POST['dday']} {$_POST['dmonth']} {$_POST['death']}); $_SESSION['ALL1rdod'] = $_POST['rdod']; } elseif ($_POST['dday'] == Day $_POST['dmonth'] == Month $_POST['death'] != Year) { $_POST['rdod'] = $_POST['death']; $_SESSION['YEAR1rdod'] = $_POST['rdod']; } elseif ($_POST['dday'] == Day $_POST['dmonth'] != Month $_POST['death'] != Year) { $_POST['rdod'] = ({$_POST['dmonth']} {$_POST['death']}); $_SESSION['MONTHYEAR1rdod'] = $_POST['rdod']; } $_SESSION['Sdebugdod1'] = {$_POST['dday']} {$_POST['dmonth']} {$_POST['death']}; } else { if ($yd $yb) { if ($_POST['bday'] != Day $_POST['bmonth'] != Month $_POST['birth'] != Year) { $_POST['rdob'] = ({$_POST['bday']} {$_POST['bmonth']} {$_POST['birth']}); } elseif ($_POST['bday'] == Day $_POST['bmonth'] == Month $_POST['birth'] != Year) { $_POST['rdob'] = $_POST['birth']; } elseif ($_POST['bday'] == Day $_POST['bmonth'] != Month $_POST['birth'] != Year) { $_POST['rdob'] = ({$_POST['bmonth']} {$_POST['birth']}); } if ($_POST['dday'] != Day $_POST['dmonth'] != Month $_POST['death'] != Year) { $_POST['rdod'] = ({$_POST['dday']} {$_POST['dmonth']} {$_POST['death']}); $_SESSION['ALL2rdod'] = $_POST['rdod']; } elseif ($_POST['dday'] == Day $_POST['dmonth'] == Month $_POST['death'] != Year) { $_POST['rdod'] = $_POST['death']; $_SESSION['YEAR2rdod'] = $_POST['rdod']; } elseif ($_POST['dday'] == Day $_POST['dmonth'] != Month $_POST['death'] != Year) { $_POST['rdod'] = ({$_POST['dmonth']} {$_POST['death']}); $_SESSION['MONTHYEAR2rdod'] = $_POST['rdod']; } $_SESSION['Sdebugdod2'] = {$_POST['dday']} {$_POST['dmonth']} {$_POST['death']};
[PHP] Re: Rogue 'if - elseif' code
Andre Dubuc wrote: Hi, I'm having problems with a chunk of 'rogue' code that does not perform as expected (it does not pass the expected date, but an empty value). Most of the time, it works - so I'm wondering whether it might be a browser issue. (The latest failure occurred with Firfeox 3.0 browser on an NT 5.1 OS.) The code is stored on an Unix server, running PHP 5.x. I've isolated it down to multiple if - elseif statements that check long dates for completeness, day month and year. The code then applies it results printing one of following: the full date - 22 May 2009, month-year - May 2009, or just the year, 2009. My question is whether the ORDER of checking is important, i.e, whether checking for the null sets BEFORE full sets or AFTER. I've added debugging code to be able to get the raw POST values so I can manually enter it into the db, but I would really appreciate some help here. The code is old -- I wrote it seven years ago, and had worked well until I modified it, but I no longer have the original working code. [The first conditional line of the code checks whether the user has entered the birth date, then it checks for the death date. The $_SESSION stuff is debugging code.] ?php $yd = $_POST['death']; $yb = $_POST['birth']; if ($_POST['bday'] == Day $_POST['bmonth'] == Month $_POST['birth'] == Year) { if ($_POST['dday'] != Day $_POST['dmonth'] != Month $_POST['death'] != Year) { $_POST['rdod'] = ({$_POST['dday']} {$_POST['dmonth']} {$_POST['death']}); $_SESSION['ALL1rdod'] = $_POST['rdod']; } elseif ($_POST['dday'] == Day $_POST['dmonth'] == Month $_POST['death'] != Year) { $_POST['rdod'] = $_POST['death']; $_SESSION['YEAR1rdod'] = $_POST['rdod']; } elseif ($_POST['dday'] == Day $_POST['dmonth'] != Month $_POST['death'] != Year) { $_POST['rdod'] = ({$_POST['dmonth']} {$_POST['death']}); $_SESSION['MONTHYEAR1rdod'] = $_POST['rdod']; } $_SESSION['Sdebugdod1'] = {$_POST['dday']} {$_POST['dmonth']} {$_POST['death']}; } else { if ($yd $yb) { if ($_POST['bday'] != Day $_POST['bmonth'] != Month $_POST['birth'] != Year) { $_POST['rdob'] = ({$_POST['bday']} {$_POST['bmonth']} {$_POST['birth']}); } elseif ($_POST['bday'] == Day $_POST['bmonth'] == Month $_POST['birth'] != Year) { $_POST['rdob'] = $_POST['birth']; } elseif ($_POST['bday'] == Day $_POST['bmonth'] != Month $_POST['birth'] != Year) { $_POST['rdob'] = ({$_POST['bmonth']} {$_POST['birth']}); } if ($_POST['dday'] != Day $_POST['dmonth'] != Month $_POST['death'] != Year) { $_POST['rdod'] = ({$_POST['dday']} {$_POST['dmonth']} {$_POST['death']}); $_SESSION['ALL2rdod'] = $_POST['rdod']; } elseif ($_POST['dday'] == Day $_POST['dmonth'] == Month $_POST['death'] != Year) { $_POST['rdod'] = $_POST['death']; $_SESSION['YEAR2rdod'] = $_POST['rdod']; } elseif ($_POST['dday'] == Day $_POST['dmonth'] != Month $_POST['death'] != Year) { $_POST['rdod'] = ({$_POST['dmonth']} {$_POST['death']}); $_SESSION['MONTHYEAR2rdod'] = $_POST['rdod']; } $_SESSION['Sdebugdod2'] = {$_POST['dday']} {$_POST['dmonth']} {$_POST['death']}; } ? Any help or pointers would be greatly appreciated! Tia, Andre makes no sense at all to me without some decent variable names rdod? - would also need the form to be honest, and a description of the functionality needed. one thing i can
Re: [PHP] urgent CSS question
On 22/5/09 20:31, PJ wrote: They may have different names, but does that change their functionality? Potentially, yes! A selector including #frame will no longer match if id is changed to frame1, and vice versa. They are identical except for the 1 in the title of the id. So, if I change the one id to the other in the same code, I don't understand why the formatting would change? These descriptions are still far too vague and ambiguous. Please link to two test cases: 1) Effectively showing frame1. 2) Effectively showing frame. that illustrate the problem you're talking about. Obviously, the parents and the children have not changed unless there's some weird hanky-panky going on. Without seeing test cases, nothing is obvious. Or do I have to make a new css file for every page Only if you're doing it wrong. :) And to follow the logic here, if I create a different id and in the end it turns out to be identical to the original frame except for the name, shouldn't it function the same. That depends on: 1) The contents of your CSS file, which I can't see. 2) Whether you've made any errors when modifying your HTML, which I can't see either. If you provided test cases, I could see these things and answer your questions. Trying to describe the problem rather than /showing/ the problem is very inefficient. -- Benjamin Hawkes-Lewis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A Rich Ajax Application Frameowrk for PHP
Hello Everyone, I would like to introduce you to a new framework called Raxan PDI that I've being working on for the past couple of months. Raxan PDI is an Open Source PHP Framework that seamlessly blends the unique features of modern web application development into one seamless interface. Today we have release Beta 1 with the following new features: * New XML Support * Mobile Web Application Support * Template Binder * Data Pagination * Ajax Event Binding Options * and lots more... PDI provides a consistent set of APIs for handling HTML, WML and XML documents. To see it in action or learn more about the framework, please visit http://raxanpdi.com/ PS. If you would like to contribute to this project, please feel free to drop me a line or join our online community forum at http://raxanpdi.com/forum. Best regards, __ Raymond Irving
Re: [PHP] Forms validation and creation- easier solution?
Viva, on 05/22/2009 10:36 AM Paul M Foster said the following: IMHO, creating forms by hand is by no means simpler, especially if you want to include browser side (Javascript) validation. I mean, I am not masochist to create something that will give me more work in the end to develop PHP forms based applications than if I would type HTML manually. Furthermore, the plug-ins that come with the package dramatically reduce the amount of code you need to type to achieve the same generating common HTML inputs manually. Anyone can judge by yourself by going here and see several example forms and the actual code that it takes to generate them: http://www.meta-language.net/forms-examples.html For instance this scaffolding plug-in generates CRUD forms that you often need to manage data stored for instance in databases. http://www.meta-language.net/forms-examples.html?example=test_scaffolding_input For those interested to check it out, the actual class package can be downloaded from here: http://www.phpclasses.org/formsgeneration Here you may watch an extensive tutorial video that covers practically all features: http://www.phpclasses.org/browse/video/1/package/1.html Here's what I was talking about. Assuming you simply type out your form fields like this: input type=text name=address size=30 value=123 Main St./ Now, if you do it with a class like yours: $arr = array('type' = 'text', 'name' = 'address', 'size' = 30, 'value' = '123 Main St.'); $form-AddInput($arr); (I haven't looked at your class in a while, so I may have invoked it slightly incorrectly.) If you compare the typing involved in the first case with the typing involved in the second case, you can see that it's more in the second case. That is because you are just thinking about the typing of the generated HTML. To generate and validate forms, you also have to consider the code you write to validate and process the forms because the HTML forms do not process by themselves. You need to think about the security of your application, so you also need to validate submitted values, discard invalid values, escape outputted values, and so on. All that is done with a couple of calls to the forms class. Yes, your forms generation class includes a tremendous amount of proven code, including a bunch of Javascript validation, all of which the programmer doesn't have to develop himself. The only real complaint I have about your class is that the class file itself (forms.php) is 158+ K bytes, which must be loaded every time you surf to a page for the first time. That used to be an issue in the 20th century in the PHP 3 days. Since PHP 4, the PHP code is no longer interpreted. The Zend engine compiles the PHP code in Zend op codes in the first stage. In the second stage the op codes are executed. If you use a cache extension like APC, Turck MMCache, XCache, etc.. the first step is skipped after the first execution and the size of the original code is not relevant because it is already compiled in shared memory. Anyway, the class has all that code because it is necessary to implement all it supports. -- 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
Re: [PHP] Forms validation and creation- easier solution?
On May 20, 2009, at 2:03 AM, Angelo Zanetti wrote: We have done quite a few projects and we are looking to find better ways to implementing forms. This is fairly simple to roll-your-own. I do it from metadata. I check MySQL metadata for data types, lengths, and defaults. In addition, my metadata tables contain: -- field captions -- field-use descriptions and business rules (generates CSS pop-up help) -- the type of control used -- the source of data for controls (I call system codes: like the lists of choices for comboboxes and radio buttons -- I keep almost all of these in a single table.) -- whether data in a field is required -- whether the data in a field are visible, editable, or new-record- only editable -- whether the data are encrypted (core data class handles the encryption/decryption) -- data entry order -- any non-standard user rights to the data. -- Simple business rules (like maximums, minimums and ranges of acceptable values) -- easy validation categories: birthdates, eMail formatting, USA phone numbers postal codes, US social security #'s, credit card format, and the like. The last two can generate JavaScript, too (still working on that). -- I also am working on more complex validation being automatic: across fields or tables, dependent on other variables, etc. By standardizing the format of metadata and the means of storing system code values, plus core CSS class names, you can use this across projects. Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] urgent CSS question
Benjamin Hawkes-Lewis wrote: On 22/5/09 20:31, PJ wrote: They may have different names, but does that change their functionality? Potentially, yes! A selector including #frame will no longer match if id is changed to frame1, and vice versa. They are identical except for the 1 in the title of the id. So, if I change the one id to the other in the same code, I don't understand why the formatting would change? These descriptions are still far too vague and ambiguous. Please link to two test cases: 1) Effectively showing frame1. 2) Effectively showing frame. that illustrate the problem you're talking about. Obviously, the parents and the children have not changed unless there's some weird hanky-panky going on. Without seeing test cases, nothing is obvious. Or do I have to make a new css file for every page Only if you're doing it wrong. :) And to follow the logic here, if I create a different id and in the end it turns out to be identical to the original frame except for the name, shouldn't it function the same. That depends on: 1) The contents of your CSS file, which I can't see. 2) Whether you've made any errors when modifying your HTML, which I can't see either. If you provided test cases, I could see these things and answer your questions. Trying to describe the problem rather than /showing/ the problem is very inefficient. -- Benjamin Hawkes-Lewis Ok, I'm glad the there are some people out there who want to get down to the bottom of things. I can attach or maybe put up a link on a website where you can look at the code and the css. But regardless of any test caste, nothing changes the fact that whatever the html code, whatever the php code, these are sonstant and nothing is changed. Switch between id frame and id frame1 and things change. nothnig, I meant, nothing is changed in between. The difference is in the css, and nothing else. I'll post the location later tonight or , more likely, tomorrow am. z -- Hervé Kempf: Pour sauver la planète, sortez du capitalisme. - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.chiccantine.com/andypantry.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apache user cannot execute useradd via sudo :(
Michael A. Peters wrote: vuthecuong wrote: Hi all My server is centos 5.1 with php 5.1.6. In my app I want apache to add user through sudo. My sudoers file is: %apache ALL=(ALL) NOPASSWD: ALL %tony ALL=(ALL) NOPASSWD: ALL My test.php í: ?php $username=hixhix; system(/usr/bin/sudo /usr/sbin/useradd -s /sbin/nologin -M $username,$returnvalue); echo return value: $returnvalue; However, user 'hixhix' not created by apache at all, it always returned 1. how can I make my apache tu add user using sudo? Please help me. I need your help. Thanks and regards. That's not a very secure sudoers file. But you probably don't want to use sudo to this anyway. What you probably should do is write a shell script (IE w/ perl) that is suid root and executable by apache that adds the user to your system. I don't know what your sudo error is, but have you looked at your sudo log file? Make damn sure you validate the $username variable whatever solution you end up using. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yeah I know my script don't care at all about security. I'm keeping it fot the sake of simplicity. After making it 'work', I will take a look seriously about security. So, why it not create user for me? thanks and regards -- View this message in context: http://www.nabble.com/apache-user-cannot-execute-useradd-via-sudo-%3A%28-tp23668764p23680766.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] apache user cannot execute useradd via sudo :(
vuthecuong wrote: Yeah I know my script don't care at all about security. I'm keeping it fot the sake of simplicity. After making it 'work', I will take a look seriously about security. So, why it not create user for me? thanks and regards I'm not that familiar with sudo, but I suspect it may have to do with the fact apache is a user without a shell. look in the sudo log file. If you don't see anything, look in /var/log/secure and /var/log/messages and /var/log/httpd/error_log If you don't see the problem, log into a root shell. Then run su apache to become the apache user and try the command and see what happens. Really though, this isn't a job for sudo. It's a job for a suid root shell script (I'd suggest perl or python or maybe tcl/expect). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to assign eval() to variable?
hi, I have on one website boxes with information, pulled from mysql. the content can be string, php code, url of other website or url to specific file etc. currently, I have something like this: // connect to db // mysql_query() to get box content and content_type switch($content_type) { case 'string': echo $content; break; case 'php_code': eval($content); break; case 'website': echo 'iframe'.$content.'/iframe; break; case 'file' require_once($file); echo $file_content; // etc. } but, now I have to change the code to assign content to variable and the variable will be printed later. I tried something like this: switch($content_type) { case 'string': $record = $content; break; case 'php_code': $record = eval($content); break; case 'website': $record = 'iframe'.$content.'/iframe; break; case 'file' require_once($file); $record = $file_content; // etc. } and it works - except eval() part. cant do $record = eval($content); ?!?!?!? thanks afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php