[PHP] register_shutdown_function
hi, when i use register_shutdown_function in an included or required script, will the function be called after the processing of the included / required script, or after all scripts? i think they are called last, but i'm not sure ... does anyone know? + stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Delete checked files
make a form, one delete-button and put a checkbox before every file. the checkbox's name is 'delete_file['.$filename.']' ... wehen pressed delete open a file which foreach's every entry in delete_file and unlink it. but be careful - this could be a huge security-hole ... + stefan Nautilis [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi everybody, I show a list of files that I upload to the user's folder using the next code: $path= ../clients/$user; $dir = opendir ($root); while ($archivo = readdir ($dir)) { $size = filesize($path/$filename); $size = ($size/1024); $size = intval($size * 100 ) / 100; if ($filename!= . $filename!=..) { echo trtda href='$path/$filename'$filename/a/tdtd$size Kb/td/tr; } } I want to add a checkbox in every file i get in the user's folder. My question is: Is there any way to use some kind of function to delete selected files? I am not sure if i can use javascript to evaluate which is checked and how. And after that evaluation, how to call a unlink ($filename) to delete the files. Any help would be greatly appreciated. Nau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file upload problem (files 7.5mb)
i wrote a php uploadscript and it works fine till the file is not larger then 75mb is set the max upload file size in the upladfrom as well as in phpini to 100mb but it still doesn't work! system is linux red hat and php 406 (with mysql) is there anyone who had the samestefa problem and knows a solution? stefan -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Apache not parsing without .php on url?
Hello, I have a new Apache 2.0.40 with PHP 4.2.3 installation on a Solaris x86 box. Configered in httpd.conf with: AddType application/x-httpd-php .php and LoadModule Parsing url´s with .php works fine, but i can´t figure out why it dosen´t work if i leave out the .phpextension in the url? This works in my old apache 1 installation.! The file is named test.php in the abc directory. http://my.server.se/abc/test.php; works, but not http://my.server.se/abc/test; Any tips in what i missed out in configuration or how to fix this would be appreciated. best regards, Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Calling on functions in a url
http://www.sample.com/script.php?fucntion=1 http://www.sample.com/script.php?fucntion=2 Then do a 'case' or 'if' on $_GET['fucntion'] Tom Ray [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a question that I have yet to figure out. Let's say I have a PHP script with multiple fuctions, how do I call on the script to perfom specific functions through a url? Ex: http://www.sample.com/script.php?fucntion1 TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to get count of dimensions in multi array?
Hello, I´m trying to figer out how to get the number och dimensions of a array.. It isn´t the problem to get the count of elements with count(), it´s the number of dimensions i am stuck at :( Any tips would be appreciated. Best regards, Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Execute Perl CGI within PHP
Hi For some reasons I need to execute a Perl-CGI from within PHP. I tried it that way: $command = C:\\Perl\\bin\\Perl.exe .$basedir.myperl.pl; $result = @passthru($command, $status); now my Problem: the perl prints its output immidiatly to the browser and $result is empty after the execution of the perl-script. I needed the output in $result and don't want that the perl script prints to the browser... The whole thing is running on a win2k Server machine. Does someone know what I'm doing wrong? By the way: which number in $status means what? Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch --
[PHP] Multiple .ini-files for PHP
Is there a way to have different .ini-files for each VirtualHost? Apache is used as webserver Thank you for helping Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch --
[PHP] fsockopen - whats the syntax of POST?
First: can I do a POST-request with fsockopen? If yes, then: whats the syntax for POST-requests? I was happy if someone could point me to a good documentation or so Thanks in advance Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch --
[PHP] Parse POST-Data myself
Hi I have following problem: I get a form with some fields having the same name. PHP solves this problem by appending [] to the form-field-names which causes the creation of arrays. My problem now is, that I have to pass those variables further to another script (not PHP) in exactly that order I receive them from the form. But when I have a form (schematically) like this: -input type=text name=myfield1 -input type=text name=myfield2 -input type=text name=myfield1 -input type=text name=myfield2 -input type=text name=myfield1 -input type=text name=myfield2 Then I get in PHP all myfield1 in 1 variable (the array myfield1) and all myfield2 in 1 other variable - order is irreversibly destroyed. Give the fields numbers is not a solution (for complexity reasons). So my ultima ratio is to parse the post-data myself - but how can I do this? I have not found any indices for a variable containing post-data :-( If someone has another approach to a solution: I will have both ears open for it :) Thanks in advance Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch --
[PHP] SSL Connection causes data errors.
Hi, I was wondering if anyone has experienced this before. I am connecting to an IIS server over HTTPS using pfsockopen and am getting xml data returned. Now when I open the URL in a browser the XML is returned fine without a problem. However when using PHP part of the XML is all messed up, data is moved around it appears and it messes up the XML. I am getting an error at the end of my request to the server: PHP Warning: fread(): SSL: fatal protocol error in However from what I read that error deals with the closing of the connection. Any help would be very appreciated. Stefan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SSL Connection causes data errors.
Hi, I was wondering if anyone has experienced this before. I am connecting to an IIS server over HTTPS using pfsockopen and am getting xml data returned. Now when I open the URL in a browser the XML is returned fine without a problem. However when using PHP part of the XML is all messed up, data is moved around it appears and it messes up the XML. I am getting an error at the end of my request to the server: PHP Warning: fread(): SSL: fatal protocol error in ... However from what I read that error deals with the closing of the connection. Any help would be very appreciated. Stefan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session from php in ASP
Hi NG is it possible to get a Sessionvariable set in php read in an asp-file with the tag %= Session(php) %? Thanks in advance Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session from php in ASP
Yes. I don't get any values Jay Blanchard [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] [snip] is it possible to get a Sessionvariable set in php read in an asp-file with the tag %= Session(php) %? [/snip] Have you tried it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Post method HTTP 404
Hi I've a strange problem When I try to send a form with method=POST to a php-file I always get an HTTP 404 error. I really don't know why, because the file exists on the server. I use IIS 5.1 Tnx. Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php error
Hi I've a strange problem When I try to send a form with method=POST to a php-file I always get an HTTP 404 error. I really don't know why, because the file exists on the server. I use IIS 5.1 Tnx. Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] create forum
Hi. Are there some code-examples how to build a forum with php and xml? Tnx Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Serious problem with Compiler?!?
Hi there, my Server worked fine for several month now with php 4.3.4. Since a few hours (without changing anything for the last days) PHP doesn't 'know' basic commands as mysql_connect() or session_start() ... (e.g.: Fatal error: Call to undefined function: mysql_connect() ) I have no idea where to start searching for the problem as the logs don't tell anything about it! Thx for help in advance. Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serious problem with Compiler?!?
I've found where the problem came from: I was using PHP 4.3.9 (sorry for misinformation in the first mail) but it was overwritten by a suse onlineupdate 4.3.4 last night. This is where the problems came from. I have removed 4.3.4 via Yast and want to compile 4.3.10 now. ./configure and make test work fine, but when I use 'make', it only shows a few lines and doesn't install successfull: This is all text produced by make: -- begin Installing PHP SAPI module: apache2handler /usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/share/apache2/build/libtool' libphp4.la /usr/lib/apache2-prefork /usr/share/apache2/build/libtool --mode=install cp libphp4.la /usr/lib/apache2-prefork/ cp .libs/libphp4.so /usr/lib/apache2-prefork/libphp4.so cp .libs/libphp4.lai /usr/lib/apache2-prefork/libphp4.la libtool: install: warning: remember to run `libtool --finish /usr/local/src/php-4.3.10/libs' chmod 755 /usr/lib/apache2-prefork/libphp4.so [activating module `php4' in /etc/apache2/httpd2-prefork.conf] Installing build environment: /usr/lib/php/build/ Installing header files: /usr/include/php/ Installing helper programs: /usr/bin/ program: phpize program: php-config program: phpextdist -- end What may be the source of this problem? Jochem Maas wrote: Stefan wrote: Hi there, my Server worked fine for several month now with php 4.3.4. Since a few hours (without changing anything for the last days) PHP reboot? lame yes, but maybe it works. otherwise specify some server details here. check if files (e.g. the php binary, conf files) have changed (maybe a very recent filetime?) doesn't 'know' basic commands as mysql_connect() or session_start() ... (e.g.: Fatal error: Call to undefined function: mysql_connect() ) I have no idea where to start searching for the problem as the logs don't tell anything about it! mysql is an extension but session_start is core I believe - very odd that session_start() is not defined. Thx for help in advance. Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML Select
Hi NG I've a question about searching in a xmlfile. Is there a mehtod to select a xml-node with a specific value? e.g. xml nameabc/name namedef/name /xml and I want search for the node with name abc. Or is it possible with a xpath definition? Thanks in advance Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Update XML
Hi NG! I've a problem in updating an XML-Node value. How can I change the value of an XML node? Thanks in Advance Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHPmysqladmin
What about looking for yourself? http://www.google.com/search?hl=enlr=q=phpmyadmin -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 27. November 2004 19:27 An: PHP general Betreff: [PHP] PHPmysqladmin Where can you get PHPmysqladmin? I would like to load it on my test server to make updating and entering Mysql data easier. Thanks for your help! Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] help plssssss.!!!
Hi there! I would do it this way: Give the links a variable: http://www.mywebpage.com/index.php?link=page1 http://www.mywebpage.com/index.php?link=page2 ... http://www.mywebpage.com/index.php?link=page12 and then in the document below your menue: if (isset($link)) { include(pages/ . $link . .php); //Includes a page called e.g. 'page1' //in subdirectory 'pages/' } else { echo No Page selectedbr; //Error if no Page is selected in $link } Where the called page is in the directory 'Pages' under the name page1.php Stefan -Ursprüngliche Nachricht- Von: Tomar Rajeev (ext) [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 3. Dezember 2004 16:20 An: '[EMAIL PROTECTED]' Betreff: [PHP] help plss.!!! Hello All, I am a new member of this group and in the world of PHP;-) In my company, around 12 web pages are there. So, I want to make a web portal in PHP from where all these web pages can be accessed. Also, I want to provide the link for the web pages ( will make three categories) in three horizontal dynamic menu. If some user clicks on the link then the corresponding web page should be shown in the same web page just below the dynamic menu. It will be great if you could help me in finding the source code of this type of web page in PHP. Thanking in Anticipation. 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
RE: [PHP] Page that checks if a user exists on a remote system
Hi! Have you thougt of writing the userdata to a database and running a perl script by cron to do the rest? This would be an interesting opinion for security purpose. Stefan -Ursprüngliche Nachricht- Von: Jonathan Duncan [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 3. Dezember 2004 18:55 An: [EMAIL PROTECTED] Betreff: Re: [PHP] Page that checks if a user exists on a remote system Christophe, I see where you are coming from with that, but the purpose of this script is to remove me from the picture completely. I want someone to be able to come sign up on my site and automatically be added as a mail user and other things so that I do not need to do that kind of thing. I am looking to do like Hotmail, or Yahoo!, or Mail.com, or any of the other places do. I can go sign up on their site and immediately have an e-mail account that I can start using. No admin has to take the time to create my account for me. Does that make sense? Does that explain better why I am trying to do this? Has not anyone else wanted that functionality also? Thank you, Jonathan Duncan On Fri, 3 Dec 2004, Christophe Chisogne wrote: Jonathan Duncan wrote: I will also be doing a remote command to add a user to the remote system (ServerB) from the same PHP script. If you want to manage a server via web interface, dont reinvent the wheel. Use webmin, by example. Webmin runs a mini webserver as root (on port 1), and uses modules for managing users, proftp, apache, etc Of course, I dont know what you want to do. Christophe -- 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] Strange behaviour with PHP on Apache
Hi there, For the first time since my server is running I got some strange behaviour today without changing something before. Users trying to access my php-scripted websites (different projects) got a 'download' message instead of the site (as if the site (.php) was a downloadable file (e.g. .tgz or something else))). After restarting apache2 the problem was gone for about 2 hours, but then it came back. As first reaction I visited my log files instantly, but nothing looked different there. After it came for the second time, I restarted the server by 'init 6' and it is gone since then. As this is a production server, I cannont leave this one to chance. Maybe one of you has an idea what could cause this problem. (Low diskspace? Bad configurations?) I'm not sure if this is the right list to ask this, please point me to a better place if I'm wrong! And here is my configuration: PHP 4.3.4 on Apache 2.0.49 Suse Linux 9.1 Confixx 3.0 Pro Confixx ./configure: './configure' '--prefix=/usr' '--datadir=/usr/share/php' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--libdir=/usr/share' '--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib' '--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' '--disable-debug' '--enable-inline-optimization' '--enable-memory-limit' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sigchild' '--disable-ctype' '--disable-session' '--without-mysql' '--disable-cli' '--without-pear' '--with-openssl' '--with-apxs2=/usr/sbin/apxs2-prefork' 'i586-suse-linux' Thx a lot in advance. Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strange behaviour with PHP on Apache
That sounds like a nice hint. Unfortunately there seems to be no error in the apache2 error logfile - This must have been near the time, when the strange behaviour began: [Mon Dec 06 14:58:07 2004] [warn] NameVirtualHost 82.165.42.181:80 has no VirtualHosts [Mon Dec 06 14:58:09 2004] [notice] Apache/2.0.49 (Linux/SuSE) configured -- resuming normal operations [Mon Dec 06 14:58:09 2004] [warn] long lost child came home! (pid 1482) ...But as I saw in the Apache2 documentation, the warning 'long lost child came home' isn't that bad and can occur time by time. Any ideas? -Ursprüngliche Nachricht- Von: Jason Wong [mailto:[EMAIL PROTECTED] Gesendet: Montag, 6. Dezember 2004 19:54 An: [EMAIL PROTECTED] Betreff: Re: [PHP] Strange behaviour with PHP on Apache On Tuesday 07 December 2004 00:33, Stefan wrote: Users trying to access my php-scripted websites (different projects) got a 'download' message instead of the site (as if the site (.php) was a downloadable file (e.g. .tgz or something else))). It sounds like what would happen when your PHP aren't being processed and Apache's just dumping the file contents (ie your source code) to the browser. After restarting apache2 the problem was gone for about 2 hours, but then it came back. As first reaction I visited my log files instantly, but nothing looked different there. After it came for the second time, I restarted the server by 'init 6' and it is gone since then. Is this the error log file you looked at? The access logs won't tell you much. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* BOFH Excuse #71: The file system is full of it */ -- 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] stupid question about a class
In your class function you should move your query to a variable e.g. $query Then: return $query; And in your main program: $whatever = $q-getQuery(); __ Stefan -Ursprüngliche Nachricht- Von: Richard Kurth [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 8. Dezember 2004 19:21 An: PHP General Betreff: [PHP] stupid question about a class I have a stupid question but I can not figure it out I am using a class that creates the select statement for mysql. I am ale to add all the data with out any problem. But when I run the class to get the results. I can only see the results by running echo in front of the call to the class . echo $q-getQuery(); Output SELECT * FROM listing WHERE state='wa' if I $q-getQuery(); echo $g; Output Object id #1 How do I use the results in my mysql query If I can not move it to a variable -- Best regards, Richard mailto:[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] Curious problem overloading derived ObjectArray and __toString
hi, I extended ArrayObject (SPL) to a new class. Let's call it ExtObjectArray. ExtArrayObject is quiet tiny, only with some simple functions. One is called getData() and serves some string data. Now I've overloaded the class using __toString() ... public function __toString() { return( $this-getData()); } What I wish to do is, to ... $obj = new ExtArrayObject; print( (string)$obj); ... and it doesn't work. And i've absolutly no idea why. PHP prints instead of the getData() String the object ID, as the __toString isn't called. What actually is true. There are no errors, no warnings, no notices at all. If i invoke __toString() [print( $obj-__toString())] direct, it works fine! First i assumed it's a spelling mistake. But __toString(), including the case, is okay (source: zend2-engine-changes). Then i tried it without access spec. So without public, but that doesn't work either. Replacing the return statement in the __toString() method with a simple print( foo\n), I realized, that the method won't be called. That really sucks! :o) My PHP Version is php 5.0.1 build from source. Btw.: this little example also doesn't work. --- begin ? class foo { function __toString() { return(hallo); } } $a = new foo; echo (string)$a; ? --- end Assigning to another var instead directly output the object doesn't work either as the Zend Changelog (till 2004-07-14) doesn't say anything explaining the problem. anybody have more clue about that? regards, Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Solved: Curious problem overloading derived ObjectArray and __toString
m'kay ... already got it. The routine was disabled due some internal problems. It should be reintroduced in PHP 5.1. *wait* http://www.rb21.com/news/index.php/m/115763/0/#msg_115763 Stefan wrote: hi, I extended ArrayObject (SPL) to a new class. Let's call it ExtObjectArray. ExtArrayObject is quiet tiny, only with some simple functions. One is called getData() and serves some string data. Now I've overloaded the class using __toString() ... public function __toString() { return( $this-getData()); } What I wish to do is, to ... $obj = new ExtArrayObject; print( (string)$obj); ... and it doesn't work. And i've absolutly no idea why. PHP prints instead of the getData() String the object ID, as the __toString isn't called. What actually is true. There are no errors, no warnings, no notices at all. If i invoke __toString() [print( $obj-__toString())] direct, it works fine! First i assumed it's a spelling mistake. But __toString(), including the case, is okay (source: zend2-engine-changes). Then i tried it without access spec. So without public, but that doesn't work either. Replacing the return statement in the __toString() method with a simple print( foo\n), I realized, that the method won't be called. That really sucks! :o) My PHP Version is php 5.0.1 build from source. Btw.: this little example also doesn't work. --- begin ? class foo { function __toString() { return(hallo); } } $a = new foo; echo (string)$a; ? --- end Assigning to another var instead directly output the object doesn't work either as the Zend Changelog (till 2004-07-14) doesn't say anything explaining the problem. anybody have more clue about that? regards, Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Object Overloading in PHP5
It's a bug. * Siehe http://bugs.php.net/bug.php?id=28444 ... und ... * http://news.php.net/php.bugs/63652 A workaround is possible using __call( $name, $args) { return( $this-__get( $name)); }. But it sucks, since constructs using array indices are impossible as $obj-not_existing_attr()[0] regards Daniel Schierbeck wrote: Do you guys have any idea why this code: ?php class Foo { private $elem = array(); public function __get ($prop) { if (isset($this-elem[$prop])) { return $this-elem[$prop]; } else { trigger_error(Property '$prop' not defined, E_USER_ERROR); } } public function __set ($prop, $val) { $this-elem[$prop] = $val; } } $obj = new Foo; $obj-a = new Foo; $obj-a-b = Foobar; ? returns this: Fatal error: Cannot access undefined property for object with overloaded property access in ... on line 24 Where line 24 is: $obj-a-b = Foobar; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bug? ... ? ? and commenting them out
i've the dump feeling there's a bug in the parser (or in my mind =) since i tried to commenting out some code, containing ? ... ?. The according code was something like ... --- begin //$xml = ? ?; --- end the occured error is ... --- begin Parse error: parse error, unexpected $ in buninteresting/b on line b154/b --- end ... where 154 the document's last line. # for comment it out either, whereby /* ... */ works fine (as excepted). Seems like the parser doesn't parse the quotes in the statement, but parses the ? .. ? tags. So ? ... ? has an higher specifity than the comment itself. PHP Version is 5.0.1. Can anybody reproduce the problem (deleting the line fixes it ;o), or find out, wheter ignoring the comment is the desired behaviour? regards, Stefan Bolus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP as a web browser?
if you want a php-only solution, you should probably also consider fsockopen. http://www.php.net/manual/en/function.fsockopen.php best regards Stefan Rusterholz - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, December 17, 2001 9:26 AM Subject: RE: [PHP] PHP as a web browser? you may want to look at the curl functions as a start. thats most of the functionality down already. otherwise you'll have to parse raw data. not too hard, but can be painful to keep stateful info. you'll also have to rewrite code when the interface changes, you'll probably want to look at hotscripts or manuel lemos's script archives for prewritten html parsers. fopen/fread/fwrite is the way to go, but you'll need to interpret that data accordingly. Look at the rfc's on cookies and html if you are interested in going that route. been there done that myself (for a sms autosend script using mtnsms, but its a pia to start from scratch...) Lawrence -Original Message- From: David Yee [mailto:[EMAIL PROTECTED]] Sent: December 17, 2001 3:49 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP as a web browser? Is it possible to have PHP act like a web browser, accept cookies and post data (for login)? I'm not sure exactly where to start- I know you can use fopen/file to retrieve url's but I'm not too sure about the other steps. I would like to write and run such a php script as a cron job and have it do something like log into my web-based email account, retrieve emails, process them, save them locally, and then delete them on the server. Thanks for any help. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] can php pretend to be a MSIE or Netscape?
You should be able to using fsockopen. You can use the class below and modify it. Search the class for the string User-Agent: and change what's behind. http://phpclasses.upperdesign.com/browse.html?file=1222 happy querying Stefan Rusterholz - Original Message - From: Sebastian [EMAIL PROTECTED] To: 'Php-General [EMAIL PROTECTED] Sent: Monday, December 17, 2001 3:16 PM Subject: [PHP] can php pretend to be a MSIE or Netscape? hi all how do i prevent php from exposing itself when opening url with fopen() ? kann i make it look like MSIE or whatever? reaons : i want to query google by script but it does not allow that... Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Size of array in bytes
Hi I have a rather large array in my script and I was interested how much memory it uses. Is there a way to get the size of an array in bytes? BTW: I did RTFM and didn't find an accomidating function, so if there is one, please point me to it... TIA Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to save the result page generated by a Form?
I don't know if it matches your needs but perhaps it helps: http://www.php.net/manual/en/ref.outcontrol.php http://www.php.net/manual/it/ref.outcontrol.php this page isn't translated, but perhaps some subpages... good luck Stefan Rusterholz - Original Message - From: Joe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 20, 2001 10:38 AM Subject: [PHP] How to save the result page generated by a Form? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a simple question. My Scenario: Page a.php - The Form The user insert his data (ie name, address, city and so on...)Then he submit the $ to b.php. Page b.php now shows : Hello Mr. $name , etc etc ... I nedd now to save what I see on the sreen as .txt or .rft or .html How can I do that? I try many ways ...(using no session) ..but I can only save the empty b.php page ...with no varialbles showed at all. Thanx for your help and Marry XMas from Italy. BR Joe -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com Comment: ID: 0x0A17124F - DH/DSS 2048/1024 - Joe Athena Webmaster iQA/AwUBPCGxOET82/4KFxJPEQK+yQCfdrsJMV6YXUxsqUxmgsTrVguHotUAn1pA tF+VwCUw1Cdv4k70aWtvrynp =GI2/ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Size of array in bytes
Hm, I thought about that way - technically it was indeed a way to go since I don't want to perform this action everytime but only for testing purposes (so time doesn't matter). But aren't arrays in PHP internally stored in a hash-like system which's size doesn't have to be equal to the sum of it's content? I'm more interested in how many kbytes of RAM my array is using than the size in bytes of it's content... But thank you anyway for helping me! best regards Stefan Rusterholz Had the same problem not long ago and I didn't find a simple solution either. My solution at the time was the painfully slow one - walking the array and storing strlen for both key and value. Since you have a large array, this probably doesn't do for you. A faster but less accurate solution would be storing round(strlen(serialize($array))*$coefficient), where you should approximate $coefficient for your average array (the less the average array element size, the smaller the coefficient). I know, these are both rudimentary and ugly solutions but I didn't find any better - these are the solutions I considered when I had the same problem. Bogdan Stefan Rusterholz wrote: Hi I have a rather large array in my script and I was interested how much memory it uses. Is there a way to get the size of an array in bytes? BTW: I did RTFM and didn't find an accomidating function, so if there is one, please point me to it... TIA Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] setlocale on OS X not working
Hi I'm using following code: setlocale(LC_ALL, 'german'); $timestamp = time(); $string = strftime('Heute ist %A, der %d. %B %Y. Sie haben diese Seite um %H Uhr %M aufgerufen.', $timestamp); # in english: today it's %A, the %d. %B. %Y. You opened this page at %H:%M. echo $string; Which works nice on my ISP's Server. On my locale OS X Server it seems like it wouldn't be able to translate it. I get the correct output but in english instead of german. AFAIR I need to have some files to be installed on my system for that function to work correct. Does someone know where to get those files and where to put them in my system? best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] setlocale on OS X not working
Thanks for your help, but it doesn't work either :-( Am Donnerstag den, 27. Dezember 2001, um 16:12, schrieb Brian Clark: * Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 09:13]: Hi Hiya I'm using following code: setlocale(LC_ALL, 'german'); $timestamp = time(); $string = strftime('Heute ist %A, der %d. %B %Y. Sie haben diese Seite um %H Uhr %M aufgerufen.', $timestamp); # in english: today it's %A, the %d. %B. %Y. You opened this page at %H:%M. echo $string; Which works nice on my ISP's Server. On my locale OS X Server it seems like it wouldn't be able to translate it. I get the correct output but in english instead of german. The OSX machine doesn't have a definition for `german' but it probably has one for en_US, for example. Try de or de_DE or de_DE.ISO8859-1 instead of `german' and see if you get what you'd expect. FYI, I've never used OSX, so I'm flying blind. AFAIR I need to have some files to be installed on my system for that function to work correct. Does someone know where to get those files and where to put them in my system? On my system, charmaps in /usr/share/i18n/locales and definitions in /usr/lib/locale, and I would use localedef to build definitions from the charmaps (I think. I might have those directories reversed.). I've never used (or seen) OSX, but does it use man? (I'm absolutely not being a smarta$$ here). If it has man, look at the man pages for `localedef' and `locale' and that may get you headed in the right direction. I did that. For localedef it hasn't an entry. But for locale it has one. I don't think that's what you expectet (it seems to belong to perl) locale(3)Perl Programmers Reference Guide locale(3) NAME locale - Perl pragma to use and avoid POSIX locales for built-in operations SYNOPSIS @x = sort @y; # ASCII sorting order { use locale; @x = sort @y; # Locale-defined sorting order } @x = sort @y; # ASCII sorting order again DESCRIPTION This pragma tells the compiler to enable (or disable) the use of POSIX locales for built-in operations (LC_CTYPE for regular expressions, and LC_COLLATE for string compari- son). Each use locale or no locale affects statements to the end of the enclosing BLOCK. See the perllocale manpage for more detailed information on how Perl supports locales. 2000-03-30 perl v5.6.0 Perhaps this information helps you to help me further: Mac OS X is based on FreeBSD 3.0 (AFAIR).
Re: [PHP] setlocale on OS X not working
I forgot to mail that to the mailinglist too... * Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 11:30]: I did that. For localedef it hasn't an entry. But for locale it has one. I don't think that's what you expectet (it seems to belong to perl) Then you need to find out how to `compile' locale definitions for your system. locale(3)Perl Programmers Reference Guide locale(3) Oh no no. g man 1 locale Does that give you anything? (I'm guessing it would have picked that up first if it existed). No, it doesn't :-( and locale produces locale: Command not found That's the one I was talking about.. Is there a `locale' package you can install for OSX? (There is for my system.) There is one, but not for PHP, only for the system (which is actually multilingual and able to change language during runtime) Thank you for your help although... best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] setlocale on OS X not working
Hm, as far as I see that package is for Aqua (the GUI of OS X) and not for the core (FreeBSD, *nix), so it won't help - and it is actually installed (I use OS X in a german enviroment because I'm swiss). Do you know where to get language packets for FreeBSD? That might work... Am Donnerstag den, 27. Dezember 2001, um 18:36, schrieb Brian Clark: * Stefan Rusterholz ([EMAIL PROTECTED]) [Dec 27. 2001 12:12]: Is there a `locale' package you can install for OSX? (There is for my system.) There is one, but not for PHP, only for the system (which is actually multilingual and able to change language during runtime) That's what I'm talking about -- for the system. -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 HTML email needs a rant tag. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Bit shifting conversion (Delphi - PHP)
Hello all, I'm trying to convert a function done in Delphi (pascal) to PHP. This function is part of simple text encryption/decryption method. However, I have a really hard time to make this work in PHP. This is the Delphi code: Function RotateBits(C: Char; Bits: Integer): Char; var SI : Word; begin Bits := Bits mod 8; // Are we shifting left? if Bits 0 then begin // Put the data on the right half of a Word (2 bytes) SI := MakeWord(Byte(C),0); // Now shift it left the appropriate number of bits SI := SI shl Abs(Bits); end else begin // Put the data on the left half of a Word (2 bytes) SI := MakeWord(0,Byte(C)); // Now shift it right the appropriate number of bits SI := SI shr Abs(Bits); end; // Finally, Swap the bytes SI := Swap(SI); // And OR the two halves together SI := Lo(SI) or Hi(SI); Result := Chr(SI); end; and this the beginning of my attempt to do the same thing in PHP: function RotateBits($C, $Bits) { $Bits = $Bits % 8; if ($Bits 0 ) { $C = $C abs($Bits); } else { $C = $C abs($Bits); } return chr($C); } In the Delphi code the MakeWord function is a macro: #define MAKEWORD(a, b) \ ((WORD) (((BYTE) (a)) | ((WORD) ((BYTE) (b))) 8)) And Swap exchanges the high order byte with the low order byte of the word. Now my question is, how can I work with bytes and words in PHP? The closest I've found is just the integer, that may be of different sizes depending on system. Or, as a workaround, is there any way to detect the number of bytes an integer is on the current system? Thanks in advance. Best regards, Stefan Pettersson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regex question
Hi all, I've got a regex that's working fine, apart from one little problem. $tags = array (script, !--!\[CDATA\[, \]\]--); A quick shot (perhaps I miss the point ;): if you do $x = \[; then $x will contain [. If you then do a regex with preg_match(/$x/, ... eg. then it get's evaluated as preg_match(/[/, ... If you want the [ to be escaped in the regex you have to double-escape it: $x = \ \[; (sorry, the two \ should be together without a space but my stupid mail-app converts the string thinking it's an network address) so $x will contain \[ as you want ( the first backslash escapes the second). foreach ($tags as $currentTag) if (preg_match (/^\/. $currentTag. /, $content)) // do something Witan Jardine 13 Southampton Place London WC1A 2AL Tel: 020 7404 4004 I hope I didn't miss the point and could help you best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regex question
If you want the [ to be escaped in the regex you have to double-escape it: $x = \ \[; (sorry, the two \ should be together without a space but my stupid mail-app converts the string thinking it's an network address) so $x will contain \[ as you want ( the first backslash escapes the second). Hi Stefan, Thanks very much for that, it does make sense :-) Unfortunately it still hasn't fixed the problem... I suppose my question has now boiled down to do I need to escape !, , or - in a regex? :-) Cheers Jon here the expression again: $tags = array (script, !--!\[CDATA\[, \]\]--); foreach ($tags as $currentTag) if (preg_match (/^\/. $currentTag. /, $content)) // do something As far as I can see (notice: I'm not a regex-king ;) the regex seems correct to me. The only thing I'm wondering about is the /^ (second last line of the citation). Together with your expression in the array it results in preg_match(/\/!\[CDATA\[/, ...) I'm wondering if that (/![CDATA...) is really what you want to match (and not only ![CDATA without the trailing /). If it's not that then I suggest you to do simple example scripts where you have none-dynamic regex's to test if the expression works (that's the way I do that stuff - no really because I ever think I'd THIS TIME be able to do it without, but I haven't thought right till today ;) lot of luck mastering your expressions stefan rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to get a function backtrace?
Im not sure if function-backtrace is the correct word for what I need, so I'll explain: If I have for example ? a(); function a(){ b(); } function b(){ c(); } function c(){ $x = function_backtrace(); print_r($x); } ? then I want to get array( [0]= 'a', [1]= 'b', [2]= 'c' ) or something similar. So I want to know, what functions have been called. If you know perl, then adequate function was caller. I already searched php.net for it but had no luck for it - so if you please could point me to the right direction I was very happy. TIA Stefan Rusterholz
Re: [PHP] Re: How to get a stacktrace? (was how to get a function backtrace)
hmmm, i spent now a lot of time searching for such a function (discovering many many to me unknown but interesting functions :) - but it seems that there is no such function. And yes: I wanted to use it for debugging stuff. I have a lot of recursive functions and callback functions and it's sometimes incredibly hard to determine when exactly an error happened because I don't know the how maniest instance of a function actually is running and from where it got called. I have made some workarounds, but they are all unsatisfying compared to the possibilities a stacktrace function would offer... Just to give you a little impression what perl has got for such things (and i'd love to see that or something similar in PHP) an extract from the manual: caller EXPR caller Returns the context of the current subroutine call. In scalar context, returns the caller's package name if there is a caller, that is, if we're in a subroutine or eval or require, and the undefined value otherwise. In list context, returns ($package, $filename, $line) = caller; With EXPR, it returns some extra information that the debugger uses to print a stack trace. The value of EXPR indicates how many call frames to go back before the current one. ($package, $filename, $line, $subroutine, $hasargs, $wantarray, $evaltext, $is_require, $hints, $bitmask) = caller($i); Here $subroutine may be (eval) if the frame is not a subroutine call, but an eval. In such a case additional elements $evaltext and $is_require are set: $is_require is true if the frame is created by a require or use statement, $evaltext contains the text of the eval EXPR statement. In particular, for an eval BLOCK statement, $filename is (eval), but $evaltext is undefined. (Note also that each use statement creates a require frame inside an eval EXPR) frame. $hasargs is true if a new instance of @_ was set up for the frame. $hints and $bitmask contain pragmatic hints that the caller was compiled with. The $hints and $bitmask values are subject to change between versions of Perl, and are not meant for external use. Furthermore, when called from within the DB package, caller returns more detailed information: it sets the list variable @DB::args to be the arguments with which the subroutine was invoked. Be aware that the optimizer might have optimized call frames away before caller had a chance to get the information. That means that caller(N) might not return information about the call frame you expect it do, for N 1. In particular, @DB::args might have information from the previous time caller was called. - Original Message - From: Martin Wickman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 14, 2002 10:24 AM Subject: [PHP] Re: How to get a function backtrace? Stefan Rusterholz wrote: Im not sure if function-backtrace is the correct word for what I need, so I'll explain: If I have for example What you are looking for is a stacktrace, ie the stack of called functions. Dunno if php has any support for it, but it is normally used when debugging and error/exception handling. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing variables with include()
- Original Message - From: Imar de Vries [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 14, 2002 12:53 PM Subject: [PHP] Passing variables with include() Hi all, at this moment I am working on a script that calculates standings of our online racing competition. In order to do that, I have to connect to a database on a remote server. I have read in the php manual that [quote] When a file is include()ed, the code it contains inherits the variable scope of the line on which the include() occurs. Any variables available at that line in the calling file will be available within the called file. If the include() occurs inside a function within the calling file, then all of the code contained in the called file will behave as though it had been defined inside that function. [/quote] But for some reason, i simply do not get the script to work. I use a form in the local script to determine which standings are to be shown, and the value is stored in $serie_id. This is done in the main scope (no function used). $serie_id can be 2, 3 or 4. Then I make an include call to the remote script: include(http://www.someremote.server/calculate_drivers.php;); I'd make a bet (I haven't tried it) that you receive the file already parsed and so as pure html. Try it with the extension .txt or something that the remote webserver doesn't process before it outputs the content. In that remote script I use $serie_id to make a database query. But so far, the query fails because $serie_id is not known. Are there any known exceptions (f.i. specific server settings) that might explain why the variable is not known on the remote server? Thanks in advance! -- Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439 best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Passing variables with include()
Sure you can. Right out from the manual: If URL fopen wrappers are enabled in PHP (which they are in the default configuration), you can specify the file to be include()ed using an URL instead of a local pathname. See Remote files and fopen() for more information. best regards Stefan Rusterholz - Original Message - From: Tino Didriksen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 14, 2002 1:53 PM Subject: [PHP] Re: Passing variables with include() include(http://www.someremote.server/calculate_drivers.php;); Very simple really: You cannot include remote files... --|-- Tino Didriksen http://ProjectJJ.dk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Passing variables with include()
Since some time there has only one difference left (don't know at which version it changed): include causes a warning and require an error on fail. (very useful for debugging - require your error-handler and include everything else) best regards Stefan Rusterholz - Original Message - From: Scott Houseman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 13, 2002 2:54 PM Subject: Re: [PHP] Re: Passing variables with include() Hi Al. While we are on topic, what are the key differences between include() require() ? Cheers Scott - Original Message - From: Martin Wickman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 14, 2002 3:40 PM Subject: [PHP] Re: Passing variables with include() Imar De Vries wrote: Imar De Vries wrote: - Including remote files *is* possible. The php manual does not mention this does not work, and when I add the variable to the call (include /calculate_drivers?serie_id=3.php) the code is processed perfectly. The thing is, I can not pass the variable with the call, because it's value is determined by the form field. I could use a switch statement of course, but that adds a lot more text to the code. I just changed the code to (include .../calculate_drivers?serie_id=$serie_id.php) ... and this worked! Weird solution... Not really. The http://.../foo.php request returns html and not php. The foo.php file is parsed and executed by the remote server and returned to you as html. By adding serie_id=xxx you actually give the remote php-script the name and value of the variable. You should think of include/require as a way to *include* any file into your script. Instead of cutting and pasting code into your file, you use include. Thats the way it works in practice. No magic is going on here :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Passing variables with include()
Scott Houseman wrote: Hi Al. While we are on topic, what are the key differences between include() require() ? Unlike include(), require() will always read in the target file, even if the line it's on never executes. If you want to conditionally include a file, use include(). The conditional statement won't affect the require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed. I'm pretty sure that at last for PHP 4.06 or higher this is deprecated. I don't know why it is still in the manual. Please correct me if I'm wrong. best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] variable problem - help!
Hi! I 'm trying not to hard code my php coding and I'm trying to pass a variable name into the $row[coloumname_$variable]; $row[columname_$variable] should do it. $row[constant] is threaten as constant which is normally not the programmers intention (set_error_reporting(0) and you'll see PHP's complaints about it) so PHP converts it to $row['constant']. You may now understand, that PHP translates your code to $row['coloumname_$variable'] whre $variable is a string and not a variable. I hope, I could express myself understandable :) best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] CONTINUE - variable problem - help!
hi again! I tried it but it desn't give me any result back. It dosn't print any error message but it desn't print my result either. this is how I place the code: echo ...some html code...; $row[somename_$var]; echo ...the continuation of the html code; thanks! I think this indice in $row is empty then... try echo (isset($row[somename_$var] $row[somename_$var] !== ) ? $row[somename_$var] : Sorry, but \$row[\somename_$var\] is not set.); I'll explain, what this code does: it first checks isset($var) - if this variable (or in this case the indice of the array) exists, this is true. so if $row[somename_$var] exists and is not empty, it does 'echo' the stuff behind the ?, else it does 'echo' the stuff behind the : and please don't set your priority to important on the list - thank you. best regars Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] CONTINUE - variable problem - help!
whoops, typo: echo (isset($row[somename_$var]) $row[somename_$var] !== ) ? $row[somename_$var] : Sorry, but \$row[\somename_$var\] is not set.; above code should be correct :) (notice: it's only 1 line - email could display it on multiple lines). and here a smaller explanation of the ternary operator (?:): echo (condition) ? condition is true : condition is false; if conditions evaluates to true then PHP interprets it like echo condition is true; else echo condition is false; best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Help! PHP 4.03pl1, fopen and cobalt RaQ4
Hi all I got a RaQ4 in front of me which I should get running. Now my script (running fine on a IIS with PHP 4.06) outputs a quite strange error (it uses my error-handler that's why it's formatted like this): Time: Thu 17.01.02 - 15:26:15 Level: Warning (2) File: /home/sites/site1/includes/class.myClass.inc.php Line: 103 Message: fopen(http://192.168.1.50/script/external_cgi.exe?some=3Darguments,r;) - Success Why does it trigger an error when it was a success? Are there any known bugs with php 4.03pl1 and fopen? Furthermore: does anyone know how I can upgrade the RaQ to PHP 4.06 or even 4.1.1 in a usable time (I don't want to try to compile PHP myself)? TIA Stefan Rusterholz
[PHP] PHP Installation: .rpm working with RaQ4 wanted...
Hi is there a recommendable site where I can find a .rpm (PHP 4.06 or higher) working on a Cobalt RaQ4? (I found some for RH6.x 7.x but they didn't work. I got the message only packages with major numbers = 3 are supported by this version of RPM) Any hints are appreciated! TIA best regards Stefan Rusterholz
Re: [PHP] Whats the best way.
Read this through: http://www.php.net/manual/en/features.file-upload.php Consider then: http://www.php.net/manual/en/function.is-uploaded-file.php After that read: http://www.php.net/manual/en/function.move-uploaded-file.php and then do it like that: -upload form -check if user has uploaded a file (he could have sent an empty form) -check what extension is needed (.jpg, .gif or whatever) -move_uploaded_file($userfile, Your/Directory/.time().$extension) hope this helps stefan rusterholz - Original Message - From: Philip J. Newman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 24, 2002 9:47 AM Subject: [PHP] Whats the best way. Whats the best way that I can let users upload single .jpeg and gif files, renaming then with a time stamp? Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] db conversion advice needed
- Original Message - From: Wilbert Enserink [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Wednesday, January 23, 2002 4:34 PM Subject: [PHP] db conversion advice needed Hi all, I have this huge db in FileMaker Pro format :-( Which plattform? Mac, Win? I had once to write an import script for mysql to import a tab-export from FM Pro Mac. I did it this way: -HTML-Fileupload -Translate chars (e.g. german characters ä, ö, ü - or in HTML auml;, ouml; - furthermore I translated ASCII 13 to br) -Read in a loop line for line -Split line by tab -check if record is already in mysql database (only if you have to import more than once) -build mysql insert query -done :) If you have more questions or more detailed questions just ask best regards Stefan Rusterholz Now I need this db to make a db content based website. I know enough stuff about MySQL to do this, but I don't know anything about converting db's. Does anybody have any tips, or ideas how I can handle this db converting thing best? I am able to export the filemaker pro file to -tab based- files, which I know M$ excel can import many regards, and thx for all the ideas. Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] multi-threading within php?
Sorry, I don't have an answer on your question, but a question to you: I'm currently building a class to browse a page and was interested in the source of your script. Especially on that part extracting the links. Would you mind providing the source or is it a commercial? best regards Stefan Rusterholz - Original Message - From: Mattias Andersson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 24, 2002 2:52 PM Subject: [PHP] multi-threading within php? Hello! I was making a spider for a simple searchengine and all was well until I started testing it on larger sites. The problem isn't that it doesn't work, it does, but it is very very slow, just handling one connection at the time. Basically, it just downloads a page, extract all links from it, then downloads those pages, extract their links, until all pages on a site has been downloaded and archived. Is there any way to do it in several threads so that it handles several connections simultaneously? If it would dynamically allocate threads that would be even better. Regards, Mattias Andersson Software Developer, humany AB Direct: 08-4540701 Mobile: 0704-526685 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Correct URL's
Hi I have a HTML-Form where user's can enter their website-address. Some of you know the resulting problem for sure: most users enter www.php.net, some users enter http://www.php.net; and some others enter http://www.php.net/;. The last version is IMHO the most correct form. (http://www.php.net; is commonly used, but afaik it's either the webbrowser or the webserver which appends the missing /). So my problem was to rewrite the url's so that entered URL's will be displayed correct, no matter how the user entered it. For this purpose I wrote following function: function rewriteURL($url, $base=){ $purl = parse_url($url); if (!isset($purl['scheme']) || (!$purl['scheme'])){ $url = http://.$url; } $purl = parse_url($url); if ((!isset($purl['path'])) || (!$purl['path'])){ $url .= '/'; } return $url; } My Questions: -Are there URLs which could be entered correct and become wrong when rewritten with that function? (Yes, I have tested the function myself, but there are too many possibilities so it's impossible for me to cover all of them) -What was the best way to check, if the give address really exists? (I thought on a test like this: $exists = true; @fopen($url) or $exists = false; return $exists;) TIA Stefan Rusterholz
Re: [PHP] Correct URL's
- Original Message - From: Alexander Weber [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 25, 2002 10:34 AM Subject: Re: [PHP] Correct URL's Stefan Rusterholz wrote What was the best way to check, if the give address really exists? Just try this function: http://www.php.net/manual/en/function.gethostbyname.php It returns the IP address of the given domain. Normally a domain can be accessed by the browser if it has a valid IP address and everything is configured correctly. But if I understand this function right, It will only work for URLs like http://www.php.net/ - what if the user has a free space from his ISP which is located in a subdir like http://www.php.net/users/myhome/? Please do not send HTML messages. Sorry, Outlook is crap and I'm just too lazy to buy (on Win you have to buy almost everything) another e-mail client for my working machine. But I finally moved my ass and changed the options to send text-only mails. I hope you are happy now :) (m$ thought it was a good idea to hide those options as good as possible - I disagree with them, but that's just normal ;-) Alexander Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to echo the /n, /r, etc... to the HTML display?
I suppose sp is space? Two suggestions: Why don't you do pre (print here the string as-is. newlines and spaces will be kept as they are by the browser) /pre Another Possibility: $string = preg_replace(/\\s/, nbsp;, $string); I hope I addressed your problem and didn't miss the point best regards Stefan Rusterholz - Original Message - From: Scott Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 25, 2002 6:31 PM Subject: [PHP] How to echo the /n, /r, etc... to the HTML display? Hi! I have been working on this part for a few days now! It had become appareant that HTML is not able to do this, so I'm trying to get it to work in PHP but no luck! The string I see like this is when I run the UNIX command od -av filename |more. --clip here-- del cr lf cr lf cr lf cr 020 lf P A G E sp 1 sp sp sp D A T E sp sp 0401 - 2 5 - 2 0 0 2 sp sp T I M E sp 0601 0 : 3 8 : 1 4 sp sp P @ F E P sp 100 sp V 0 0 1 sp sp T C A 1 cr --clip end-- So, you see, if I use the PHP function, nl2br(), that took care of the cr and the lf. But it doesn't take care of the sp so how do I fix that? This sp when work correctly will be able to justify the text on each line. Anyone know? thanks, Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mailing to 19000 users
Read through the according rfc's. http://www.ietf.org/rfc/rfc0821.txt could match (else do a google search on rfc +mail without parenthesis) I didn't find anything about length limitation (but I didn't read it _very_ seriously) so I think it's theoretically not limited. But I could imagine that (once more) theory and reality diverge so that some mail-servers _have_ limitations (due to memory issues or whatever - I'm not a specialist here as I mentioned). If you have a domainname with e-mail address supporting wildcards, just try it out sending yourself one or two hundreds of mails. 190 loops shouldn't be bad. good luck stefan rusterholz - Original Message - From: val petruchek [EMAIL PROTECTED] To: Stefan Rusterholz [EMAIL PROTECTED] Sent: Tuesday, January 29, 2002 12:00 PM Subject: Re: [PHP] mailing to 19000 users I have no experience with this stuff, but some thoughts split the recipients up into groups of 100-1000 persons. put that group of recipients into bbc (all) so nobody will see the others mail address. And what about $bcc length? Has it any length limitations? Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Feature requests for PHP development - where to post them?
Is there a place especially meant to make feature-requests to the php-development team? TIA stefan rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Function call stack
If you set_error_handler, then you get automatically line number and filename. Read through: http://www.php.net/manual/en/function.set-error-handler.php (read user comments! there are undocumented things) Then set up your handler like this: $_old_error_handler = set_error_handler(myErrorHandler); function somefunction(){ #do some stuff trigger_error(Something went wrong, don't know why, sorry, E_USER_ERROR); } function myErrorHandler($level, $message, $file, $line, $context){ #$context contains _ALL_ variabels in scope when error happened echo D'oh, an error has occurred: $message.\n; echo It happened in file $file at line $line and it is a $level-error; } the most beauty about that is that you can also cover errors you didn't handle (e.g. if fopen triggers a warning or whatever) best regards stefan rusterholz - Original Message - From: Lars Torben Wilson [EMAIL PROTECTED] To: Christian Novak [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 30, 2002 12:45 PM Subject: Re: [PHP] Function call stack On Wed, 2002-01-30 at 03:33, Christian Novak wrote: Has anyone an idea on how to get information from PHP on the function call stack. I need the line number and file calling a function for a custom error handler. This cannot be done in current versions of PHP. There are feature requests in the bug database about this, though. Torben To be more clear, here is what I would like to do: - I have a library, included in the main program - I have an error handler in the library // main.php require library.php; $x = myfunc('A'); // library.php function myfunc($i) { if (!is_int($i)) { $file = // how can I get the file name of the file calling myfunc() $line = // how can I get the line number of the file calling myfunc() trigger_error(Error in $file, at line $line, paramter must be an integer!, E_USER_ERROR); return($i); Using the pre_defined varibales __line__ and __file__ will always point me to the function not the calling script. Best regards Christian Novak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How do I Resize an image?
Thank you for that hint. Where do I get netpbm? Is it fast? What image-formats are supported (jpg, png, gif, ...)? What operations are supportetd (resizing, antialiasing, merging, writing text to pictures, etc.)? best regards Stefan Rusterholz - Original Message - From: Tony Bibbs [EMAIL PROTECTED] To: Bryan Gintz [EMAIL PROTECTED] Cc: Francis Cronjé [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Wednesday, January 30, 2002 3:25 PM Subject: Re: [PHP] How do I Resize an image? You can use GD, or imagemagick. If you want to make your code easily portable, you may want to consider using netpbm as it runs on linux,freebsd,macosx,solaris and windows. --Tony On Wed, 2002-01-30 at 08:18, Bryan Gintz wrote: For Linux (Unix) you can get a tool called imagemagik (not sure of spelling) and do a system call to it from a php script. Bryan Francis Cronjé wrote: I am new to php and wd appreciate any help! I have been through the manual, but have found no solution: 1.How do I resize an image retrieved from an interbase database before = displaying it on a page? ie If the image is 800 x 600 pixels and I want to resize the image to = 256 x 192 2.Do I have to install gd library? 3.How do I display the image from the interbase database? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Tony Bibbs | Life is a moderately good play [EMAIL PROTECTED] | with a bad 3rd act. 515.554.8046 | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What is ? Mean in the Action Box
From: val petruchek [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, January 31, 2002 10:40 AM Subject: Re: [PHP] What is ? Mean in the Action Box Dear all I had open a webpage which design from my company's pervious staff! This page is a input form, and when i look at the properity of the Form i saw this: form name=o_form action=deposit_admin.php?save=yes method=post What is the ? mean in the Action part? after ? goes the list of parameters deposit_admin.php will get as variables ($yes or $HTTP_GET_VARS[yes]) Other way round: with mypage.php?save=yes you'll have $save which contains 'yes'* and not $yes containing 'save'. But I think this was a kind of typo ;-) (*$HTTP_GET_VARS['save'] works also. And use that quotes $array['E_ERROR'] is not the same as $array[E_ERROR]! The second is a constant and thats not what you _really_ want even if php normally correctly converts it to a string) best regards Stefan Rusterholz Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Out of the box algorithms
Hi As part of a class I'm building I need to parse a file where following line occurrs: users: username username with spaces anotherusername I need to parse that into a structure like $users = array( 'username', 'username with spaces', 'anotherusername' ); The issue is the string after the : (the other part is relativly easy as you could think) Is there anyone having a parsing algorithm for that just out of the box? It would save me reinventing the wheel ;-) TIA stefan rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Searching class capable of parsing ID3-tags in MP3-files
I I search a class to parse mp3-files' id3 tag. I already found one at upperdesign.com but it seems not to be capable of parsing newer versions of the id3 tag :( So does anyone know an already existing class doing that for me? TIA Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CURL and multiple sites at once
Hi I'm looking for the fastest way to fetch multiple pages from php Currently I'm trying the curl-lib and it works fine - I just don't understand how to use curl that it stores multiple requests in multiple files I'll try to explain my problem more detailed: Somewhere are the pages http://foobarcom/page1html http://foobarcom/page2html http://foobarcom/page3html I want to fetch them with php and write them locally to the files foobarpage1html foobarpage2html foobarpage3html And I try to achieve a maximal speed I tried following code: $fh1 = fopen(foobarpage1html, w); $fh2 = fopen(foobarpage2html, w); $fh3 = fopen(foobarpage3html, w); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, http://foobarcom/page1html;); curl_setopt($ch, CURLOPT_FILE, $fh1); curl_exec($ch); //exec1 curl_setopt($ch, CURLOPT_URL, http://foobarcom/page2html;); curl_setopt($ch, CURLOPT_FILE, $fh2); curl_exec($ch); //exec2 curl_setopt($ch, CURLOPT_URL, http://foobarcom/page3html;); curl_setopt($ch, CURLOPT_FILE, $fh3); curl_exec($ch); curl_close($ch); fclose($fh1); fclose($fh2); fclose($fh3); I just tells me that it's not capable of executing one handler multiple times If I delete the lines with exec1 and exec2 it works but only stores the last page Who can help? TIA greets Stefan Rusterholz -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP] Re: DOMXML and encodings (php4.1.2, libxml2.4.16)
Hi Lucky wrote: Hello all, I have a little problem with encodings with libxml2 resp. domxml in php. In our site we're storing articles as XML, ISO-8859-1 encoded (indicated in xml-header). Libxml2 is doing all the internal processing in UTF-8, so the article gets translated to UTF-8. But when I do an xmltree() on the article, all output of libxml is in UTF-8, too, and it's really ugly to read german umlauts in UTF-8 in a browser displaying all as ISO-8859-1. Is there any way (other than manually do utf8_decode on every part of the output, which is _very_ ugly and annoying) to tell php or libxml to output things in UTF-8? No, unfortunately there isn't. Here's a quote from the libxml site (http://xmlsoft.org/encoding.html): ... basically the I18N (internationalization) support get triggered only during I/O operation, i.e. when reading a document or saving one Regards, Stefan Livieratos -- ICS Plus Internet Consulting + Services == Aeussere Brucker Str. 51 D-91058 Erlangen Germany == Tel: +49 9131 127733 Fax: +49 9131 127744 E-mail : [EMAIL PROTECTED] Web: http://www.icsplus.de == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HELP! Open HTTPS://, and follow rediect header
Hi, Zlutarch G. wrote: Hi All, I need help on two problems: 1) Is there a PHP function similar to fopen() that would open URL begins with https://;, i.e., SSL address? fopen(https://...;) is working with current CVS but is not going to be in a release before version 4.3. For now you can use the cURL module provided the cURL library is compiled with OpenSSL support. 2) Does anyone know if it is possible in PHP to read redirect instructions in HTTP header, and then follow the links? Use the cURL module: ?php $ch = curl_init (http://www.php.net/;); curl_setopt ($ch, CURLOPT_HEADER, 1); curl_setopt ($ch, CURLOPT_NOBODY, 1); ob_start(); curl_exec ($ch); $header = ob_get_contents(); ob_end_clean(); curl_close ($ch); ? Now search for the Location header in $header. Regards, Stefan Livieratos -- ICS Plus Internet Consulting + Services == Aeussere Brucker Str. 51 D-91058 Erlangen Germany == Tel: +49 9131 127733 Fax: +49 9131 127744 E-mail : [EMAIL PROTECTED] Web: http://www.icsplus.de == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] '--enable-track-vars' php.ini file on Mac OS X
Hi I suppose you mean register_globals is off and should be on, right? Ok, to make this short, do following: create a file php.ini on your desktop and write following into it: register_globals=on Make sure you have unix-linebreaks (use BBedit for example, or pepper) and a linebreak at the end of the line. Save the file and open the terminal. Enter root cp /Users/yourname/Desktop/php.ini /usr/local/lib/ apachectl restart Now try it again. Register_globals should now be on. As another one has written, enable_track_vars is always on. I use the same installation (entropy.ch) for php :) cya Stefan Rusterholz Am Dienstag den, 11. Juni 2002, um 09:02, schrieb Mario A. Salinas: Hi Folks, Let me begin with the direct question to save you time. If you want more info read more about the issue by reading 'The Problem:' below. The question: Is there any way to '--enable-track-vars' in my Macintosh laptop running Mac OS-X 10.1.5 and a version 4.2.1 installation of PHP without creating a php.ini file? Is there a command I can run to do this? If so... What directory do I need to be in when I do this? Configuration Info: Mac OS X PHP Version 4.2.1 The problem: I have a PHP application which works fine on a Cobalt server that is running PHP 4.0.2. My problem is that I'm trying to run this application (a set of PHP scripts) on my Macintosh laptop which is running Mac OS X 10.1.5. I have tested the PHP installation using the phpinfo() function on my laptop and it works fine. But my scripts require the tracking of variables. By running the phpinfo() function on both my laptop (PHP v. 4.2.1 this does not run my scripts) and the cobalt server (PHP v. 4.0.2 this does run my scripts) I noticed that there was some difference in the configuration. I noticed that my laptop configuration does not have '--enable-track-vars' listed under the Configure Command information in the PHP configuration page that results from running the phpinfo() function but the Cobalt PHP installation does have that listed. The installation of PHP I used was obtained from: http://www.entropy.ch/software/macosx/php/ This page says that this installation package does not include a php.ini file and it goes on to say that, if I want this file I should just create it. But it does not say what should go into this php.ini file. I suppose I could just copy the php.ini file from the Cobalt server running PHP v. 4.0.2 but I think that won't work. Any ideas? Thanks in advance, Mario Salinas -- 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] browscap.ini
Hi Has anyone got an up to date browscap.ini-file or does someone know where to get one? The most up to date browscap I found got it's last update in October 9, 2001 - since then a lot new browser appeared... best regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] browscap.ini
Hi Sorry, but this one is pretty old, an excerpt from the website: browscap.ini download Current version: 2.5 Last updated: February 2000 Download size: 14 KB February 2000 I took the following: http://asp.net.do/browscap.zip (found in the user-comments for get_browser()) It's from October 2001. But that's still not new enough... Am Dienstag den, 28. Mai 2002, um 17:31, schrieb Tyler Longren: I found this in the PHP FAQ: http://www.cyscape.com/browscap/ http://www.php.net/manual/en/faq.obtaining.php Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: Stefan Rusterholz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 10:15 AM Subject: [PHP] browscap.ini Hi Has anyone got an up to date browscap.ini-file or does someone know where to get one? The most up to date browscap I found got it's last update in October 9, 2001 - since then a lot new browser appeared... best regards Stefan Rusterholz -- 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] imageJPEG problem.
- Original Message - From: Johan Vikerskog (EMP) [EMAIL PROTECTED] To: 'Stefan Rusterholz' [EMAIL PROTECTED]; Johan Vikerskog (EMP) [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 25, 2001 9:07 AM Subject: RE: [PHP] imageJPEG problem. Thanks for your answer but the problem remains. It says i allready have given the header information and everything comes out in ascii. file://Johan -Original Message- From: Stefan Rusterholz [mailto:[EMAIL PROTECTED]] Sent: den 25 september 2001 08:55 To: Johan Vikerskog (EMP); [EMAIL PROTECTED] Subject: Re: [PHP] imageJPEG problem. - Original Message - From: Johan Vikerskog (EMP) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 25, 2001 8:47 AM Subject: [PHP] imageJPEG problem. When trying to use a simple code like this below i receive an error which says that it cant find the header. ? Header(Content-type: image/jpeg); I don't know about the other stuff of your script, but when I wrote a similar script, I took content-type: image/jpg and not 'jpeg'. Probably that's the point... $im = imagecreatefromjpeg(./test.jpg); Imagejpeg($im,'',20); ImageDestroy($im); ? It outputs the information in ascii and binary code. it doesn't show the picture Thanks for all the help you can give me. file://Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] make sure you run the php-part at the very top of the file: ?php header(...); ? HTML HEAD ...and so on if you have output before you execute the php part, your webserver will generate the header for you and then it is impossible to send another header (exactly because of what the warning tells you: the headers are already sent - but by the server and not by you and the server normally assumes text/html or text/plain). I hope, it helps regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] imageJPEG problem.
Whooops, right. HTML after or before picture data doesn't make any sense :) I checked my a bit older function, which puts out image data correctly working. I'm sorry, but I didn't see a big difference to yours... But as I said before: I don't know what your doing at that lines where you wrote: $im = imagecreatefromjpeg(./test.jpg); Imagejpeg($im,'',20); ImageDestroy($im); If I was you, I would try to open and read a valid jpeg file, just for testing, if the output works. If it works, I'd search the error in that lines written above. Here a snippet from my routine (and now I see: header really has to be image/jpeg, I must have been a little tired): require(../protected/php_db_access.inc); mysql_select_db('mydb'); $picture_types=array(jpg = image/jpeg, gif = image/gif, png = image/png); $result=mysql_query(SELECT type,picture FROM $table[pictures] WHERE id='$pic_id'); $img_data=mysql_fetch_array($result); $mime=$picture_types[$img_data['type']]; $img_bin=$img_data['image']; header(Content-type: $mime); echo $image; I know that the routine could be written better, but I think I wrote it in a hurry when I wrote it :) Perhaps you can do something with that routine (it works fine on a linux machine)... regards stefan rusterholz - Original Message - From: Hugh Danaher [EMAIL PROTECTED] To: Stefan Rusterholz [EMAIL PROTECTED] Cc: Php-General [EMAIL PROTECTED] Sent: Tuesday, September 25, 2001 9:33 AM Subject: Re: [PHP] imageJPEG problem. Stephan, Check that there are no html statements or blank lines above the ?php line. I had a few blank lines in my first program, and it gave me the same error message. Hugh - Original Message - From: Stefan Rusterholz [EMAIL PROTECTED] To: Johan Vikerskog (EMP) [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 25, 2001 12:13 AM Subject: Re: [PHP] imageJPEG problem. - Original Message - From: Johan Vikerskog (EMP) [EMAIL PROTECTED] To: 'Stefan Rusterholz' [EMAIL PROTECTED]; Johan Vikerskog (EMP) [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 25, 2001 9:07 AM Subject: RE: [PHP] imageJPEG problem. Thanks for your answer but the problem remains. It says i allready have given the header information and everything comes out in ascii. file://Johan -Original Message- From: Stefan Rusterholz [mailto:[EMAIL PROTECTED]] Sent: den 25 september 2001 08:55 To: Johan Vikerskog (EMP); [EMAIL PROTECTED] Subject: Re: [PHP] imageJPEG problem. - Original Message - From: Johan Vikerskog (EMP) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 25, 2001 8:47 AM Subject: [PHP] imageJPEG problem. When trying to use a simple code like this below i receive an error which says that it cant find the header. ? Header(Content-type: image/jpeg); I don't know about the other stuff of your script, but when I wrote a similar script, I took content-type: image/jpg and not 'jpeg'. Probably that's the point... $im = imagecreatefromjpeg(./test.jpg); Imagejpeg($im,'',20); ImageDestroy($im); ? It outputs the information in ascii and binary code. it doesn't show the picture Thanks for all the help you can give me. file://Johan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] make sure you run the php-part at the very top of the file: ?php header(...); ? HTML HEAD ...and so on if you have output before you execute the php part, your webserver will generate the header for you and then it is impossible to send another header (exactly because of what the warning tells you: the headers are already sent - but by the server and not by you and the server normally assumes text/html or text/plain). I hope, it helps regards Stefan Rusterholz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Execute Perl CGI within PHP
Hi For some reasons I need to execute a Perl-CGI from within PHP. I tried it that way: $command = C:\\Perl\\bin\\Perl.exe .$basedir.myperl.pl; $result = @passthru($command, $status); now my Problem: the perl prints its output immidiatly to the browser and $result is empty after the execution of the perl-script. I needed the output in $result and don't want that the perl script prints to the browser... The whole thing is running on a win2k Server machine. Does someone know what I'm doing wrong? By the way: which number in $status means what? regards Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch --
Re: [PHP] Execute Perl CGI within PHP
It seems I didn't read the descrition of 'exec()' good enough when I read it the first time :( Now it works, thank you From: Krzysztof Kocjan [EMAIL PROTECTED] To: Stefan Rusterholz [EMAIL PROTECTED] See exec() and system functions in PHP Krzysztof Stefan Rusterholz wrote: Hi For some reasons I need to execute a Perl-CGI from within PHP. I tried it that way: $command = C:\\Perl\\bin\\Perl.exe .$basedir.myperl.pl; $result = @passthru($command, $status); now my Problem: the perl prints its output immidiatly to the browser and $result is empty after the execution of the perl-script. I needed the output in $result and don't want that the perl script prints to the browser... The whole thing is running on a win2k Server machine. Does someone know what I'm doing wrong? By the way: which number in $status means what? regards Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- 99% trafien. 1% rezerwy, zeby innym nie bylo przykro. Nowe Centrum Wyszukiwania http://szukaj.interia.pl/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [PHP-INST] Re: [PHP] PHP/CGI problem: #!/path/php at top of CGI script appears in output
Hi @all.. I'm not sure if this can fix (or explain) your problem (cause I didn't tried it in lack of time) but theoretical it could be :). I think you only need the #!/usr/local/bin/php if you would like to run scripts from the bash, or as a real cgi. But I think, there could be another solution .. compile your php as cgi like you did and add these lines in your httpd.conf ScriptAlias /php/ /usr/local/bin/ AddType application/x-httpd-php .php .phtml .cgi Action application/x-httpd-php /php/php This should also launch the cgi - version of php, but doesn't requires the #! line in the scripts. I'm not sure, but it should work. Hope this helps you, Stefan Siefert - Original Message - From: Dave Goodrich [EMAIL PROTECTED] To: Philippe [EMAIL PROTECTED] Cc: php-general [EMAIL PROTECTED]; php-install [EMAIL PROTECTED] Sent: Saturday, October 20, 2001 6:05 PM Subject: [PHP-INST] Re: [PHP] PHP/CGI problem: #!/path/php at top of CGI script appears in output It's not you. I just built a bare cgi version of php, nothing but './configure' and got the same result. I used this simple script to be sure I was in fact running the cgi binary and it showed I was. info.cgi #!/usr/local/bin/php ?php phpinfo(); ? I got the correct info page, but with the #!/usr/local/bin/php at the top as you stated. Odd, but I've never used the cgi version so other than confirming your problem I am afraid I'm no help. DAve On Sat, Oct 20, 2001 at 03:31:06PM +, Philippe wrote: Hi, I'll synthetize the problem with the response I have givven to Curt. I've FreeBSD 4.2/Apache 1.3.9/PHP 4.0.6 I've installed PHP in Apache, it works very well I need to have too PHP 4.0.6 in CGI mode (With Suexec but I don't think it's the problem) but I've a problem. In CGI mode, the path of PHP is always written at the top of the result I'll take for example this script which is in the cgi-bin with the execute mod (755), the extension is .cgi : #!/usr/local/bin/php ? print Hello World; ? When the file is called by the browser, the result is : #!/usr/local/bin/php Hello World Does someone know the problem and the solution ? Have I forgotten something ? I think that's a misconfiguration in PHP Thanks for your help Philippe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- My other computer is your Windows machine... -- PHP Install Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] AW: PHP/CGI problem: #!/path/php at top of CGI script appears in output
Hi, well I do understand your needing. First a question. What are your compile options, e.g. your configure call? Do you use --enable-discard-path ? If not, try this. You need this option to run Phpscripts from cgi-bin folders!!! Greetings, Stefan Siefert -Ursprüngliche Nachricht- Von: Philippe [mailto:[EMAIL PROTECTED]] Gesendet: Sonntag, 21. Oktober 2001 17:53 An: Stefan Siefert; php-general; php-install Betreff: Re: PHP/CGI problem: #!/path/php at top of CGI script appears in output Hi, Thanks Stefan for your answer First, I'll explain why I want to use php in cgi I'ts a simple reason, some users want to use php without safemode (which is required with Apache due to safety problems). So I want to use php in cgi mode with suexec. I've tryed your solution, it works in all non-cgi directory But it doesn't work in cgi directory with suexec or not If I put #/usr/local/bin/php in the script, the script work but we can see #/usr/local/bin/php at the top. If I don't put it, there is an 500 error (Internal Server Error) In error_log, we can see these lines [Sun Oct 21 17:30:10 2001] [error] (8)Exec format error: exec of /home/webbourse/cgi-bin/php.cphp failed [Sun Oct 21 17:30:10 2001] [error] [client 212.103.7.98] Premature end of script headers: /home/webbourse/cgi-bin/php.cphp Someone has an idea Thanks Philippe Stefan Siefert writes: Hi @all.. I'm not sure if this can fix (or explain) your problem (cause I didn't tried it in lack of time) but theoretical it could be :). I think you only need the #!/usr/local/bin/php if you would like to run scripts from the bash, or as a real cgi. But I think, there could be another solution .. compile your php as cgi like you did and add these lines in your httpd.conf ScriptAlias /php/ /usr/local/bin/ AddType application/x-httpd-php .php .phtml .cgi Action application/x-httpd-php /php/php This should also launch the cgi - version of php, but doesn't requires the #! line in the scripts. I'm not sure, but it should work. Hope this helps you, Stefan Siefert - Original Message - From: Dave Goodrich [EMAIL PROTECTED] To: Philippe [EMAIL PROTECTED] Cc: php-general [EMAIL PROTECTED]; php-install [EMAIL PROTECTED] Sent: Saturday, October 20, 2001 6:05 PM Subject: [PHP-INST] Re: [PHP] PHP/CGI problem: #!/path/php at top of CGI script appears in output It's not you. I just built a bare cgi version of php, nothing but './configure' and got the same result. I used this simple script to be sure I was in fact running the cgi binary and it showed I was. info.cgi #!/usr/local/bin/php ?php phpinfo(); ? I got the correct info page, but with the #!/usr/local/bin/php at the top as you stated. Odd, but I've never used the cgi version so other than confirming your problem I am afraid I'm no help. DAve On Sat, Oct 20, 2001 at 03:31:06PM +, Philippe wrote: Hi, I'll synthetize the problem with the response I have givven to Curt. I've FreeBSD 4.2/Apache 1.3.9/PHP 4.0.6 I've installed PHP in Apache, it works very well I need to have too PHP 4.0.6 in CGI mode (With Suexec but I don't think it's the problem) but I've a problem. In CGI mode, the path of PHP is always written at the top of the result I'll take for example this script which is in the cgi-bin with the execute mod (755), the extension is .cgi : #!/usr/local/bin/php ? print Hello World; ? When the file is called by the browser, the result is : #!/usr/local/bin/php Hello World Does someone know the problem and the solution ? Have I forgotten something ? I think that's a misconfiguration in PHP Thanks for your help Philippe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- My other computer is your Windows machine... -- PHP Install Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Update onBlur or onChange
From: KING OGNAJD [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 22, 2001 9:33 AM Subject: [PHP] Update onBlur or onChange Helo: I¹m working on a form that I¹d like to have a feature that adds your total as items are selected. Currently, I¹ve got some javascript doing the job but it only works in ie, and besides, I¹d rather use php if possible. The current prototype form lives at http://www.seatthole.com/order2.php Can anyone tell me if there¹s a way to update the total at the bottom of the page in realtime as the user makes changes? Thanks... Django PHP is a server-side language, which means that it had to be reloaded each time you want to do an update which is not realtime. IMHO that's not that what a user expects because it takes more time to send and reload than to calculate the new price yourself ;-) (as long as you have a poor connection) Two possible solutions: -I think the javascript solution ist the best. I don't see any reason why it doesn't run in Netscape (I didn't look at the code but I know that there is a way to get it work) -Second: Not realtime - total appears after sending it. You can combine this solution with the first to avoid problems with browsers that have JavaScript disabled (I'd recomend that anyway) Regards Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Zipping a folder on a win2000 server with php4.06
Hi Does someone out there know, how I can zip a folder with some files in it? It should be readable for Winzip. Enviroment: Win2000 Server. VB was available if useful. Additional Components (applications, dll's or whatever) could be loaded if needed. I didn't find a usable entry in the manual, so if you tell me to rtfm - please point me to the corresponding entry also :) Thanks in advance Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch --
Re: [PHP] Re: Zipping a folder on a win2000 server with php4.06
Well, I would do that but I don't know such an application. Please, can you suggest me one? Stefan Rusterholz, [EMAIL PROTECTED] - Original Message - From: Julio Nobrega [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 30, 2001 4:40 PM Subject: [PHP] Re: Zipping a folder on a win2000 server with php4.06 Well, you could use exec(); or system(); to call a command line zipping application to compress the directory. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Stefan Rusterholz [EMAIL PROTECTED] wrote in message 003701c1614b$2ab8cc40$3c01a8c0@quasimodo">news:003701c1614b$2ab8cc40$3c01a8c0@quasimodo... Hi Does someone out there know, how I can zip a folder with some files in it? It should be readable for Winzip. Enviroment: Win2000 Server. VB was available if useful. Additional Components (applications, dll's or whatever) could be loaded if needed. I didn't find a usable entry in the manual, so if you tell me to rtfm - please point me to the corresponding entry also :) Thanks in advance Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Zipping a folder on a win2000 server with php4.06
Thank you all. It now works fine! I used the way with the add-on for winzip to make it command line able. There is indeed a command line tool. First it did not want to work at all until I found out, that the trial version of winzip wants the user to press a key (in the command line) to proceed - which I was unable to emulate within php. Luckily I have a registered version of winzip with which this works absolute perfectly. Here a short snippet: $result = @exec($winzip$zip_options $pathToArchive\\archive.zip @$pathToPacklist\\packlist.txt); Where $winzip contains the path to the folder of winzip + wzzip (example: $winzip = 'c:\\program files\\winzip\\wzzip';) $options contains switches for winzip (I used: $zip_options =' -ybc -es'; #-ybc: no interactive interface/all questions are answered with 'yes'; -es: fastest packaging since jpeg can't be packed better) $pathToArchive contains the path to the new file which winzip should create (example: $pathToArchive = 'C:\\') $pathToPacklist contains the path to the folder where the file packlist.txt is, which itself contains a return delimited list of all files to add to the zip (whole filepath is necessary) If someone is interested in that, I can give some additional info's Thank you all for your help! Stefan Rusterholz, [EMAIL PROTECTED] - Original Message - From: Matt Friedman [EMAIL PROTECTED] To: Stefan Rusterholz [EMAIL PROTECTED] Cc: php general [EMAIL PROTECTED] Sent: Wednesday, October 31, 2001 5:39 AM Subject: Re: [PHP] Zipping a folder on a win2000 server with php4.06 There is a command line version of winzip. I don't know much about it, but a friend of mine was just saying the other day that he had used it to zip some files at the server in an ASP environment. In php you could call the winzip exectutable using exec. In asp you'd use some shell object or something like that. Matt. - Original Message - From: Stefan Rusterholz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 30, 2001 8:00 AM Subject: [PHP] Zipping a folder on a win2000 server with php4.06 Hi Does someone out there know, how I can zip a folder with some files in it? It should be readable for Winzip. Enviroment: Win2000 Server. VB was available if useful. Additional Components (applications, dll's or whatever) could be loaded if needed. I didn't find a usable entry in the manual, so if you tell me to rtfm - please point me to the corresponding entry also :) Thanks in advance Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how do I use and lt with eval()?
- Original Message - From: John A. Grant [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 31, 2001 11:51 PM Subject: [PHP] how do I use and lt with eval()? I'm not having an easy time understanding the discussion in the doc for eval(). I want to read this string from a file: xxx ?php somefunc(yyy,3); ? zzz and then run it. I tried this code: ?php function somefunc($text,$n) { for($i=0;$i$n;$i++){ echo $text; } } $string='xxx ?php somefunc(yyy,3); ? zzz'; eval($string); ? but I get Parse error: parse error in eval.php(11) : eval()'d code on line 1 Do I have to use lt; and gt; in place of ? I tried several combinations, but I still get the same error. -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here If you do that this way it looks for php like this: ?php function somefunc($text,$n) { for($i=0;$i$n;$i++){ echo $text; } } #$string='xxx ?php somefunc(yyy,3); ? zzz'; #eval($string); xxx ?php somfunc(yyy,3); ? zzz ? (as someone before correctly stated) As you see, for PHP is some HTML-Code in the php-code-zone. To avoid this, do it that way: ?php function somefunc($text,$n) { for($i=0;$i$n;$i++){ echo $text; } } $string='xxx ?php somefunc(yyy,3); ? zzz'; eval(?$string); ? Pay attention to the trailing ? in eval. That causes php to change to HTML-Mode within the eval'd code. Hope, I could help you Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] File to Download gets requestet twice
I have a small but serious problem: In a webproject of mine a user can select a link to get a compressed archive of files. The system works in this order: 1 -User clicks the link download all 2 -PHP generates the ZIP-compressed file and presents the user the next website with a link File Archive 3 -User clicks the link File Archive 4 -PHP reads the file, deletes it and puts it to the browser Now, where is the problem: some browsers request the link in step 3 a first time and present the user then a dialog Save file to (or something similar) and after that dialog those browsers request the link a second time. But because PHP doesn't know that the browser hasn't really downloaded the file but only presented the user some dialog, it has the file already deleted. So the second time the browser downloads only my error message Download-Link expired. How can I do a workaround? I tried to send a header that it is a .zip file. Didn't work. I tried to send data without header at all. Didn't work. I tried several other stupid things which all didn't work. For some reasons I _have_ to delete the file after beeing downloaded. So I have to either find out if the browser only requested the header but not the file (so I can let it there and don't delete it) or I have to find a way that the browser request that thing only once (which is obviously possible because some IE Versions under Windows encountered no problems with that) Has someone an Idea or a working work-around? Any help would be appreciated... Best regards Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch --
Re: [PHP] PHP Highlighting Text Editors
For UltraEdit I have edited the words file a bit and added PHP as language so that it highlights PHP commands as well. (I haven't included all commands, but a lot) Just if someone is interested, he/she can send me an email with subject UltraEdit Wordfile :-) Stefan Rusterholz, [EMAIL PROTECTED] - Original Message - From: TD - Sales International Holland B.V. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 02, 2001 7:31 PM Subject: [PHP] PHP Highlighting Text Editors Hey there, these are the editors given by you guys, thanks for the replies. If somebody could put this online on php.net it would be great. If you have anything to add please feel free to email me. Windows UltraEdit ActiveState Komodo EditPlus HTML-Kit Homesite Linux/Unix Nedit (x)emacs Visual SlickEdit vim/gvim ActiveState Komodo Beaver Cooledit KWrite (included with KDE, PHP highlighting since KDE 2.2.1 maybe 2.2.0 also haven't used that version 2.1.2 doesn't support PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Problem with non us caracters and strtr
I have little experience with this kind of problem. None of the Browsers I used under mac (IE 4 - 5 and sever NS 4.x) has sent the data different than Windows Browsers. But avoid the meta-tag charset. I had serious problems when the HTML-file where the form data came from had that tag set (but I didn't spend a lot of time investigating it). Anyway: why do you want to translate a ã to an a? I made good experiences with storing original chars and using htmlentities() (or otherway round if you don't have to edit that stuff) Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Rodrigo Peres [EMAIL PROTECTED] To: Yasuo Ohgaki [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, November 02, 2001 2:51 PM Subject: Re: [PHP] Re: Problem with non us caracters and strtr I've tried the recode(), but I think I didn't uderstand it's functionality, since nothing happens. can someone has an idea in how to convert for example a string posted by a form in this format são paulo to this sao paulo?? Does anyone knows how Macintosh's browsers send this special caracteres to PHP??? Thank's again Rodrigo Peres on 11/1/01 9:17 PM, Yasuo Ohgaki at [EMAIL PROTECTED] wrote: Rodrigo Peres wrote: Hi list, I'm in a big trouble. I'm brazilian, so I've made a script to clean up the special caracters from our language in order to not mess up my publisher, but this script don't work in Macintosh (macos 9.1, IE 5, all in american english). This is my code ? function myclean($name) { $name = strtolower(strtr($name, áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ , aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC)); return $name; } $temp = myclean($name_actor); echo($temp); ? What happens is if i try for example to clean up São Paulo it prints são paulo. Why?? The $name will receive a string form a text field in a form. my html charset is iso-8859-1 I think you are better to use recode extension for this. Check out recode manual page. -- Yasuo Ohgaki -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mysql table information
Take a look at that: http://www.mysql.com/doc/S/H/SHOW.html and http://www.mysql.com/doc/D/E/DESCRIBE.html I fear you have to parse necessary information out of a statment like this: $result = mysql_query(DESCRIBE yourTable); $tabelDesc = mysql_fetch_array($result); I didn't spend any time checking it but I think it could work. Good luck! PS: if you make progress with that I was also interested in informations about this kind of stuff - please send a mail :) Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Justin French [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Friday, November 02, 2001 3:02 PM Subject: [PHP] mysql table information hi, i was wondering if anyone has some sample code / links which could help me generate HTML forms dynamically from the fields/types/lengths of tables in a mySQL database. ie, if i had a three column table with first (varchar 50), last (varchar 80) bio (medium text) as the columns, it'd be great if i could use this information about the *table* to build a html form. in otherwords, I could generate an INPUT named first who's max length was 50, annother called last with a maxlength of 80, and a TEXTAREA named bio for the medium text, etc etc. sorry i can't describe it any better!! i guess programs like phpMyAdmin achieve this, but i'd rather see a small code snippet and LEARN rather than dig through 1000's of lines of phpMyAdmin code :) thanks, justin french -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] get names of vars $HTTP_POST_VARS?
RTFM HTTP_POST_VARS is an array, so you can iterate with forach: foreeach($HTTP_POST_VARS as $variableName = $variableValue){ echo PIn Variable $variableName you submitted: .htmlentities($variableValue)./P\n; } For further information go on http://www.php.net, there is a _very_ good documentation. (For this topic look at array functions) Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Vladimir Galkov [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 09, 2001 1:36 PM Subject: [PHP] get names of vars $HTTP_POST_VARS? Good day! Is there any way to get names of vars and values from $HTTP_POST_VARS if I don't know their names and (ofcourse) values? (number can be taken from count($HTTP_POST_VARS) ) ... This is nesesery to write a function wich write log of user's work with remote filesystem. Vladimir Galkov [EMAIL PROTECTED] ICQ 84873967 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Mysql and Images
If I understand you right, then what you want is just impossible. You have to give a source as filepath. You can't put the binary picture data into the same output. What you could is to have a file which calls itself with params telling it to output now the image instead of the html e.g. example.php which produces without given parameters html like HTMLIMG SRC=example.php?showimage=true/HTML You can then check in the example.php file if $showimage is set. if it is set then you call a function to send correct header and binary data and die afterwards (better: exit ;-) But due hold it more simple I would hardly suggest you to have image-output functions in a separate file. You can still use that file for all images in your database If I misunderstood you and you just want a sample code for outputting picture-data then look at this: ?php #make sure that above this line nothing is printed to the browser require(your_mysql_access_routines.php); header(content-type: image/jpg); #replace jpg with gif or png or whatever you want $result = mysql_query(SELECT imageBinaryField FROM imagesTable WHERE id='$id'); #you can give $id as parameter to the file $row = mysql_fetch_array($result); echo $row['imageBinaryField']; #don't print anything below this to the browser ? I hope I could help you Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Rodrigo Peres [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Tuesday, November 13, 2001 3:32 PM Subject: [PHP] Mysql and Images His list, I have some images stores in a mysql database and now i need to recover them to put in a html. My question is there's a way to do this in the same page, I mean, withou the need to buil another php page that process th image? Something like a function that output the image to the img src= in the html. Thank's in advance Rodrigo Peres -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] link to a pdf file
Hi Besides that I think this is the wrong mailing list for dealing with that question: Zip that pdf-file and link to the zipped file. Everything else (AFAIK) won't work because this phenomenon is caused by the client and not by the server. Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Oosten, Sjoerd van [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 16, 2001 11:20 AM Subject: [PHP] link to a pdf file Hello, a question again. I have a pdf file which can be downloaded. How can i link to this file so, that the file isn't opened in the browser (if acrobat reader is installed) but the file download popup appears? Greetings, Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Daemons (was: How to check what country the user is comming from ?)
Can you explain me, how to build a (standalone) daemon or point me to a good tutorial? Thank you for help in advance Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Duncan Hill [EMAIL PROTECTED] To: Fly [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 12:56 PM Subject: Re: [PHP] How to check what country the user is comming from ? On Tue, 20 Nov 2001, Fly wrote: thx Kamil Muszynski Practically, you can't. Technically, you can. Take the IP, run it through whois.arin.net. If that returns apnic, ripe etc, run it through those.. you might get the answer you want. Calls to apnic etc are probably blocking calls - slowing down your page load. Or make this a standalone daemon that feeds a DB. If there are built in PHP commands, I don't know of them. -- Sapere aude My mind not only wanders, it sometimes leaves completely. Never attribute to malice that which can be adequately explained by stupidity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expressions.
I ran into that problem also when I first tried to script with PHP. 1. preg_match(/yourexpression/,$text,$matches); always set the / at beginning and end of the regex (as you did in perl) 2. preg_match(/\[/, this won't match the char [ because of the double-quotes () it escapes the [-char only one-time (don't know how to say that) to get it working as you know it from perl you have to escape it twice: preg_match(/\\[/... 3. AFAIK the pattern-modifier /g is always set! Use the LIMIT parameter to avoid /g there have been some more problems during my transition, but I don't remember all of them... read the user comments on the documention on php.net, they are very helpful hope I could help Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Jeff Lewis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 2:37 PM Subject: [PHP] Regular Expressions. I'm trying to port over some Perl to PHP and have come to a string of regular expressions like this. There are probably 30 of them: $message =~ s~\[color=([\w#]+)\](.*?)\[/color\]~font color=$1$2/font~isg; $message =~ s~\[black\](.*?)\[/black\]~font color=00$1/font~isg; $message =~ s~\[white\](.*?)\[/white\]~font color=FF$1/font~isg; How can I accomplish the same in PHP? $message = preg_match (\[color=([\w#]+)\](.*?)\[/color\], font color=$1$2/font) I was thinking that is how it would be done but I am getting errors. Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Display Problemo
I see 2 possibilities to go and 1 warning: 1th way to go: you insert another field into your db called originalCode for example where you insert the code also but don't modify it at all. If someone wants to download the code you fetch the code from that field 2th way to go: you stay with only 1 field holding the code snippet and you don't change the code when inserting but you use nl2br when displaying. Needs a bit more processing time (I don't think it's a lot) but needs less disk space than 1th way warning: don't try to get rid of BR tags or other things afterwards because you could run into unsolvable problems (what when a coder has BR in his code? You could destroy it!) I hope I could help Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: Lerp [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 5:27 PM Subject: [PHP] Display Problemo I have a small php app that I'm building to display, insert, edit, etc... various types of code snipits (asp, php, html, etc...) in a db. I also have a download option that creates a text file with the code that they've selected. I have 2 problems...the first is that when I go to view the text file I have all sorts of BR tags within the text, this is due to the nl2br function I used prior to the db insertion. How would I get rid of those? The seond problem is when a user goes to view an html code example on the webpage, say with a hyperlink, the hyperlink is made active replacing the code with the actual a href tag. Thx in advance, Lerp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] exec() help
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 21, 2001 2:37 PM Subject: [PHP] exec() help Hi, I am running the following function in my PHP script: exec(/usr/local/bin/wget http://www.getresponse.com/cgi-bin/add.cgi?misc=1ref=001category1=trtipsc at egory2=acategory3=.$Grab[2][$i].)or die (Error); It is run inside an if loop and $Grab[2][$i] contains an e-mail address. However it always returns an error and I cannot figure out why, any ideas?? What error? What does it tell you? Why don't you use fopen or fsockopen which are implemented in PHP instead of doing probably dangerous exec()? best regards Stefan Rusterholz TIA Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Global storage of objects.
I would like to know if there is a way to store objects globally from a php-page, so that the object can be used from another page. /Stefan B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Global storage of objects.
Your suggestion is as far as I got on my own... ;-=) What I want is to keep the object in memory, and not have to read data from disk the next time I need the object. I cant use cookies, since the object should be avaliable to more than one user. (Global, as I said in my first post.) The object can be pretty large, too. Since I come from the Java/JSP-world, what I am trying to find is something that corresponds to : pageContext.setAttribute(key, object, PageContext.APPLICATION_SCOPE); This will store object under the name key, being avaliable from anywhere in the JSP-environment. Poor man's cache, that is. /Stefan Jani Mikkonen wrote: I would like to know if there is a way to store objects globally from a php-page, so that the object can be used from another page. Keyword is Serialization. If you save object to flatfile or to db, i dont see any point why the result wouldnt be accessible from other places (providing that those other places do have access to same datesource) More info can be found @ http://www.php.net/manual/en/language.oop.serialization.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to set file extension php Mac OSX and PHP 4.0.6
- Original Message - From: Erik Price [EMAIL PROTECTED] To: René Fournier [EMAIL PROTECTED] Cc: Michael B. Weiner [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, December 03, 2001 4:23 PM Subject: Re: [PHP] How to set file extension php Mac OSX and PHP 4.0.6 I don't think that Sherlock can recognize any file in the /etc directories. If you never use Terminal, then Sherlock is okay, but if you do stuff in the Terminal then you are working in levels of your computer that Apple has decided to hide from most users. The /etc directory is one example of this. For searches of the hard drive outside of the Apple-approved Sherlock-searchable directories, read the man page for find. In your case, the file is probably located at /etc/httpd/httd.conf. Open this file in pico or emacs, but be sure to use sudo emacs /etc/httpd/httpd.conf if you are not logged in as root because it is not writeable by normal users. or use locate (you will have to set up the database first). You should be able to find a tool called Locator on www.versiontracker.com which provides a GUI for locate (although I'd rather use it in terminal). AND: Sherlock WILL find the files in /etc if you search for invisible files. But unfortunately drag drop doesn't work for those files and displayed filepath seems to be wrong (they are always displayed with a path like yourharddisk/filename) and another tipp for you: use BBedit (again available at versiontracker.com or www.barebones.com - for free) if you don't like terminal apps. It has a point Open hidden... below the menu File with which you can easily open and edit the httpd.conf (as erik said it is normally located under /etc/httpd/httpd.conf) . BBedit will probably tell you that you haven't appropriate rights to edit and save the file - log out and log in as root again (or chown/chmod the file). Erik Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- On Sunday, December 2, 2001, at 04:15 PM, René Fournier wrote: OK, that makes sense--that's what I did under WinME. The only problem is that I can't seem to find the httpd.conf file anywhere. At least, Sherlock is not returning any results. Do you know which directory httpd.conf is in? ...Rene On Sunday, December 2, 2001, at 01:56 PM, Michael B. Weiner wrote: modify the apache configuration file (i.e. httpd.conf) and add it as and AddType, as in the following: AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps HTH -- René Fournier wrote: I have successfully installed PHP 4.0.6, and it works! Only problem is that Apache only sends files to the PHP module that have a .php extension. However, I need to name the files .php4 (long story). As it stands, all I see is the actual PHP source, not the output. Does anyone know how I can change Apache and/or the PHP module to recognize .php4 files and execute them as such? Thanks. ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie alert
If you use Dreamweaver under MacOS I suggest to take a look at BBedit from BareBones (www.versiontracker.com or www.barebones.com). Under Windows I currently use UltraEdit which fits quite fine but needed a few changes to the wordlist.txt which is responsible for syntax-highlighting (if you want that changes just mail me). Another valuable tool is proton - unfortunately I don't have any links for those two. but dreamweaver is IMHO a good chose for itself (using it's built-in code-editor). I myself prefer working on BBedit only (without using dreamweaver). At Job I have to work on a windows machine where I prefere to use UltraEdit. happy coding Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: shaun murphy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 11:25 AM Subject: [PHP] PHP newbie alert Hello! Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] CURL functions
Hey, I'm trying to use CURL for sending some headers to paypal. Can anyone tell me why this code below doesn't work as expected??? $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,https://www.paypal.com/cgi-bin/webscr;); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, cmd=_cartupdate=Update$vard=1); curl_exec ($ch); curl_close ($ch); PS: $vard is defined. Thanks in advance Stefan - Romania -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]