[PHP] gettext online editor?
hello, for translating our web applications, we use to create an XML file with the labels; one label for each entry; one file for each language. This let us: 1. create one file (in french) and let someone do the translations 2. provide the 'key users' (admins) of the application a php page that can be used to edit/change these translations 3. include the xml files into our cvs so that changes are managed 4. provide a new language to the application simply by adding the corresponding file if needed, we can split the file on a functional basis to reduce the amount of data to be loaded. Most of the time however, we simply have some form labels, feedback messages, menu items : less than 50 labels per page. So this works very well. Recently a collegue showed us gettext. As it seems very powerful, the main disadvantage I can see is that translations files are not directly editable. The admin users cannot edit the files and correct/change the translations. Moreover, we work mainly on windows and I'd rather minimize the number of softwares needed by the developers to do their work (php editor, oci, mysql, mssql clients, cvs, svn, firefox, moz, ie, uml editor, ... so many already!) So my question is: do you know if there is any way of editing the gettext translation files from a http page? I mean, without the need to execute a 'compile' (or whatever) action on the webserver. do you have any comment on translating the applications? of course gettext seems powerful, with caching an so on. But I really believe the new SimpleXML can load a translation file very quickly, and php offers enough functionalities to do cache of the labels in the current language... thank you Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] shell_exec, batch files, and IIS on Windows
hi, maybe you can try this: in the IIS properties, you can define the user running your IIS service. Ususally this is IUSR_xxx, but you can set a administrator user (see directory Security/ anonymous user) try to put your win login (prefixed with your domain\ and give your password. If you can execute your cmd and batch file, then you can be sure that the problem if an authorisation problem. Afterward, re-enter the IUSR_xx user as the anonymous user, because running as administrator is rather dangerous!! Also, try the 'Integrated windows Authentication', if this is checked, the anaonymous will NOY be used, but your own login will be used instead. As an example, if the Use integrated authentication is active, try a phpinfo() and you should find your own windows login as AUTH_USER (or others, don't remember). (if you have a login prompt, you can avoid it from the IE setting) Also, have a look at the event viewer and at the IIS log file. Maybe you will see the error reported by IIS... Vincent Dupont Principal Consultant OpenSource Competence Center Ausy Belgium http://www.ausy.be -Original Message- From: Frank M. Kromann [mailto:[EMAIL PROTECTED] Sent: Tue 2/27/2007 22:20 To: Shu Chow Cc: php-general@lists.php.net Subject: Re: [PHP] shell_exec, batch files, and IIS on Windows The user that runs the php script under iis (IUSER_maschine name) should have permissions to execute the cmd.exe file, the .bat file and all the commands included in the .bat file. - Frank The manual entry for shell_exec has a comment that notes to execute .bat files with shell_exec, you need to pass the command through cmd.exe with the /c argument. I was wondering if anyone could share some insight on why that is. I've pretty much verified that this is the case. I can't execute .bat files at all from a Windows 2003 server running IIS. I can locally on my development workstation (XP running Apache). I've tried passing the command through cmd.exe on the server, but some of the commands in the .bat file does not run properly when going through cmd.exe. I suspect that IIS is a key culprit, but I have nothing concrete. I'd like to take a plausible theory to the IT guys before I request that they install Apache on that box. Thanks for any insight anyone might have. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_SERVER['PHP_SELF'] in a included file
hello, try with the system constant __FILE__ print(__FILE__); inside a.php should always return a.php, even though this is included into index.php. Vincent Dupont Principal Consultant OpenSource Competence Center Ausy Belgium http://www.ausy.be -Original Message- From: clive [mailto:[EMAIL PROTECTED] Sent: Mon 2/26/2007 14:44 To: PHP General List Subject: [PHP] $_SERVER['PHP_SELF'] in a included file A project that I work on has a index.php that includes other files depending on certain requirements. so index.php includes a.php; in a.php if you echo $_SERVER['PHP_SELF'] it echos index.php and I understand why it does this. But, I want echo the file name of a.php from a.php and I dont want to add a $filename='a.php'; at the top of a.php, although I have thought of using subversion and a find and replace to insert $filename=$Id$; at the top of all the files. Does anyone know know of another way I can get a included files filename? Sorry if I have posted this question in the past, its been a while since I last thought of this problem. Regards, Clive. Real Time Travel Connections {No electrons were harmed in the creation, transmission or reading of this email. However, many were excited and some may well have enjoyed the experience.} -- 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] Re: OCI8 under WINDOWS
hello is this not a problem of user rights? With IIS under XP, the user is always something as IUSR_xxx, so , the c:\oracle folder must be granted execute grants to IUSR_xx try to figure out under what user Apache is executed (see the Taskt Manager to check the user running the Apache process) and change the windows security on the oci client directories to allow execute grants to that user on all files. Vincent Dupont Principal Consultant OpenSource Competence Center Ausy Belgium http://www.ausy.be -Original Message- From: Fahad Pervaiz [mailto:[EMAIL PROTECTED] Sent: Mon 2/26/2007 14:41 To: [EMAIL PROTECTED]; php-general@lists.php.net Subject: [PHP] Re: OCI8 under WINDOWS #ORIGINAL## Hi, I am trying to use oci8.dll under PHP 5.2 and Apache 2 under Windows XP... The system variables are all configured (TNS_ADMIN, SQLPATH, LD_LIBRARY_PATH, etc...). I use ORACLE Instant Client and sqlplus works OK ... PHP-CLI loads the extension without any problem but I cannot get it load under APACHE (with the help of phpinfo()) ... Any idea why it won't load? END ORINGINAL### Uninstall oracle instant client Restart your windows machine Download complete oracle client from oracle website http://www.oracle.com/technology/software/index.html Restart your windows machine Every oci8 should work fine now. If not you can try installing Zend Core for Oracle. -- Regards Fahad Pervaiz www.ecommerce-xperts.com (Shopping Cart Applications, Framework for Multilingual Web Sites, Web Designs) -- 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] Question regarding include() and symlinks to directories
hello, if I can still contribute to this topic, I suggest you never use simlinks. We experienced very bad maintenance problems at a customer : when copying new files through FTP, the simlinks were often erased or overwriten. And this occured on every upgrade of the scripts. This would not occur with a simple and stable include_path setting. Moreover, one can set the include_path dircetly from PHP, allowing for example 2 applications to define their own include_path. Finaly, simlinks are not available on win32 platforms. So, the include_path should be more stable (considering FTP) and more flexible than simlinks. Vincent Dupont Ausy Belgium -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Sat 1/6/2007 0:17 To: Karl Pflästerer Cc: php-general@lists.php.net Subject: Re: [PHP] Question regarding include() and symlinks to directories On Thu, January 4, 2007 2:47 pm, Karl Pflästerer wrote: In my opinion include() should respect symlinks to directories and not dereference them before finding the file to include. Or am I wrong here? The PHP version is 5.1.6 (will soon be updated). WHOOPS! My fingers slipped and I keyboarded to Send button. SORRY! ... and use full pathname when you go to read a file. Anything else is more like playing an Adventure Game than Programming. I can see arguments both ways for when to work out the symlink, so you'd have to take this up with Internals to get a change made... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- 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] FastCGI optmized Windows build of 5.2.1RC2
hello, thanks for this good news for Win poeple. Do you have any info on what version(s) of IIS/win32 this release soul be used? thank you Vincent Dupont Ausy Belgium -Original Message- From: Edin Kadribasic [mailto:[EMAIL PROTECTED] Sent: Fri 1/5/2007 14:27 To: PHP internals; php-general@lists.php.net Subject: [PHP] FastCGI optmized Windows build of 5.2.1RC2 Hello, I have made a second build of 5.2.1RC2 for Windows with no thread safety enabled. This will only work for non threaded SAPIs such as CGI/FastCGI and CLI. The reason for this is that managing per thread state takes some CPU time from the main task of running PHP scripts making non thread safe PHP significantly faster. My initial benchmarks show 20-30% performance increase. This, together with the new fastcgi implementation for IIS from Microsoft should bring PHP performance on Windows to a new level. http://downloads.php.net/edink/php-5.2.1RC2-nts-Win32.zip (76aa90a7fdb0bd2eb62c1172501d6c6e) http://downloads.php.net/edink/pecl-5.2.1RC2-nts-Win32.zip (a493bdf794a5d44d749f6dcd2a55f9da) http://downloads.php.net/edink/php-debug-pack-5.2.1RC2-nts-Win32.zip (cbfd474fcdb61522d4c750b5c02d3df9) Edin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE : [PHP] Still problem with file reading
You cite a windows path to your txt file.I warn you that you need to write c:\ as c:/, because the \ is the escapechar into a string so, to point to C:\Program Files\XAMPP\xampp\htdocs\test_folder\test1.txt from php you need: $file_path = C:\\Program Files\\XAMPP\\xampp\\htdocs\\test_folder\\test1.txt; (note I use and not ' or $file_path = C:/Program Files/XAMPP/xampp/htdocs/test_folder/test1.txt; and then you should be able to $data = file_get_contents($file_path); Vincent Dupont Ausy Belgium Message d'origine De: Richard Lynch [mailto:[EMAIL PROTECTED] Date: ven. 1/5/2007 22:43 À: Delta Storm Cc: php-general@lists.php.net Objet : Re: [PHP] Still problem with file reading On Fri, January 5, 2007 12:45 pm, Delta Storm wrote: I wrote a while back saying of my problem... I tried to read a file I tried in a couple of ways and i posted a question on this newsgroup and a couple of people helped me (btw, thank you for help) and they suggested a few other ways I tried all possible ways and i could read a file it says: Failed to open stream! No such file or directory exists while im 100% sure the file exists path of the file: C:\Program Files\XAMPP\xampp\htdocs\test_folder\test1.txt htdocs is apache's root directory I tried setting the file there C:\Program Files\XAMPP\xampp\htdocs but still the same I have tried the URL approach the above aproach the plain test1.txt aproach as to relative to the DOCUMENT_ROOT i have tried everything but still it doesn't work I tried to use echo is_readable and file_exists and it returned negative, that the file does not exists but i say again the file does exist I didn't spelled it wrong I have checked a hundred times but always the same answer! PLEASE HELP, I'm learning PHP by a book and I have a whole section about file reading,writing... And I dont want to skip any part of the book! :) If you need more info, I'll be happy to answer any question. Two suggestions: 1. Show us your exact code. Either copy/paste it into email, or provide a URL to the source code by copying (or better yet symlinking) to a .phps file (the 's' is not a typo) 2. Sometimes PHP will say the file is not there when what it REALLY means is I do not have permission to read that file or directory If PHP can't read the directory the file lives in, it can't even SEE the file to find out if it's there or not. Unfortunately, the permissions model in Windows changes with every release, so what this boils down to is poking around in endless windows in Properties on all the directories and files until you make things work. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- 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] sessions vs domain problem
Hello, As far as I know, the session will use a cookie, and the cookies are linked to one domain name. I don't know a way of using a cookie accross multiple domains, but I guess this should be possible. The question is : will PHP allow you to do that? I guess no because this could be a security issue... maybe someone in the list can help. search the web for the cookie accross multipple domain. Vincent (greetings from Belgium !!) -Original Message- From: Reinhart Viane [mailto:[EMAIL PROTECTED] Sent: Fri 22/12/2006 12:52 To: php-general@lists.php.net Subject: [PHP] sessions vs domain problem Hello, I have the folowing problem : Hosting of my site is at http://www.groep6049.ksjnet.be http://www.groep6049.ksjnet.be/ My domainname is www.ksachiropoelkapelle.be http://www.ksachiropoelkapelle.be/ I have forwarded www.ksachiropoelkapelle.be http://www.ksachiropoelkapelle.be/ towards http://www.groep6049.ksjnet.be/index.php I use cloaked forwarding (so ksachiropoelkapelle stays in the address bar) Now people can log in on that site: $sql=select * from users where user_firstname='$firstname' and user_password='$password'; $result=mysql_query($sql) or die(mysql_error()); $count=mysql_num_rows($result); if ($count0) { $row=mysql_fetch_array($result); $userid=$row[user_id]; $gebruikersnaam=$row[user_firstname]; //set the session variables $_SESSION['userid']=$userid; $_SESSION['gebruikersnaam']=$gebruikersnaam; header(Location: http://www.ksachiropoelkapelle.be/index.php;); } The problem is: When I surf directly to http://www.ksachiropoelkapelle.be http://www.ksachiropoelkapelle.be/ and try to login nothing happens. The script is executed successfully but it does not seem to recognize the $_SESSION to show that I'm logged in. When I surf to http://www.groep6049.ksjnet.be/index.php and try to login it works perfectly. Is it possible to set something extra in my php session variables to make it work when surfing directly to http://www.ksachiropoelkapelle.be http://www.ksachiropoelkapelle.be/ ? Or do I have to disable the cloaking? Thanks in advance, Reinhart Viane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Which PHP-script crashes my server?
hello, could you tell us more about our webserver? Linux or windows? vincent -Original Message- From: Philipp Schwarz [mailto:[EMAIL PROTECTED] Sent: Tue 19/12/2006 14:05 To: php-general@lists.php.net Subject: [PHP] Which PHP-script crashes my server? Hi guys, I have a problem with my webserver. It is a server for me and some web projekts of my friends. And there is one PHP script which kills the whole server, but I do not know which one it is. When the server is going down one apache process uses 99% CPU and memory. In this case I can only reboot the server. I would look up the file in the apache logs, but the script is started some minutes before the server goes down and there are some hundred requests per minute. Can anyone help me? Thank you! -- 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] Active Directory password change utility in PHP
Hello I use php_ldap (see the php.net/ldap) to authenticate users against a AD server. However, this is the LDAP interface and I don't know if poeple will be allowed to change their password that way... vincent -Original Message- From: Saqib Ali [mailto:[EMAIL PROTECTED] Sent: Thu 7/12/2006 18:45 To: php-general@lists.php.net Subject: [PHP] Active Directory password change utility in PHP Hello All, Last year I wrote a small ASP utility which allowed domain users to change their Active Directory password using a web site. The utility used ADSI (Active Directory Service Interfaces) so it was quite easy to implement. However now we would like to integrated this into our LAMP based stack, so I am planning to re-write the application in PHP. Would it be possible to write such a application in PHP? If so, can you please give me some pointers. My other PHP apps talk to AD using LDAP libraries, but I haven't tried password change for a directory that spans multiple domains. Any suggestions would be greatly appreciate. saqib http://www.full-disk-encryption.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP / MVC layout question
Hello, the Zend Framework, as others, offers a MVC implementation for PHP. I guess my understanding of this is right, but I still have a question. Maybe you can help. Depending on the request, a controller is called. This can do various stuff w/o model(s), and then a view is displayed. That is, only one vue is displayed at a time. We use this happily into applications where input or list forms are displayed one at a time. The top banner template is included into every application view so that is will always be displayed. But I do not like the idea to embed (include) the top banner template into every view. The problem is even more obvious when we want to create a 'portal' layout, displaying many information panels, which should be splitted into many models/views. For example, a portal homepage may display a login form, a news feed, a banner, a footer, a poll, etc. When the user enters a bad username into the login form, we should re-display the portal page and provide the error message near the login form. So, the request to the login controller should be able to re-display the complete layout. How do you handle this? frames? iframes? ajax? other? thanks for your interest. Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP analytics
You could look for Apache logs analysers, too vincent -Original Message- From: Rick. [mailto:[EMAIL PROTECTED] Sent: Wed 6/12/2006 12:48 To: php-general@lists.php.net Subject: [PHP] PHP analytics Hello I am new to php and I would like some guidance from those who have a bit more expereince with PHP I will be attempting to do a bit of tracking and web analytics. Basically, the user will login and from there everything that he clicked will be recorded in a database and analyzed i.e user behaviour, patterns with different user groups. Is this possible with php and it is a major undertaking ? just trying not to get ahead of myself here.. are there any tutorials or scripts or books that you know of ? Thanks Regards Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] turning use session cookies off still uses cookies?
look at this inside the PHP.INI ; trans sid support is disabled by default. ; Use of trans sid may risk your users security. ; Use this option with caution. ; - User may send URL contains active session ID ; to other person via. email/irc/etc. ; - URL that contains active session ID may be stored ; in publically accessible computer. ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. session.use_trans_sid = 0 vincent -Original Message- From: blackwater dev [mailto:[EMAIL PROTECTED] Sent: Thu 30/11/2006 14:42 To: php-general@lists.php.net Subject: [PHP] turning use session cookies off still uses cookies? I asked a similar question the other day but I have been having an issue lately with my sessions and certain browsers. I then tried to set my session.use_cookies var in php.ini to 0 yet if I log in and don't have cookies turned on, the sessions still don't seem to work. Can I really use sessions without using cookies? Below is my code and sessions settings. If I can use sessions without cookies, seems like that would solve the issue of people having cookies turned on. Thanks, //this is from the login routine if ($this-db-getField('user_id')){ session_start(); $_SESSION['user']['user_id']=$this-db-getField('user_id'); $_SESSION['user']['email']=$this-db-getField('email'); return true; } ? //only show if they are logged in if (isset($_SESSION['user']['user_id']) !$_REQUEST['mlsid']){ //show something } ? Session Support enabled Registered save handlers files user Registered serializer handlers php php_binary wddx DirectiveLocal ValueMaster Value session.auto_startOffOff session.bug_compat_42OffOff session.bug_compat_warnOnOn session.cache_expire 180180 session.cache_limiternocachenocache session.cookie_domain*no value**no value* session.cookie_lifetime00 session.cookie_path// session.cookie_secure OffOff session.entropy_file*no value**no value* session.entropy_length00 session.gc_divisor10001000 session.gc_maxlifetime14401440 session.gc_probability11 session.hash_bits_per_character55 session.hash_function00 session.namePHPSESSIDPHPSESSID session.referer_check *no value**no value* session.save_handlerfilesfiles session.save_path /var/lib/php/session/var/lib/php/session session.serialize_handlerphpphp session.use_cookiesOffOff session.use_only_cookiesOffOff session.use_trans_sid00 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] turning use session cookies off still uses cookies?
hello, you can use sessions without cookies by asking PHP to ad the sessionid into every link on your website. I don't remember how to do this, but there should be a php_ini directive, and more info on the php.net/manual website. vincent -Original Message- From: blackwater dev [mailto:[EMAIL PROTECTED] Sent: Thu 30/11/2006 14:42 To: php-general@lists.php.net Subject: [PHP] turning use session cookies off still uses cookies? I asked a similar question the other day but I have been having an issue lately with my sessions and certain browsers. I then tried to set my session.use_cookies var in php.ini to 0 yet if I log in and don't have cookies turned on, the sessions still don't seem to work. Can I really use sessions without using cookies? Below is my code and sessions settings. If I can use sessions without cookies, seems like that would solve the issue of people having cookies turned on. Thanks, //this is from the login routine if ($this-db-getField('user_id')){ session_start(); $_SESSION['user']['user_id']=$this-db-getField('user_id'); $_SESSION['user']['email']=$this-db-getField('email'); return true; } ? //only show if they are logged in if (isset($_SESSION['user']['user_id']) !$_REQUEST['mlsid']){ //show something } ? Session Support enabled Registered save handlers files user Registered serializer handlers php php_binary wddx DirectiveLocal ValueMaster Value session.auto_startOffOff session.bug_compat_42OffOff session.bug_compat_warnOnOn session.cache_expire 180180 session.cache_limiternocachenocache session.cookie_domain*no value**no value* session.cookie_lifetime00 session.cookie_path// session.cookie_secure OffOff session.entropy_file*no value**no value* session.entropy_length00 session.gc_divisor10001000 session.gc_maxlifetime14401440 session.gc_probability11 session.hash_bits_per_character55 session.hash_function00 session.namePHPSESSIDPHPSESSID session.referer_check *no value**no value* session.save_handlerfilesfiles session.save_path /var/lib/php/session/var/lib/php/session session.serialize_handlerphpphp session.use_cookiesOffOff session.use_only_cookiesOffOff session.use_trans_sid00 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] func_get_args as a hash? (faster constructors)
Well, I would reply that this is probably as easy to read ... You should think about poeple having digg into your code, or about you in a few month... Moreover, having much parameters (more than 4) is not a good idea (for the same reading and understanding reasons). Functions having more than 4 params should probably be refactored... Especially inside the constructor ! this is my own thinking, of course Vincent -Original Message- From: Kelly Jones [mailto:[EMAIL PROTECTED] Sent: Tue 28/11/2006 2:57 To: php-general@lists.php.net Subject: [PHP] func_get_args as a hash? (faster constructors) If I define a function like this: function foo ($x, $y, $z) {} and then call: foo(1,2,bar); is there a function I can call inside foo() that yields this hash: {x = 1, y = 2, z = bar} In other words, gives me the values *and names* of the arguments to foo? func_get_args just yields the values. Having this function would make writing constuctors easier. The normal way: fuction ClassName ($x, $y, $z) { $this-x = $x; $this-y = $y; $this-z = $z; } could be replaced with: function ClassName ($x, $y, $z) { foreach (magic_function_i_want() as $key=$val) { $this-$key =$val; } } Obviously, it's more of a savings when you have a large number of parameters. -- We're just a Bunch Of Regular Guys, a collective group that's trying to understand and assimilate technology. We feel that resistance to new ideas and technology is unwise and ultimately futile. -- 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] Readdir
If you are working in pure PHP5 OOP, you could like to try the new SPL iterators. see http://www.phpro.org/tutorials/Introduction-to-SPL.html#12 vincent -Original Message- From: Tom Chubb [mailto:[EMAIL PROTECTED] Sent: Tue 28/11/2006 9:55 To: [php] PHP General List Subject: [PHP] Readdir What would be the best way to retrieve a list of files from an upload folder that are called id where the extension could be .doc .txt or .pdf For example, I have a folder where people can upload a document and the document is renamed as their user id. They can upload a PDF, DOC or TXT file. They may wish to upload one of each. I am using file_exists for each case, but is there an easier/tidier way of doing it? Thanks in advance, Tom -- 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] Readdir
yes, glob works well. here is an example to get pictures inside a folder ($path) foreach(glob($path./*/{*.gif,*.jpg,*.JPG,*.jpeg,*.JPEG,*.png}, GLOB_BRACE) as $filename){ $pics[]=$filename; } vincent -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Tue 28/11/2006 10:59 To: Tom Chubb Cc: [php] PHP General List Subject: Re: [PHP] Readdir Tom Chubb wrote: What would be the best way to retrieve a list of files from an upload folder that are called id where the extension could be .doc .txt or .pdf For example, I have a folder where people can upload a document and the document is renamed as their user id. They can upload a PDF, DOC or TXT file. They may wish to upload one of each. I am using file_exists for each case, but is there an easier/tidier way of doing it? Thanks in advance, Tom try the glob() function, something like: $id = getUserId(); foreach (glob(/path/to/user/files/$id.*) as $file) { echo $file,br /; } -- 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] session issues on ie
Hi, do you have any access to the client computers (is it an intranet)? If so, check yourself the existence of the cookie and check JS and cookie settings on their browser.From my own experience, you should never truct the user's comments about their config or actions... Otherwise, you could make a simple session_test.php pages that will test the session_id() values. simply put session_start(); then print the session_id(); If the session is ok, then the users should see the same session id on every successive refresh (F5). If they don't see the same ID, then, they have a problem. If they have a problem for Ie only, I only see the cookie reason. good luck vincent -Original Message- From: blackwater dev [mailto:[EMAIL PROTECTED] Sent: Tue 28/11/2006 22:47 To: php-general@lists.php.net Subject: [PHP] session issues on ie I have code which logs someone in and then allows them to see certain info if they are logged in. I have users who claim it works fin in some of their browsers, firefox, safari, etc and some versions of IE but not all and I'm stumped. Here's the code: //this is from the login routine if ($this-db-getField('user_id')){ session_start(); $_SESSION['user']['user_id']=$this-db-getField('user_id'); $_SESSION['user']['email']=$this-db-getField('email'); return true; } ? //only show if they are logged in if (isset($_SESSION['user']['user_id']) !$_REQUEST['mlsid']){ //show something } ? People are claiming it tells them they are logged in yet they don't see what is displayed under the code which checks their session. For some reason, sessions don't seem to be there on all browsers yet they claim that cookies and all are on. Any ideas? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Storing objects in sessions recursively
Hi, are you sure you did not forget a include of the Article source code ? You need all sources codes aiavlable (included) when getting the object back from the session. vincent -Original Message- From: Dave M G [mailto:[EMAIL PROTECTED] Sent: Fri 24/11/2006 11:22 To: php-general@lists.php.net Subject: [PHP] Storing objects in sessions recursively PHP List, I have a class called Session, which creates an object stored in the $_SESSION variable. That object in turn holds on to a User object which keeps track of the activity of the individual user who has logged in and is using the web site. Then the $user object in turn holds on to an Article object, which keeps information about web content that the user is editing, previewing, and viewing. The problem is that the article object keeps getting lost as the user clicks from page to page. I'm hoping someone can explain to me why this might be happening. As far as I can understand it, an object is basically just an array, and an object that owns an object as a member variable is just like storing an array in an array. I can't see any reason why there would be any limit to how many levels one could go down. So I'm assuming there's no restriction on how many levels of objects owning objects there can be. As for the code itself, I hope I don't strip out any key details, as it's all spread out across many classes. But here's what the basics of it look like: In the User class, I have this method: public function setCurrentArticle($currentArticle) { $this-currentArticle = $currentArticle; } In the Article class I have this line: Session::getSession()-getUser()-setCurrentArticle($this); In the Session class I have: private static $session; private $user; public function __construct() { $this-user = new User(); } public function getUser() { return $this-user; } public static function getSession() { if (!isset($_SESSION['session'])) { $_SESSION['session'] = new Session(); } return $_SESSION['session']; } I may have missed a detail in trying to keep this brief and readable. If so, please let me know and I will try to provide it. Thank you for any advice. ?-- Dave M G Ubuntu 6.06 LTS Kernel 2.6.17.7 Pentium D Dual Core Processor PHP 5, MySQL 5, Apache 2 -- 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] PHP and XML
Hi, what do you plan to do with XML? Store your adresses, etc? Then you can create an XML object with simpleXML (see http://be2.php.net/simplexml/) This will help you in adding nodes and attributes. Afterward, you can generate a output with $xml-asXML() and store this into a file with file_put_content($xml-asXML()); If you edit a xml file in a text editor, you will see it is rather simple study the simpleXML methods and you are ready ! best whishes ! vincent -Original Message- From: onewaylife [mailto:[EMAIL PROTECTED] Sent: Thu 23/11/2006 13:57 To: php-general@lists.php.net Subject: [PHP] PHP and XML Dear All I am novice in PHP XML, while trying I am creating a small application i.e. Address Book. In this I am using Apache2, PHP5 and XML no database is used. I have FC5 machines. but I am unable to store the files in XML. If any one share their experience in this by providing Examples or tutorials etc... So far I have found tutorial related to porting the information of data from MySQL to XML and then php with help of DOM. Thanks onewaylife -- View this message in context: http://www.nabble.com/PHP-and-XML-tf2692397.html#a7507917 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Programmatic POST
in PHP5, you could have a look at objects HTTPRequest and HTTPResponse. I never used them yet, though... vincent -Original Message- From: Brad Fuller [mailto:[EMAIL PROTECTED] Sent: Wed 22/11/2006 21:25 To: php-general@lists.php.net Subject: RE: [PHP] Programmatic POST -Original Message- From: Gabe [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 22, 2006 3:08 PM To: php-general@lists.php.net Subject: [PHP] Programmatic POST I'm looking to write a function that will receive the contents of a web form, do some data manipulation, then pass on the manipulated data to another URL via POST. Is there a built-in function in PHP that I can use to send the data to another URL via POST without a user having to click submit on a form? Yep. There are several. I prefer to use cURL. http://www.php.net/curl -B -- 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] PHP + MSSQL win32 / SOLVED
Hello, I found the problem about my last message (see below). This relates to a bug in 4.3.10 release with MSSQL extension Bug #31372 I downgraded to PHP 4.3.8 and the problem was solved. Thank you for your attention and replies Vincent -Original Message- From: Vincent DUPONT Sent: mercredi 12 janvier 2005 21:54 To: php-general@lists.php.net Subject: [PHP] PHP + MSSQL win32 Hi I try to use PHP with MSSQL on a WINXP station. Usually, on win32 systems this works very well, but today I can't understand the problem. I can connect and execute SELECT statements When I try to INSERT , DELETE or UPDATE a record, I have a PHP ERROR, and a MSSQL error code 15457 in the mssql logs The insert executes, but I would like not to have the php error... This seem to be a problem with grants or permissions, but I can't find where. Even if I log with the 'sa' account I have the error. I use PHP 4.3.10 and MSSQL2000 on winXP pro Any tip would be nice. Moreover, I have found a ini file parameter that is not documented : mssql.datetimeconvert=Off Do you know what does this mean?? Thank you Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + MSSQL win32
Hi I try to use PHP with MSSQL on a WINXP station. Usually, on win32 systems this works very well, but today I can't understand the problem. I can connect and execute SELECT statements When I try to INSERT , DELETE or UPDATE a record, I have a PHP ERROR, and a MSSQL error code 15457 in the mssql logs The insert executes, but I would like not to have the php error... This seem to be a problem with grants or permissions, but I can't find where. Even if I log with the 'sa' account I have the error. I use PHP 4.3.10 and MSSQL2000 on winXP pro Any tip would be nice. Moreover, I have found a ini file parameter that is not documented : mssql.datetimeconvert=Off Do you know what does this mean?? Thank you Vincent
RE: [PHP] Links displaying in Table cells
you should add a iframe into your table cell and load the target page (link) into that iframe. maybe some javacsript could create the iframe for you and set its width and height. I Never did this, so this is purely a suggestion Vincent -Original Message- From: Tomar Rajeev (ext) [mailto:[EMAIL PROTECTED] Sent: mardi 7 décembre 2004 11:17 To: '[EMAIL PROTECTED]' Subject: [PHP] Links displaying in Table cells Dear All, After clicking on a link of a menu in a PHP page, I want to display that link in cell of a table. Please let me know how to open this link in a table cell. Thanking in anticipation. Thanks and Regards, Rajeev Tomar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP LDAP search parent group
Hi, I need to get the LDAP groups a user is member of (memberof). The problem is that there are multiple levels of groups, and I need to get all levels. example userA is member of group A B and C group A is member of (included in) group D If I make a simple query on the LDAP server to fetch the memberof of userA, it returns A, B and C. I need to get also D because group A is in group D In PHP I use the statement : $list = ldap_search($conn, $userdn,$basedn, samaccountname=$name, array('memberof')); //samaccountname is the Windows login name I make a ldap_search() but I also tried with ldap_list() and ldap_read() without change I used the options ldap_set_option($conn, LDAP_OPT_REFERRALS, 0); ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3); //active Directory on 2003 server Is there a parameter I could add to PHP so as to get the parent groups? What is the LDAP_OPT_REFERRALS option ??? Thank you, Vincent
[PHP] Tab panels
Hi, does anyone knowns of a good PEAR of other free TabPanels container? I would like to be able to constumize the tabs and insert as many panels as needed. PHP and/or Javascript is ok Thank you, Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is PEAR worth the effort?
it does REALLY worth it! Install is easy, download only thoses packages you need, extendable, stable... The doc is sometimes a bit poor, but the basic are always easy Vincent -Original Message- From: Will Merrell [mailto:[EMAIL PROTECTED] Sent: mercredi 30 juin 2004 21:22 To: [EMAIL PROTECTED] Subject: [PHP] Is PEAR worth the effort? I don't mean to start a flame war here, but I have been working in PHP for a while now and am about to start a more extensive aplication. Some of the PEAR modules look good and I just wanted to hear what the collected wisdom out here thinks about it. When I try to read the installation instructions my eyes glaze over and roll up into my head. Before I fight my way through this learning curve I want to know if its worth it? Is this the wave of the future or just a flash in the pan? Thanks, Will Merrell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with embeded objects and reference
Hi, could anyone help on this 'by reference' problem. I have 2 classes. The main class as a child class. The child class has properties (array) I would like to be able to manipulate the child's properties even after the child has been inserted into the main class. Does this make sense? I can do it with by getting a reference of the child class, then setting the property,like : $tmp = $main-getChild(); //get a reference to the child object $tmp-setProperty(forth);//ok OR $main-setChildProperty(third); //ok but Whyt can't I do it directly by calling a reference to the child, like in : $child1-setproperty(second); //The property is not set or not displayed I know I need a reference to the child class that is within the maoin class, but HOW?? Here is a complete example ?php class class1{ var $child; //array function class1(){ $this-properties = array(); } //set the child object (class2) function setChild($child){ $this-child=$child; } //get the child object (class2), and call its setProperty method function setChildProperty($prop){ $theChild = $this-child; $theChild-setProperty($prop); } //return a reference to the child object function getChild(){ return $this-child; } //print the child object properties function display(){ $this-child-toString(); } } class class2{ var $properties; //array function class2(){ $this-properties = array(); } function setProperty($new_property){ $this-properties[] = $new_property; } function getProperty($index){ return $this-properties[$index]; } function toString(){ print_r($this-properties); } } $main = new class1(); $child1 = new class2(); $child1-setproperty(first);//displayed $main-setChild($child1); $child1-setproperty(second); //NOT DISPLAYED $main-setChildProperty(third); //displayed $tmp = $main-getChild(); //get a reference to the child object $tmp-setProperty(forth);//displayed $main-display(); //output : Array ( [0] = first [1] = third [2] = forth ) ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ISAPI vs CGI
Hi, I have a script that need to run on ISAPI module on one server and on CGI on anther server. I would like my code to be able to react differently depending on the CGI/ISAPI mode. How can I detect the running mode of PHP?? is there a $_SERVER variable or anything?? vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] multiple php.ini
Hi, We need to install one windows 203 server with various versions of the same application. The versions will be held in disticnt web sites on this server. In order to point to the different application versions, I need to point the include_path to the right php scripts (in distinct folder by version) I believed it was possible to set up one php.ini file for every web site, even on the same machine. However, I can't find any informlation about this. PHP runs the default web site with php.ini in c:\windows The version1 website also runs the php.ini included in c:\windows I added a php.ini with a new include_path in the document root of version1 site, but this had no effect : the include_path remains the same... We run PHP as a ISAPI module. If you know one solution, please answer. thank you Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] text search in database
Hi, I need to do a text search on some fileds in a database. I would like the users to be able to use some syntax like 'AND' 'OR' 'NOT' parentheses () and quotes to make their search queries more powefull. I face 2 problems : 1. parse the query 2. execute the search (create the appropriate SQL query) Do you known of any existing package that could parse such a syntax and /or generate some kind of sql query? tank you, vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sessions handling
Hi, I beleive that if both servers run the same hostname (www.foo.com) (cookie domain) and both session files are stored in the same place (/tmp), then the session is unique for 80 and 443 ports. you could simply test this be adding a $_SESSION['foo']='port80'; on the HTTP server instance and trying to print($_SESSION['foo'] when the user enters the HTTPS (443) pages However, i believe this could be a security issue if both secure and non secure sites use the same cookie. keep us informed. Vincent -Original Message- From: Dmitry Ruban [mailto:[EMAIL PROTECTED] Sent: mercredi 2 juin 2004 15:02 To: [EMAIL PROTECTED] Subject: [PHP] sessions handling Hi folks, We have two instances of apache/mod_php running on 80 and 443 ports accordingly. For both mod_php we have the same dir (/tmp) to store session information. Is it possible to mix sessions data up if user switches between 80 and 443 ports? I mean what if when user surfs over 80 port and has already sessionID in this mod_php context(PHPSESSID stores in cookie), then he jumps to 443 instance, would that mod_php correctly find proper session file? Is it possible that PHPSESSID in 443 context hasn't been initialized and mod_php won't get proper file? Regards, Dima Ruban -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] extracting quoted text in string
Hi, I would like to extract the quoted text from a string for example : the translation for beautiful is beau and wonderful is formidable I need to get 'beau' and 'formidable' strings into an array. Any idea?? I can go with strpos and substrings, but maybe there is something more convenient? Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: readdir and opendir
Thank you greg. Do you know if they support remote drive from Windows, like \\servername\dir\. I'm having huge problems to list files and dirs on the remote server ( with opendir, readdir) while i can easily read or write a file on the same server using fread, fopen. From the bugs reports that I have seen so far, it seems to be a known problem (see http://forums.devshed.com/showthread.php?p=624872) I wonder how I could re write the opendir and readdir functions so as to implement the fopen wrappers. Any idea? vincent -Original Message- From: greg [mailto:[EMAIL PROTECTED] Sent: lundi 10 mai 2004 15:21 To: [EMAIL PROTECTED] Subject: [PHP] Re: readdir and opendir Vincent Dupont wrote: Simple question : do readdir and opendir support opening HTTP urls ?? RTFM ! No it doesn't. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] open remote file: password problem under SMB
Hi, I need to open files on a remote computer (from windows to windows) The path is like \\servername\share\file.txt The SMB protocol is supported in PHP and ususally works very well on simple LAN networks (see http://be2.php.net/manual/en/wrappers.php) The default user is the user running the web server (IIS or Apache) However, I need to use a specified user and password. I have searched the php docs and the web about inserting user and password info into the URL, but found no help. I know SMB allows to define a user and a password,such as most protocols (ftp://usrer:[EMAIL PROTECTED]/share, etc.). But what the hell should I do to use a user and password in the PHP implemetation of SMB?? Under windows, we use 'net use * \\smbserver\share password /user:username', so the user and password are not part of the URL of the file. Could someone help me? thank you vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] readdir and opendir
Simple question : do readdir and opendir support opening HTTP urls ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form validation wih html input FILE
Hi, I'd like your opinion on the best way to do a form validation when the form contains a file upload object (input type=file) When the form does not validate, I try to re-show all values entered by the user. But, as far as I know, browsers do not allow to set the default value (local file path) of a FILE component I can get and display the default value in a label or text input, but how could I upload that file then? Will I be limited to display a warning message indicating that the user will have to select his/her file again?? thank you vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] textarea and quotes
Hi, I can't remember the name of the function to remove the escaping of quotes when submitting a textarea example : tr class=content_title becomes : tr class=\content_title\ stripslashes and stripcslashes seem not to work... vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Require_once return value on error?
Hello, I need to load various php files programatically and I use require_once($file_path) for this purpose. My question is : is there a way to know if the file was found or not? if the file generated an error or not? thank you vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session not working while accessing through IE on Windows 2000
Hi, I use win2k and IE 6 every day with PHP, and it works fine. I guess your problem comes from the Internet Options of IE (tools/Internet Options). As Miguel Jiménez suggested, check the cookie setting in the Internet Options. Vincent -Original Message- From: Sheni R. Meledath [mailto:[EMAIL PROTECTED] Sent: jeudi 22 avril 2004 8:27 To: PHP Masters Subject: [PHP] Session not working while accessing through IE on Windows 2000 Hello: We have set up a login page using sessions in PHP. Its working fine. The server is a FreeBSD/Apache/PHP 4. While accessing this page from IE 6 on Windows 2000, the sessions are not working and they are getting the login page again again. Are there any known issues of PHP using sessions with Windows 2000? Could you please provide me the details? Sheni R Meledath [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] install IIS ISAPI
Hi, I use to install PHP under IIS as a ISAPI module. So I add a ISAPI filter and define a new App mapping in 'configure' When looking at the documentation (see http://be.php.net/manual/en/install.iis.php, Windows NT/2000/XP and IIS 4 or newer) I can read : If you don't want to perform HTTP Authentication using PHP, you can (and should) skip this step. Under ISAPI Filters, add a new ISAPI filter. Use PHP as the filter name, and supply a path to the php4isapi.dll. If I understand well, we should skip this step whe possible. I don't use HTTP authentcation, but I always add a ISAPI filter to my IIS config. Why should we avoid this?? I tried to remove the ISAPI filter and restart IIS. Everything seems Ok Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] session variables
I would do script 1 : $_SESSION['test'] = hello world; and in script2 : print($_SESSION['test']); vincent -Original Message- From: Charles Collins [mailto:[EMAIL PROTECTED] Sent: mardi 20 avril 2004 17:44 To: [EMAIL PROTECTED] Subject: [PHP] session variables I have two test files running on a server, which is giving me a headache, due to the fact the session variables are not been maintained across the two pages. The server is running ... PHP Version = 4.0.5 register_globals = ON Session Support = Enabled session.auto_start = Off session.cache_expire = 180 session.cache_limiter = nocache session.cookie_domain = inweb.net.uk session.cookie_lifetime = 600 session.cookie_path = / session.cookie_secure = Off session.entropy_file = no value session.entropy_length = 0 session.gc_maxlifetime = 1440 session.gc_probability = 1 session.name = PHPSESSID session.referer_check = no value session.save_handler = files session.save_path = /tmp session.serialize_handler php session.use_cookies = On The two script files are as follows: - Page #1: ? session_start(); session_register(test); $test = Hullo World; print $test; // prints test ? Page # 2 ? session_start(); print $test;// prints nothing, zip! ? Can anyone tell me where I'm going wrong, works fine of test servers, etc., only screwed up when site was lauched. Thanks in advance ... Regards Charlie. -- 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] smarty
Does anyone have a 'good' tutorial about Smarty. The one available on smarty.php.net is really basic... Vincent -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: jeudi 8 avril 2004 4:02 To: Kelly Hallman Cc: PHP-General Subject: Re: [PHP] smarty On Wed, 2004-04-07 at 21:35, Kelly Hallman wrote: Apr 8 at 10:26am, Justin French wrote: PHP itself is a great templating language :) h1?=$title?/h1 table ? foreach($staff as $person): ?tr td?=$person['firstname']? ?=$person['surname']?/td td?=$person['role']?/td td?=$person['phone']?/td tda href='mailto:?=$person['email']?'?=$person['email']?/td /tr? endforeach; ?/table Uhhh, yeah--that's not a templating, that's called spaghetti code :) You get the concept. Smarty, as you know, basically takes a Smarty template and writes PHP code similar to what you've done above, then writes out the .php file, and includes it when you render your template. So you'd get nearly the same effect by writing the PHP as a separate file and including it as your last step, and it acts as your display logic. That may be acceptable to you, as a PHP programmer. If you're the only one who ever needs to modify your templates then that's great, more power to you. I'm sure that you would have no problem having many levels of nesting all over the place and not screwing anything up. So be it. But that's you. I guarantee another person not as adept at PHP will screw that code up, and there is less potential for that with a Smarty template. If you know PHP as well as yourself, it should be plain to see how Smarty is just a wrapper over PHP that makes templates easier to build and maintain. For a designer or non-coder, Smarty will be easier to learn than PHP. Unless your needs never exceed the very basics like you have demonstrated above, you'll be hosed when another person needs to modify your template. Which goes back to a templating truism never in dispute: if this is all you want templating for, it's six of one, half a dozen of the other. However, there are practical limitations on what you can easily accomplish with this approach, and Smarty addresses those issues. And you're worse off if you invest a lot into building your sites this way, and then realize you need some better templating strategies later. You can still separate your logic from your presentation, template designers can still use quick, simple tags to include code, and the upside is that people familiar with PHP don't need to learn ANOTHER language (that's what Smarty is) -- they can dive straight in. You can consider it it's own language, but really it's more like PHP with different formatting. Which is why it's different than what you're doing above--it's designed to facilitate templating. Your method is just poking in variables and PHP into inline'd HTML. It works, but you're missing some of the power of Smarty if you think that's all it's good for. The question is, do you want to give your templater designers full access to the power of PHP, or not. In other words: are your template designers already good PHP programmers? It's not just hype, it solves real problems, even if you don't have them. Smarty is a bit of a hack too... why do I need to declare my templates within the PHP code? If I'm an HTML designer I'd like to create a new page, include templates, use some data that's been made available and have it all in the template. I sure as heck wouldn't want to have joe programmer edit the main page, add support for importing my template. This is the thing that bugs me about Smarty, its still got that hanging dependency. And it's still got to include all those templates within the source code. InterJinn is superior in this respect. You use XML tags to import other templates, you use XML tags to load modules and components, and you use XML tags to do almost any kind of expansion you want. Of course, you can go ahead and use something else, InterJinn provides the ability to plug in custom compilers. InterJinn compiles to PHP code, includes are INCLUDED at compile time not at run time. So given this scheme anyone working on the HTML is already familiar with the syntax... hard to go wrong with: jinn:template path=topnav.template/ Hell you can even overload HTML tags. Not only that but Interjinn allows recursive includes of templates and source files, and these includes can be relative to the outer nested template or source file. Furthermore, there's nothing forcing the use of the InterJinn application layer so InterJinn can be used entirely for it's templating features, in which case it provides a faster resulting PHP page than using PHP include(). Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework
RE: [PHP] Problem uploading large files via PHP (20+ MB)
DNS error seems to indicate that you have a connection problem, not a storage or file size restriction problem. Maybe the IP connection is interrupted. .. Do you have the same problem when running on Localhost? Vincent -Original Message- From: Schonrock III, Keith H [mailto:[EMAIL PROTECTED] Sent: vendredi 19 mars 2004 15:48 To: [EMAIL PROTECTED] Subject: [PHP] Problem uploading large files via PHP (20+ MB) All, I am attempting to upload a large file via PHP to a web server running Windows XP Pro IIS 5.1 and I am having some problems. I have been trying to find the right combination of settings in the php.ini file and elsewhere to get large files to upload properly, but I keep getting a DNS error in Internet Explorer 6 that shows up after about 12MB or 12.5MB of a 21.7MB file has been transferred. When I looked at the IIS website connection timeout it was set at 900 seconds. I have tried many different variations in the php.ini settings file with little success. I have tried using the 8M format and also the full out Byte count for size fields in the php.ini file. I can upload files that are smaller that 10 MB (I tested with one that was 9MB earlier) with no problem. Here are my most recent relevant settings in my php.ini file (that I know of): max_execution_time = 3600 max_input_time = 3600 memory_limit = 104857600 post_max_size = 104857600 upload_max_filesize = 104857600 Does anyone have any ideas? Am I missing something else? If you need any more information that I left out please let me know. My code for the php files is located below this message. Any help is greatly appreciated! Thanks, Keith -Sending php file: html body center bThis is a test document/b p form enctype=multipart/form-data action=upload2.php method=post Send this file: input name=userfile type=file / input type=submit value=Send File / /form /body /html -Receiving php file: html body ?php $uploaddir = 'c:\\new\\out\\'; $uploadfile = $uploaddir . $_FILES['userfile']['name']; print pre; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { print File is valid, and was successfully uploaded. ; print Here's some more debugging info:\n; print_r($_FILES); } else { print Possible file upload attack! Here's some debugging info:\n; print_r($_FILES); } print /pre; ? /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IIS error message (ISAPI)
Hi, I have this message in the IIS log file : Out-of-process+ISAPI+extension+request+failed. This appeared when I passed my web applicaion from Mysql to Oracle batabase. I guess this is related to ISAPI module that cannot handle the load or processes needed by Oracle. PLease help. Vincent
RE: [PHP] Information about security
Have a look at PEAR::Auth on http://pear.php.net Vincent -Original Message- From: Andre [mailto:[EMAIL PROTECTED] Sent: mercredi 10 mars 2004 11:35 To: [EMAIL PROTECTED] Subject: [PHP] Information about security Hello I need some information about security in php. I want to create a backoffice extremely safe for user authentication? What you think about using .htaccess for authentication, and if it is possible to authenticate a user and then logout. And I would also like to know if you have other ways to do so in a high level of security. Obrigado. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: php/mssql character limit?
are you using a 'Text' or a 'varchar' column type? I guess the max size for varchars is 4000; text should be larger vincent -Original Message- From: Ben Ramsey [mailto:[EMAIL PROTECTED] Sent: lundi 8 mars 2004 17:30 To: [EMAIL PROTECTED] Subject: [PHP] Re: php/mssql character limit? I posted this message the other day, and no one has responded. I'm replying to it to refresh it in the list. I guess if no one responds or helps me out this time, then I'll just forget about it and let my client go unhappy. ;-) Seriously, if anyone can help me out, I would be much appreciative. Ben Ramsey wrote: Anyone know of any kind of character limit in php or mssql (yes, Microsoft SQL Server) for entering long text into a text column (of around 4,055 characters in length--that's where it's cutting off)? -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- 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] Re: php/mssql character limit?
Is it mY SQL or MS SQL we are talking about? -Original Message- From: Jason Davidson [mailto:[EMAIL PROTECTED] Sent: lundi 8 mars 2004 17:42 To: [EMAIL PROTECTED] Subject: RE: [PHP] Re: php/mssql character limit? VARCHAR limit is 255 :) mysql.com has great documentation. Jason Vincent DUPONT [EMAIL PROTECTED] wrote: are you using a 'Text' or a 'varchar' column type? I guess the max size for varchars is 4000; text should be larger vincent -Original Message- From: Ben Ramsey [mailto:[EMAIL PROTECTED] Sent: lundi 8 mars 2004 17:30 To: [EMAIL PROTECTED] Subject: [PHP] Re: php/mssql character limit? I posted this message the other day, and no one has responded. I'm replying to it to refresh it in the list. I guess if no one responds or helps me out this time, then I'll just forget about it and let my client go unhappy. ;-) Seriously, if anyone can help me out, I would be much appreciative. Ben Ramsey wrote: Anyone know of any kind of character limit in php or mssql (yes, Microsoft SQL Server) for entering long text into a text column (of around 4,055 characters in length--that's where it's cutting off)? -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SESSION vs ENV variables?
Hi, My script needs to load a config file with DB connection properties, etc. At the beginning of the session, the ini file is loaded and all values are stored in $_SESSION After the loading, a flag is also set in $_SESSION so that the ini loading is no more executed. However, all ini properties are the same for all users, so I wonder if I could put them in a cross-session variable. I guess $_ENV or $_SERVER should be good. So, the question could be : If I put something in $_SERVER, will these values be available for ALL users? Any idea? I have to keep the ini file, and could not hard code those properties. Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP support for Intersystems Cache database
Hi, do you know if PHP supports the Intersystems 'Caché' database system? The PHP manual does not cite classes and I found no information at the intersystems web site. Thank you , Vincent
[PHP] Cacheing data form PHP script
Hi all, I use a HTML menu that is created from multiple database queries. This is powerfull and very extendable. The problem is that the queries have to be executed on every new page or request. Moreover, the menu won't change very often for the users. So I would like to 'cache' the HTML code that is generated. If one admin add/remove/update one menu, I need to clear the cache. At the moment, I store the HTML code to display the menu in the $_SESSION['menu_cache']['menu_id'] var. And this works well! The pages are displayed faster when the menu is in the cache, which is the expected result! What is your opinion about this? Do you see any other way to 'cache' some content? Could I use the $_ENV variable (or any other) to cache the menus accross ALL visitors/users? Thank you Vincent
RE: [PHP] Auto update feature from PHP app - like antivirus definitions
Maybe a PEAR package do do the trick. Have a look at PEAR_PackageFileManager on http://pear.php.net/package/PEAR_PackageFileManager I never used it, but plan to do. I you use it, please keep me informed Maybe you could have something more trivial if you just need to download a single file. Vincent -Original Message- From: Terence [mailto:[EMAIL PROTECTED] Sent: mardi 27 janvier 2004 9:17 To: [EMAIL PROTECTED] Subject: [PHP] Auto update feature from PHP app - like antivirus definitions Hi, Has anyone ever tried to produce an auto-update feature for your PHP application? Say a client downloads version 1, and a month later version 1.1 is available, which makes changes to a few scripts say, add_user.php, modify_user.php and display_users.php Does anyone have a method or way in which these scripts (say the source is available from the project homepage via a URL - something like http://theproject/updates/version1.1/add_user.php.gz) can be downloaded and replace the current one on the client's server? Just theory or a finger to point me in a general direction would be great. Hope this makes sense. Thanks Terence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR / PHP / IIS Inetinfo consuming more and more memory
Hi all, I'm developing a web appl. with PHP and PEAR, using mainly PEAR::MDB, PEAR::Config, and Smarty template engine. Under Win2000, the system seems to go slower and slower from the morning to the evening. A quick Task Manager, and ... My inetinfo.exe process consumes most of my RAM . I wonder if this is related to PHP and / or PEAR?? I'm not really a fan of IIS but... Are there some tricks to free memory on runtime? Vincent
[PHP] send a POST to a URL from within PHP code
Hi all, I would like to simulate sending a form in POST to a specified URL through PHP. I knwo how to do this from a HTML form : form method=post action=http://url.com/query; blablabla /form I would just like to simulate this because I have some processes that will change the values of the form before sending it to the 'action' URL With a GET, the fields would be included into the query strinbg, so this is quite easy. What happens in a POST? Any idea is welcome Vincent mailto: [EMAIL PROTECTED]
[PHP] mcrypt win32 install problem ?
Hi, I want to use the mcrypt module and I followed the instructions to install the dll for Win32 users : I copied the libmcrypt.dll file under c:\winnt\system32 I uncommented the extension=php_mcrypt.dll in the php.ini I restarted the computer I tried many examples available in the Net. The result is always the same : I can crypt a plain text but I cannot Uncrypt that text. Do you see any potential reason to this? I guess this problem is related to my computer / configuration... current config PHP 4.3.4 Win 2000 PEAR php in fo seems correct about mcrypt