php-general Digest 18 Feb 2012 05:16:21 -0000 Issue 7694
php-general Digest 18 Feb 2012 05:16:21 - Issue 7694 Topics (messages 316710 through 316723): Re: basic captcha 316710 by: Donovan Brooke 316711 by: Donovan Brooke 316712 by: Donovan Brooke 316719 by: Geoff Shang Re: html_entity_decode is trying to kill me 316713 by: Matijn Woudt 316714 by: Marc Guay 316715 by: Marc Guay 316716 by: HallMarc Websites Re: Do an LDAP Password Modify Extended Operation? 316717 by: Mike Mackintosh 316718 by: Kirk.Johnson.zootweb.com 316722 by: Mike Mackintosh Wrong POSTFIELDS Posted 316720 by: Brian Smither 316721 by: Marco Behnke Re: ASP to PHP 316723 by: Brian Smither Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Savetheinternet wrote: [snip] There are plenty of free PHP captcha scripts out there. Just google captcha PHP. Securimage (phpcaptcha.org) looks relatively okay. Thanks, Michael Hi Michael, this looked promising.. however, requires some GD support it appears I don't have.. here is the results of their test file: GD Support: Yes! GD Version: bundled (2.0.34 compatible) imageftbbox function: No The imageftbbox() function is not included with your gd build. This function is required. TTF Support (FreeType): No No FreeType support. You cannot use Securimage 3.0, but can use 2.0 with gd fonts. JPEG Support: Yes! PNG Support: Yes! GIF Read Support: Yes! GIF Create Support: Yes! --- Will keep looking I guess. Thx. Donovan -- D Brooke ---End Message--- ---BeginMessage--- Donovan Brooke wrote: [snip] Hi Michael, this looked promising.. however, requires some GD support it appears I don't have.[snip] Hi, well, just did the test on the live server and it *does* support it there.. so I guess I use it.. just won't work in the development enviro. Thanks for the suggestion! Donovan -- D Brooke ---End Message--- ---BeginMessage--- Ashley Sheridan wrote: [snip] Well, if the answer doesn't matter, another could just pick anything and run with it couldn't they? Thanks, Ash For the favorite color thing? The idea would be to require one (but not all) of the word options in the list (so answer does matter)... most bots would not be able to deal with that.. however, like I said, not fool proof (and not recommended for sensitive purposes). ;-) Donovan -- D Brooke ---End Message--- ---BeginMessage--- On Fri, 17 Feb 2012, Ashley Sheridan wrote: I would avoid making a user type in something they see in a picture, as you've just succeeded in pissing off a bunch of blind people. Thank you! Glad someone pointed this out so I didn't have to. And if you use a system like Recaptcha which has an audio option, you've still locked out deafblind users. Also, avoid relying on javascript. It can be turned off, disabled, blocked and sometimes isn't available at all, such as with some speech/Braille browsers. Or lynx. Yes I'm a blind person, but even a person who isn't may want to use it quickly from a shell to get something done. One popular route is to ask a question that only a human could answer. I use this method on the contact page of my site. I just ask a question such as Multiply the number of heads a person has by the number of legs on 2 dogs. It's easy for a human, but requires context, something a bot can't do effectively. Since the person was looking for a ready-made solution, I'd like to recommend TextCaptcha.com. It claims to have 180,243,205 easy questions, and even has an article on ways to avoid needing a CAPTCHA in the first place. I once (and only once) struck a test like this on a New Zealand government website. I nearly died of shock. And I was able to use it with lynx with no problems at all. Geoff. ---End Message--- ---BeginMessage--- On Fri, Feb 17, 2012 at 5:00 PM, Marc Guay marc.g...@gmail.com wrote: Hi, So I decided to give one of those PHP math classes a go and have come across a joyful character encoding problem. He's the deal: $rule = 1 lt; 2; $rule = html_entity_decode($rule, ENT_QUOTES, 'UTF-8'); echo $rule; And the result is still 1 lt; 2. I've tried different combinations of character encodings and quotings, to no avail. Any ideas of where I should look for the culprit? Marc This piece of code is working perfectly fine on my Ubuntu PHP 5.3.6. (I get 1 2 ). Can you post some information about your system, eg PHP version, Apache version, Operating System, OS language? - Matijn ---End Message--- ---BeginMessage--- It actually works for me as well if I run it in the
[PHP] Re: problems in extension development
Besides, are there some APIs I can use if I want to setget environment variables like DOCUMENT_ROOT in my extension(similar to sapi_cgienv_get/set). Thanks! 2012/2/17 Rui Hu tchrb...@gmail.com hi, I just started to write a simple PHP extension hello, but encountered some problems. I followed tutorials step by step: 1. ./ext_skel --extname=hello 2. modified hello.c and php_hello.h, and wrote function hello_world() which simply return a string hello world. 3. phpize 4. ./configure ; make ; 5. the I encountered error in make. I looked up in Makefile and found that $(PHP_MODULE) is null, which I think is the reason. Makefile is automatically generated by ./configure. What mistake did I make? How to fix it? Thanks! Vic Hu -- Best regards, Rui Hu State Key Laboratory of Networking Switching Technology Beijing University of Posts and Telecommunications(BUPT) MSN: tchrb...@gmail.com - -- Best regards, Rui Hu State Key Laboratory of Networking Switching Technology Beijing University of Posts and Telecommunications(BUPT) MSN: tchrb...@gmail.com -
Re: [PHP] pathinfo or other
Hi, All I do not remember where I found the list of variables that are provided if you load PHP using Apache, nginx, IIS ... Fact is that there's a list of variables in the CGI 1.1 definition that should be given to a cgi script: http://tools.ietf.org/html/rfc3875#section-4 PATH_INFO is on the list and therewith should at least be given to every cgi-script. As not all web-server are fully compatible to the definition or do not support cgi 1.1 there are quite much posts where you find work-arounds for misconfiguration web-servers. I know about nginx that you have to add a special configuration to get the path_info - but the example provided at the developers-page sometimes returns a wrong value. See: http://stackoverflow.com/questions/8265941/empty-value-to-path-info-in-nginx-returns-junk-value/ Maybe there are also some other known issues around this PATH_INFO ... Here's a request for a portable way to receive the path-info even if it's not provided by the web-server: http://stackoverflow.com/questions/1884041/portable-and-safe-way-to-get-path-info I've always tried to use something like mod_rewrite and manage all incoming requests in an own dispatcher. That helped me a lot getting around this problems. Hope that this gives you more detailed information in what you need. Bye Simon 2012/2/17 Donovan Brooke li...@euca.us Elbert F wrote: SCRIPT_NAME is a server side path, try REQUEST_URI. This includes the query string but it's easy to remove. Elbert http://swiftlet.org Hi, I thought I should say that server side SCRIPT_NAME seems to be fine for me in this case. Thanks for the input. Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pathinfo or other
Hi, Just to also add the discussion why mod_rewrite or PATH_INFO :) http://stackoverflow.com/questions/1565292/mod-rewrite-or-path-info-for-clean-urls Bye Simon 2012/2/17 Simon Schick simonsimc...@googlemail.com Hi, All I do not remember where I found the list of variables that are provided if you load PHP using Apache, nginx, IIS ... Fact is that there's a list of variables in the CGI 1.1 definition that should be given to a cgi script: http://tools.ietf.org/html/rfc3875#section-4 PATH_INFO is on the list and therewith should at least be given to every cgi-script. As not all web-server are fully compatible to the definition or do not support cgi 1.1 there are quite much posts where you find work-arounds for misconfiguration web-servers. I know about nginx that you have to add a special configuration to get the path_info - but the example provided at the developers-page sometimes returns a wrong value. See: http://stackoverflow.com/questions/8265941/empty-value-to-path-info-in-nginx-returns-junk-value/ Maybe there are also some other known issues around this PATH_INFO ... Here's a request for a portable way to receive the path-info even if it's not provided by the web-server: http://stackoverflow.com/questions/1884041/portable-and-safe-way-to-get-path-info I've always tried to use something like mod_rewrite and manage all incoming requests in an own dispatcher. That helped me a lot getting around this problems. Hope that this gives you more detailed information in what you need. Bye Simon 2012/2/17 Donovan Brooke li...@euca.us Elbert F wrote: SCRIPT_NAME is a server side path, try REQUEST_URI. This includes the query string but it's easy to remove. Elbert http://swiftlet.org Hi, I thought I should say that server side SCRIPT_NAME seems to be fine for me in this case. Thanks for the input. Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic captcha
Simon Schick simonsimc...@googlemail.com wrote: Hi, all When you ask for a captcha, I'd first ask what do you want to use it for. If you read the first lines of Wikipedia it has been developed to differ between a real user and a bot. If you'd now say that you want to use it to protect spam in a formula I'd give you the same explanation that you can find here in german (in a bit more text): http://www.1ngo.de/web/captcha-spam.html The author of this link says that captchas are not efficient enough and give a new unnecessary barrier to all users. He also declaims that bots nowadays are better than ever and can even read captchas that many humans are not able to read. For this reason he provides a list of extra stuff that you can use to protect your formula against spam instead of a picture that's text should be written in an input-field. One of those is the honey-pot. You simply create an additional field (f.e. * email2*) hide it for most visitors (using *css*) and ignore the comment if there's text in here. As most of the bots cannot read css they'll fill a valid email-address in here :) But then you also have to think about users that have css disabled f.e. *ScreenReader*. Another disadvantage of this issue is that you can use an auto-field-fill mechanism provided by the browser who could fill this field ... But both cases should not be that difficult. For the screenreder you can change the label for the field to look like *Do not paste your email in here. Just leave it empty.* Just to have the word email again in here ;) Another good thing is to think about how fast this form can be submitted when the user enters the formula for the first time. Also think about the second time, when the user as entered some wrong values and you have to show him a message. If you have a formula that contains more than 5 fields it's quite unusual that the user can submit that below 2 sec after receiving the response. You could even add a feature by using javascript that the user cannot submit this form or his request will be delayed for a view seconds (one or two). If you want to know more about that, out there are plenty of plugins for different systems where you can see what other possibilities you have. One extension i like is the one from TYPO3. They have quite a bunch of such things and you can give each of the checks a value. If the sum of the values of the failing tests reaches a configured level, this form-submission will be rejected. http://typo3.org/extensions/repository/view/wt_spamshield/current/ Wordpress: http://antispambee.de/ Bye Simon 2012/2/17 Savetheinternet savetheinter...@tinyboard.org On Fri, Feb 17, 2012 at 3:40 PM, Donovan Brooke li...@euca.us wrote: Hello, Does anyone know of a basic (open source or freeware) form captcha system for PHP? TIA, Donovan -- D Brooke Hi, There are plenty of free PHP captcha scripts out there. Just google captcha PHP. Securimage (phpcaptcha.org) looks relatively okay. Thanks, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I would avoid making a user type in something they see in a picture, as you've just succeeded in pissing off a bunch of blind people. Also, avoid relying on javascript. It can be turned off, disabled, blocked and sometimes isn't available at all, such as with some speech/Braille browsers. One popular route is to ask a question that only a human could answer. I use this method on the contact page of my site. I just ask a question such as Multiply the number of heads a person has by the number of legs on 2 dogs. It's easy for a human, but requires context, something a bot can't do effectively. Thanks, Ash http://ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to execute Exe file in system
On Fri, Feb 17, 2012 at 1:26 PM, Negin Nickparsa nickpa...@gmail.comwrote: I have a Gams application http://interfaces.gams-software.com/doku.php?id=env%3aspawning_gams_from_php which I want to run it through php code after trying many things finally I found that for running in commmand line I should go to C:\Program Files\GAMS23.7 run a command in commandline for running the application as follows: gams.exe trnsport_php.gms the Gams wil be run successfully in commandline now I wanted to run it in php I added an alias with this path C:\Program Files\GAMS23.7 and then I created my php file in there when I want to exacute it with this code in php: if(system('gams.exe trnsport_php.gms')) echo 'Not Error'; else echo'Error'; it shows me Error and again using this one: if(system('./gams.exe trnsport_php.gms')) echo 'Not Error'; else echo'Error'; has printed again Error I tried exec too but no result I don't know what is wrong here. I read the manual but I coudn't find what's wrong here echo system('dir') will show the files of C:\Program Files\GAMS23.7 have you tried using shell_exec with full path rather than including its executation path? $out = shell_exec('/var/www/myapp/run arg1 arg2');
Re: [PHP] how to execute Exe file in system
I am in windows yeah I tried this one if(shell_exec('C:\Program Files\GAMS23.7\gams.exe trnsport_php.gms')) echo 'yes' ; else echo 'no'; it wil show me no my another try: if(shell_exec('cd C:\Program Files\GAMS23.7') ) echo 'yes'; else echo 'no'; it will show me No again I even can't run CD command why?
Re: [PHP] how to execute Exe file in system
Negin Nickparsa nickpa...@gmail.com hat am 17. Februar 2012 um 12:26 geschrieben: if(system('gams.exe trnsport_php.gms')) echo 'Not Error'; else echo'Error'; it shows me Error system() Returns the last line of the command output on success, and FALSE on failure. So, lets assume your gams program does not fail but prints nothing, the output is empty. By simply checking if (system(...)) you will get echo 'Error'; even if everything is fine, but nothing is print. Try checking on FALSE if (($out = system(...)) !== FALSE) { print('Not error'); printf('Output is %s', $out); } else { print('Error'); } Besides: I would prefer setting the complete path to your exe-file. if (system('C:\\PATH\\TO\\MY\\gams.exe trnsport_php.gms')) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to execute Exe file in system
yes it prints nothing by this code if (($out = system('C:\Program Files\GAMS23.7\gams.exe trnsport_php.gms')) !== FALSE) { print('Not error'); printf('Output is %s', $out); } else { print('Error'); }
Re: [PHP] how to execute Exe file in system
give the full path of trnsport_php.gms too. shell_exec should be working fine on windows as well.
Re: [PHP] how to execute Exe file in system
I don't know what is going here!? well it shows no error but the out put is nothing and my gams when running should make a text file but by running,it doesn't happen so It has problem
Re: [PHP] how to execute Exe file in system
Try to write full path to executable file and don't forget to bring double quote to that path. It must because Program files contain space and php think your program is Program that contain parameter files. if(system(' C:\Program Files\GAMS23.7\gams.exe trnsport_php.gms') On Fri, Feb 17, 2012 at 6:26 PM, Negin Nickparsa nickpa...@gmail.com wrote: I have a Gams applicationhttp://interfaces.gams-software.com/doku.php?id=env%3aspawning_gams_from_php which I want to run it through php code after trying many things finally I found that for running in commmand line I should go to C:\Program Files\GAMS23.7 run a command in commandline for running the application as follows: gams.exe trnsport_php.gms the Gams wil be run successfully in commandline now I wanted to run it in php I added an alias with this path C:\Program Files\GAMS23.7 and then I created my php file in there when I want to exacute it with this code in php: if(system('gams.exe trnsport_php.gms')) echo 'Not Error'; else echo'Error'; it shows me Error and again using this one: if(system('./gams.exe trnsport_php.gms')) echo 'Not Error'; else echo'Error'; has printed again Error I tried exec too but no result I don't know what is wrong here. I read the manual but I coudn't find what's wrong here echo system('dir') will show the files of C:\Program Files\GAMS23.7 -- Duken Marga -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic captcha
Hei, Ashley The php bugtracker himself uses just simple math. Others are made by clicking on the man's name in the picture (3 shaddows of people with names in there) ... But I myself dislike the visitor having extra-work. Therefore I'll stick to the honey-pot the referer check and so on. One check I think is quite effective is something google does for discovering spam-mail: Discover which language this mail is written in. If it does not seem to be a lanuage at all its most likely spam ;) But I think that's not possible for not-so-big websites .. Anyways: most likely it's just about filtering the 99% spam and get all user-mails through. Nothing is more annoying as when you (as user) get the feedback *Go away! You're a bot.* ;) Bye Simon 2012/2/17 Ashley Sheridan a...@ashleysheridan.co.uk Simon Schick simonsimc...@googlemail.com wrote: Hi, all When you ask for a captcha, I'd first ask what do you want to use it for. If you read the first lines of Wikipedia it has been developed to differ between a real user and a bot. If you'd now say that you want to use it to protect spam in a formula I'd give you the same explanation that you can find here in german (in a bit more text): http://www.1ngo.de/web/captcha-spam.html The author of this link says that captchas are not efficient enough and give a new unnecessary barrier to all users. He also declaims that bots nowadays are better than ever and can even read captchas that many humans are not able to read. For this reason he provides a list of extra stuff that you can use to protect your formula against spam instead of a picture that's text should be written in an input-field. One of those is the honey-pot. You simply create an additional field (f.e. * email2*) hide it for most visitors (using *css*) and ignore the comment if there's text in here. As most of the bots cannot read css they'll fill a valid email-address in here :) But then you also have to think about users that have css disabled f.e. *ScreenReader*. Another disadvantage of this issue is that you can use an auto-field-fill mechanism provided by the browser who could fill this field ... But both cases should not be that difficult. For the screenreder you can change the label for the field to look like *Do not paste your email in here. Just leave it empty.* Just to have the word email again in here ;) Another good thing is to think about how fast this form can be submitted when the user enters the formula for the first time. Also think about the second time, when the user as entered some wrong values and you have to show him a message. If you have a formula that contains more than 5 fields it's quite unusual that the user can submit that below 2 sec after receiving the response. You could even add a feature by using javascript that the user cannot submit this form or his request will be delayed for a view seconds (one or two). If you want to know more about that, out there are plenty of plugins for different systems where you can see what other possibilities you have. One extension i like is the one from TYPO3. They have quite a bunch of such things and you can give each of the checks a value. If the sum of the values of the failing tests reaches a configured level, this form-submission will be rejected. http://typo3.org/extensions/repository/view/wt_spamshield/current/ Wordpress: http://antispambee.de/ Bye Simon 2012/2/17 Savetheinternet savetheinter...@tinyboard.org On Fri, Feb 17, 2012 at 3:40 PM, Donovan Brooke li...@euca.us wrote: Hello, Does anyone know of a basic (open source or freeware) form captcha system for PHP? TIA, Donovan -- D Brooke Hi, There are plenty of free PHP captcha scripts out there. Just google captcha PHP. Securimage (phpcaptcha.org) looks relatively okay. Thanks, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I would avoid making a user type in something they see in a picture, as you've just succeeded in pissing off a bunch of blind people. Also, avoid relying on javascript. It can be turned off, disabled, blocked and sometimes isn't available at all, such as with some speech/Braille browsers. One popular route is to ask a question that only a human could answer. I use this method on the contact page of my site. I just ask a question such as Multiply the number of heads a person has by the number of legs on 2 dogs. It's easy for a human, but requires context, something a bot can't do effectively. Thanks, Ash http://ashleysheridan.co.uk
Re: [PHP] how to execute Exe file in system
replace \ in path with / then should work fine on windows too.
Re: [PHP] how to execute Exe file in system
if (($out = system(' C:/Program Files/GAMS23.7/gams.exe C:/Program Files/GAMS23.7/trnsport_php.gms')) !== FALSE) { print('Not error!'); printf('Output is %s', $out); } else { print('Error'); } Fatih it shows again nothing why I should set the full path even when I run my file on the path I don't think so that it is needed I don't know how to work with these quotations was it right Duken?
Re: [PHP] how to execute Exe file in system
On 17 Feb 2012, at 12:12, Negin Nickparsa wrote: if (($out = system(' C:/Program Files/GAMS23.7/gams.exe C:/Program Files/GAMS23.7/trnsport_php.gms')) !== FALSE) { print('Not error!'); printf('Output is %s', $out); } else { print('Error'); } Fatih it shows again nothing why I should set the full path even when I run my file on the path I don't think so that it is needed I don't know how to work with these quotations was it right Duken? * Use back ticks to get the full output. * Use escapeshellcmd and escapeshellarg to ensure the command is built in a safe and valid way. * Redirect stderr to stdout using 21 so you see any error messages that are being generated. $cmd = escapeshellcmd('C:/Program Files/GAMS23.7/gams.exe').' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; $out = `$cmd`; var_dump($out); Try that, then you can build logic that checks the output for errors. You may also want to make sure that safe_mode is disabled, though I doubt that's the problem. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
It generates NULL
Re: [PHP] how to execute Exe file in system
I changed it to this one: $out = $cmd; now it shows string(85) C:/Program Files/GAMS23.7/gams.exe C:/Program Files/GAMS23.7/trnsport_php.gms 21
Re: [PHP] how to execute Exe file in system
On Fri, Feb 17, 2012 at 2:19 PM, Stuart Dallas stu...@3ft9.com wrote: On 17 Feb 2012, at 12:12, Negin Nickparsa wrote: if (($out = system(' C:/Program Files/GAMS23.7/gams.exe C:/Program Files/GAMS23.7/trnsport_php.gms')) !== FALSE) { print('Not error!'); printf('Output is %s', $out); } else { print('Error'); } Fatih it shows again nothing why I should set the full path even when I run my file on the path I don't think so that it is needed I don't know how to work with these quotations was it right Duken? * Use back ticks to get the full output. * Use escapeshellcmd and escapeshellarg to ensure the command is built in a safe and valid way. * Redirect stderr to stdout using 21 so you see any error messages that are being generated. $cmd = escapeshellcmd('C:/Program Files/GAMS23.7/gams.exe').' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; $out = `$cmd`; var_dump($out); Try that, then you can build logic that checks the output for errors. You may also want to make sure that safe_mode is disabled, though I doubt that's the problem. -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ it is espacing issue as Stuart stated.. try this one thats working for me with spaces //$out = shell_exec(\C:/Program Files/tws_date.exe\); tws_date is c program prints date. nothing special $out = shell_exec(\C:/Program Files/GAMS23.7/gams.exe\ \C:/Program Files/GAMS23.7/trnsport_php.gms\); if ($out) { echo OK: . $out; } else { echo ERROR; } var_dump($out);
Re: [PHP] how to execute Exe file in system
Apache
Re: [PHP] how to execute Exe file in system
I think it's wrong: system(' C:/Program Files/GAMS23.7/gams.exe C:/Program Files/GAMS23.7/trnsport_php.gms')) Instead, try this: system(' C:/Program Files/GAMS23.7/gams.exe C:/Program Files/GAMS23.7/trnsport_php.gms ')) It is a good practice to write full path because we don't know behaviour any operating system we use when we just use simple name. On Fri, Feb 17, 2012 at 7:12 PM, Negin Nickparsa nickpa...@gmail.com wrote: if (($out = system(' C:/Program Files/GAMS23.7/gams.exe C:/Program Files/GAMS23.7/trnsport_php.gms')) !== FALSE) { print('Not error!'); printf('Output is %s', $out); } else { print('Error'); } Fatih it shows again nothing why I should set the full path even when I run my file on the path I don't think so that it is needed I don't know how to work with these quotations was it right Duken? -- Duken Marga -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic captcha
On Feb 17, 2012, at 12:36 AM, Patrick Hafner wrote: Hi, have you tried reCAPTCHA by Google? You can find the PHP library on the website. Easy to use, customizable and free, but nothing to install on your server (no open source) But it aid OCR to Text activities at google and all libraries and educational institutions but enlisting humans to translate undecipherable scanned words. Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to execute Exe file in system
Duken how you use and again another without a dot? I tried yours it says: *Warning*: system() [function.system http://localhost/gams/function.system]: Cannot execute a blank command in *C:\Program Files\GAMS23.7\calling_gams.php* on line *23* Error
Re: [PHP] how to execute Exe file in system
stuart $out = `$cmd`; what it will do? what is `? I didn't ever seen it
Re: [PHP] how to execute Exe file in system
backtick operator ( http://www.php.net/manual/en/language.operators.execution.php) works like shell_exec() On 17 February 2012 18:00, Negin Nickparsa nickpa...@gmail.com wrote: stuart $out = `$cmd`; what it will do? what is `? I didn't ever seen it
Re: [PHP] how to execute Exe file in system
Fatih it shows this: ERRORNULL maybe program Files which has space should have something like \ which I don't know ha? or because of Null It is correct?
Re: [PHP] how to execute Exe file in system
ow! Thanks I got Stuart meaning Now
Re: [PHP] how to execute Exe file in system
Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
Oops no! it shows this one: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
Stuart I changed it to this one:$cmd = 'C:/Program\\Files/ Now it tells: string(43) The system cannot find the path specified. On Fri, Feb 17, 2012 at 4:12 PM, Negin Nickparsa nickpa...@gmail.comwrote: Oops no! it shows this one: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
[PHP] ASP to PHP
I think I've already decided how to handle this, but I thought it's worth asking. I've inherited some fairly static .asp sites which are being hosted on a windows server and to tidy things up I'm looking to 'move' them to one of the linux boxes. My Initial thought is simply to clone the working site and add back in any functionality that I need. None of them are dynamic ( those are alreay on PHP :) ) so at least static html will be easier to maintain than the .asp code. But has anybody had any experience of translating the asp code over? ( I'm also playing with asp2php at the moment :) ) -- Lester Caine - G8HFL - Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to execute Exe file in system
On 17 Feb 2012, at 12:42, Negin Nickparsa wrote: Oops no! it shows this one: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.com wrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Ok, in that case try \\\ instead of \. Alternatively move GAMS23.7 out of Program Files and into a directory without spaces! Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.com wrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
I can't move Gams because it has many dll files which should be in there. gams.exe should be execute in that path file in program Files one time I tried to do it and when It shows me missing files I copy pasted many files but It needs many other files which I regretted so it is not possible. I tried \\\ string(101) 'C:/Program\\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:25 PM, Stuart Dallas stu...@3ft9.com wrote: On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Ok, in that case try \\\ instead of \. Alternatively move GAMS23.7 out of Program Files and into a directory without spaces! Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
I read about The useless command may be like c: or cd. Example: system('c: C:\Program Files\... parameter 1 parameter 2'); exec('c: C:\Program Files\... parameter 1 parameter 2'); in php manual But I didn't know how to work with it It doesn't use any back slashes On Fri, Feb 17, 2012 at 4:29 PM, Negin Nickparsa nickpa...@gmail.comwrote: I can't move Gams because it has many dll files which should be in there. gams.exe should be execute in that path file in program Files one time I tried to do it and when It shows me missing files I copy pasted many files but It needs many other files which I regretted so it is not possible. I tried \\\ string(101) 'C:/Program\\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:25 PM, Stuart Dallas stu...@3ft9.com wrote: On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Ok, in that case try \\\ instead of \. Alternatively move GAMS23.7 out of Program Files and into a directory without spaces! Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
and this One system (\c:\\program files\\myapp\\myapp.exe\ params_for_myapp); On Fri, Feb 17, 2012 at 4:36 PM, Negin Nickparsa nickpa...@gmail.comwrote: I read about The useless command may be like c: or cd. Example: system('c: C:\Program Files\... parameter 1 parameter 2'); exec('c: C:\Program Files\... parameter 1 parameter 2'); in php manual But I didn't know how to work with it It doesn't use any back slashes On Fri, Feb 17, 2012 at 4:29 PM, Negin Nickparsa nickpa...@gmail.comwrote: I can't move Gams because it has many dll files which should be in there. gams.exe should be execute in that path file in program Files one time I tried to do it and when It shows me missing files I copy pasted many files but It needs many other files which I regretted so it is not possible. I tried \\\ string(101) 'C:/Program\\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:25 PM, Stuart Dallas stu...@3ft9.com wrote: On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Ok, in that case try \\\ instead of \. Alternatively move GAMS23.7 out of Program Files and into a directory without spaces! Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.comwrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
$cmd = system (\C:\\Program Files\\GAMS23.7\\gams.exe\ trnsport_php.gms); $out = `$cmd`; var_dump($out); It shows NULL On Fri, Feb 17, 2012 at 4:38 PM, Negin Nickparsa nickpa...@gmail.comwrote: and this One system (\c:\\program files\\myapp\\myapp.exe\ params_for_myapp); On Fri, Feb 17, 2012 at 4:36 PM, Negin Nickparsa nickpa...@gmail.comwrote: I read about The useless command may be like c: or cd. Example: system('c: C:\Program Files\... parameter 1 parameter 2'); exec('c: C:\Program Files\... parameter 1 parameter 2'); in php manual But I didn't know how to work with it It doesn't use any back slashes On Fri, Feb 17, 2012 at 4:29 PM, Negin Nickparsa nickpa...@gmail.comwrote: I can't move Gams because it has many dll files which should be in there. gams.exe should be execute in that path file in program Files one time I tried to do it and when It shows me missing files I copy pasted many files but It needs many other files which I regretted so it is not possible. I tried \\\ string(101) 'C:/Program\\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:25 PM, Stuart Dallas stu...@3ft9.com wrote: On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Ok, in that case try \\\ instead of \. Alternatively move GAMS23.7 out of Program Files and into a directory without spaces! Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.comwrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
C:\/Program\ Files\\... --C Negin Nickparsa wrote: I can't move Gams because it has many dll files which should be in there. gams.exe should be execute in that path file in program Files one time I tried to do it and when It shows me missing files I copy pasted many files but It needs many other files which I regretted so it is not possible. I tried \\\ string(101) 'C:/Program\\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:25 PM, Stuart Dallas stu...@3ft9.com wrote: On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Ok, in that case try \\\ instead of \. Alternatively move GAMS23.7 out of Program Files and into a directory without spaces! Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try thisâeuro;¦ $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without argumentsâeuro;¦ $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
curtis what do you mean --c? On Fri, Feb 17, 2012 at 4:54 PM, Curtis Maurand cur...@maurand.com wrote: C:\/Program\ Files\\... --C Negin Nickparsa wrote: I can't move Gams because it has many dll files which should be in there. gams.exe should be execute in that path file in program Files one time I tried to do it and when It shows me missing files I copy pasted many files but It needs many other files which I regretted so it is not possible. I tried \\\ string(101) 'C:/Program\\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:25 PM, Stuart Dallas stu...@3ft9.com wrote: On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Ok, in that case try \\\ instead of \. Alternatively move GAMS23.7 out of Program Files and into a directory without spaces! Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
Curtis I wrote this one as you said: if(system(C:\/Program\ Files\\GAMS23.7\\gams.exe \C:\/Program\ Files\GAMS23.7\trnsport_php.gms)) echo 'No Error'; else echo 'Error'; how to set the path file correct?I really need it Does anyone has a good reference showing me how to write path files in php from windows Xp running Apache server? On Fri, Feb 17, 2012 at 5:02 PM, Negin Nickparsa nickpa...@gmail.comwrote: curtis what do you mean --c? On Fri, Feb 17, 2012 at 4:54 PM, Curtis Maurand cur...@maurand.comwrote: C:\/Program\ Files\\... --C Negin Nickparsa wrote: I can't move Gams because it has many dll files which should be in there. gams.exe should be execute in that path file in program Files one time I tried to do it and when It shows me missing files I copy pasted many files but It needs many other files which I regretted so it is not possible. I tried \\\ string(101) 'C:/Program\\' is not recognized as an internal or external command, operable program or batch file. On Fri, Feb 17, 2012 at 4:25 PM, Stuart Dallas stu...@3ft9.com wrote: On 17 Feb 2012, at 12:53, Negin Nickparsa wrote: this one: $cmd = 'C:/Program\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; GENERATES: string(100) 'C:/Program\' is not recognized as an internal or external command, operable program or batch file. Ok, in that case try \\\ instead of \. Alternatively move GAMS23.7 out of Program Files and into a directory without spaces! Change the \\ in the commands to just a single \ but leave the space after it. On Fri, Feb 17, 2012 at 4:10 PM, Negin Nickparsa nickpa...@gmail.comwrote: ok sorry,I tried yours It generates Null. On Fri, Feb 17, 2012 at 4:06 PM, Stuart Dallas stu...@3ft9.com wrote: Please quote the relevant parts of the email you're replying to - your emails have massively diminished usefulness to the archives. On 17 Feb 2012, at 12:21, Negin Nickparsa wrote: It generates NULL My bad, try this… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe'.' '.escapeshellarg('C:/Program Files/GAMS23.7/trnsport_php.gms').' 21'; If that still doesn't seem to work, I suggest you try just executing the command without arguments… $cmd = 'C:/Program\\ Files/GAMS23.7/gams.exe 21'; Backticks execute a command and return the output: http://php.net/language.operators.execution -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/
Re: [PHP] how to execute Exe file in system
ERRORNULL maybe program Files which has space should have something like \ which I don't know ha? or because of Null It is correct? means false.. it cannot find the path. you have problem with path.
Re: [PHP] how to execute Exe file in system
Fatih C:\Program Files\GAMS23.7 this is where my Gams is. maybe the problem is with permissions what should I do for permissions? what shoud I do to write this path file:'( I need it! when echo system('dir') shows me files of C:\Program Files\GAMS23.7 then it shoud run the command gams.exe transport.gms without giving pathfiles what's wrong here? what reason is here for setting path files? On Fri, Feb 17, 2012 at 5:06 PM, Fatih P. fatihpirist...@gmail.com wrote: ERRORNULL maybe program Files which has space should have something like \ which I don't know ha? or because of Null It is correct? means false.. it cannot find the path. you have problem with path.
Re: [PHP] how to execute Exe file in system
On Fri, Feb 17, 2012 at 3:43 PM, Negin Nickparsa nickpa...@gmail.comwrote: Fatih C:\Program Files\GAMS23.7 this is where my Gams is. maybe the problem is with permissions what should I do for permissions? what shoud I do to write this path file:'( I need it! when echo system('dir') shows me files of C:\Program Files\GAMS23.7 then it shoud run the command gams.exe transport.gms without giving pathfiles what's wrong here? what reason is here for setting path files? On Fri, Feb 17, 2012 at 5:06 PM, Fatih P. fatihpirist...@gmail.comwrote: ERRORNULL maybe program Files which has space should have something like \ which I don't know ha? or because of Null It is correct? means false.. it cannot find the path. you have problem with path. for path: $path = \C:/Program Files/GAMS23.7/gams.exe\; qoute the paths using \ double quoutes outside. then pass them.
Re: [PHP] how to execute Exe file in system
Fatih what is about another parts?
Re: [PHP] how to execute Exe file in system
it's wrong Fatih because it shows me another color in editor On Fri, Feb 17, 2012 at 5:24 PM, Negin Nickparsa nickpa...@gmail.comwrote: Fatih what is about another parts?
Re: [PHP] how to execute Exe file in system
well then fix it. i m not using editor.
Re: [PHP] how to execute Exe file in system
:) On Fri, Feb 17, 2012 at 5:27 PM, Fatih P. fatihpirist...@gmail.com wrote: well then fix it. i m not using editor.
Re: [PHP] Turning a string into a condition
Hi everyone, Thanks for all the great ideas and links. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ASP to PHP
But has anybody had any experience of translating the asp code over? I've gone the other way and translated some PHP to ASP, which felt pretty dirty. Are you dealing with simple includes and small bits of logic? That's all that I had (also fairly static sites) and I found the process quite simple. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to execute Exe file in system
I found the correct one: $cmd = 'C:\Progra~1\GAMS23.7\gams.exe'.' '.escapeshellarg('C:\Progra~1\GAMS23.7\trnsport_php.gms').' 21'; $out = `$cmd`; var_dump($out); It will show NULL,so No error and I am sure it is correct because If I change gams.exe to egams.exe it recognizes but It can't run through system so my problem in path file has solved here Thanks to All of you. now I should find some solutions for permissions It doesn't relate to address file if I'm correct On Fri, Feb 17, 2012 at 5:27 PM, Negin Nickparsa nickpa...@gmail.comwrote: :) On Fri, Feb 17, 2012 at 5:27 PM, Fatih P. fatihpirist...@gmail.comwrote: well then fix it. i m not using editor.
[PHP] html_entity_decode is trying to kill me
Hi, So I decided to give one of those PHP math classes a go and have come across a joyful character encoding problem. He's the deal: $rule = 1 lt; 2; $rule = html_entity_decode($rule, ENT_QUOTES, 'UTF-8'); echo $rule; And the result is still 1 lt; 2. I've tried different combinations of character encodings and quotings, to no avail. Any ideas of where I should look for the culprit? Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Do an LDAP Password Modify Extended Operation?
Is it possible to do an LDAP Password Modify Extended Operation, as specified in RFC 3062? The password hashing scheme in the LDAP directory I am working with may change periodically, so it is my understanding that I can't hash a new password according to a specific scheme, e.g., {SHA}, on my side. Instead, I should use an Extended Operation and let the directory do the hashing. Is that correct? The help page for ldap_set_option suggests that it might be possible, but I sure can't find any example code anywhere. TIA Kirk
Re: [PHP] how to execute Exe file in system
I 3 myself sooo Much :) It works now like a charm I am successfully finished:D this is my SIMPLE solution no need to set path files! :D echo exec('C:\WINDOWS\system32\cmd.exe'); echo exec('gams.exe trnsport_php.gms'); It works like a charm:) On Fri, Feb 17, 2012 at 6:34 PM, Negin Nickparsa nickpa...@gmail.comwrote: I found the correct one: $cmd = 'C:\Progra~1\GAMS23.7\gams.exe'.' '.escapeshellarg('C:\Progra~1\GAMS23.7\trnsport_php.gms').' 21'; $out = `$cmd`; var_dump($out); It will show NULL,so No error and I am sure it is correct because If I change gams.exe to egams.exe it recognizes but It can't run through system so my problem in path file has solved here Thanks to All of you. now I should find some solutions for permissions It doesn't relate to address file if I'm correct On Fri, Feb 17, 2012 at 5:27 PM, Negin Nickparsa nickpa...@gmail.comwrote: :) On Fri, Feb 17, 2012 at 5:27 PM, Fatih P. fatihpirist...@gmail.comwrote: well then fix it. i m not using editor.
Re: [PHP] basic captcha
Thanks for all the input. Yes, there are a lot of ways and means and issues that can be considered (thanks Simon), but this project will use a simple captcha, mostly because it is familiar to users and fits with the project. Yes, I've found some options via google, but was more inquiring to see if you all had success with certain open-source freeware scripts. I haven't used google's version, but the problem I have with using google API's is that there can be delay's in page loading (in my experience). I don't generally like linking to 3rd party API's when I can help it. Ashley, I've used some of your techniques before within projects where those types of things fit. One I thought about recently is displaying an array of colors in random order and asking the submitter to choose their favorite color from the list. Perhaps not fool proof, but nice creative option. Anyway, for this project, I think I need a familiar captcha. Again, thanks! Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: html_entity_decode is trying to kill me
Answering myself sort-of, I think I'm on the wrong track with html_entity_decode(). Does an HTML entity refer to an HTML code like div rather than the encoded format of characters? It seems like htmlspecialchars_decode() is actually what I'm looking for, but I'm getting the same results with that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: html_entity_decode is trying to kill me
This info might be helpful. If I copy and paste the example from the manual directly, it works as described: $orig = I'll \walk\ the bdog/b now; $a = htmlentities($orig); $b = html_entity_decode($a); echo $a; // I'll quot;walkquot; the lt;bgt;doglt;/bgt; now echo $b; // I'll walk the bdog/b now But if I modify $orig to include spaces like so $orig = I'll \walk\ the b dog/b now; the output is I'll walk the lt; b gt;doglt;/bgt; now I'll walk the lt; b gt;dog now -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic captcha
Donovan Brooke li...@euca.us wrote: Thanks for all the input. Yes, there are a lot of ways and means and issues that can be considered (thanks Simon), but this project will use a simple captcha, mostly because it is familiar to users and fits with the project. Yes, I've found some options via google, but was more inquiring to see if you all had success with certain open-source freeware scripts. I haven't used google's version, but the problem I have with using google API's is that there can be delay's in page loading (in my experience). I don't generally like linking to 3rd party API's when I can help it. Ashley, I've used some of your techniques before within projects where those types of things fit. One I thought about recently is displaying an array of colors in random order and asking the submitter to choose their favorite color from the list. Perhaps not fool proof, but nice creative option. Anyway, for this project, I think I need a familiar captcha. Again, thanks! Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Well, if the answer doesn't matter, another could just pick anything and run with it couldn't they? Thanks, Ash http://ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic captcha
Savetheinternet wrote: [snip] There are plenty of free PHP captcha scripts out there. Just google captcha PHP. Securimage (phpcaptcha.org) looks relatively okay. Thanks, Michael Hi Michael, this looked promising.. however, requires some GD support it appears I don't have.. here is the results of their test file: GD Support: Yes! GD Version: bundled (2.0.34 compatible) imageftbbox function: No The imageftbbox() function is not included with your gd build. This function is required. TTF Support (FreeType): No No FreeType support. You cannot use Securimage 3.0, but can use 2.0 with gd fonts. JPEG Support: Yes! PNG Support: Yes! GIF Read Support: Yes! GIF Create Support: Yes! --- Will keep looking I guess. Thx. Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic captcha
Donovan Brooke wrote: [snip] Hi Michael, this looked promising.. however, requires some GD support it appears I don't have.[snip] Hi, well, just did the test on the live server and it *does* support it there.. so I guess I use it.. just won't work in the development enviro. Thanks for the suggestion! Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic captcha
Ashley Sheridan wrote: [snip] Well, if the answer doesn't matter, another could just pick anything and run with it couldn't they? Thanks, Ash For the favorite color thing? The idea would be to require one (but not all) of the word options in the list (so answer does matter)... most bots would not be able to deal with that.. however, like I said, not fool proof (and not recommended for sensitive purposes). ;-) Donovan -- D Brooke -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html_entity_decode is trying to kill me
On Fri, Feb 17, 2012 at 5:00 PM, Marc Guay marc.g...@gmail.com wrote: Hi, So I decided to give one of those PHP math classes a go and have come across a joyful character encoding problem. He's the deal: $rule = 1 lt; 2; $rule = html_entity_decode($rule, ENT_QUOTES, 'UTF-8'); echo $rule; And the result is still 1 lt; 2. I've tried different combinations of character encodings and quotings, to no avail. Any ideas of where I should look for the culprit? Marc This piece of code is working perfectly fine on my Ubuntu PHP 5.3.6. (I get 1 2 ). Can you post some information about your system, eg PHP version, Apache version, Operating System, OS language? - Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html_entity_decode is trying to kill me
It actually works for me as well if I run it in the browser. The structure of the app is a bit strange, though, so debugging character encoding issues is quite difficult. The code is being run by Code Igniter in the backend and the response passed via JSON to a ExtJS 4 frontend, so what I'm looking at to debug is the server's response in the browser console. What I can say is that I decode the string and pass it immediately afterwards to the EvalMath class that was suggested earlier, it complains that there's illegal characters lt;, so obviously it's the server that isn't operating as expected... but why? PHP/5.3.2-1ubuntu4.14 Apache/2.2.14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] html_entity_decode is trying to kill me
Ugh. The problem is that the EvalMath class doesn't death with comparisons between numbers, it only performs calculations. Barking up the wrong tree for 2 hours is fun on a Friday! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] html_entity_decode is trying to kill me
Ugh. The problem is that the EvalMath class doesn't death with comparisons between numbers, it only performs calculations. Barking up the wrong tree for 2 hours is fun on a Friday! Sorry, I just noticed death; seems your fingers contracted deal with into death. Interersting... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Do an LDAP Password Modify Extended Operation?
On Feb 17, 2012, at 10:57, kirk.john...@zootweb.com wrote: Is it possible to do an LDAP Password Modify Extended Operation, as specified in RFC 3062? The password hashing scheme in the LDAP directory I am working with may change periodically, so it is my understanding that I can't hash a new password according to a specific scheme, e.g., {SHA}, on my side. Instead, I should use an Extended Operation and let the directory do the hashing. Is that correct? The help page for ldap_set_option suggests that it might be possible, but I sure can't find any example code anywhere. TIA Kirk I have an example of this on my lab box at home. I noticed issues depending on if the requesting application was Linux or windows due to the different Linux LDAP libraries. When I get home I'll forward you the example of what I have so far -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Do an LDAP Password Modify Extended Operation?
Mike Mackintosh mike.mackint...@angrystatic.com wrote on 02/17/2012 12:36:06 PM: On Feb 17, 2012, at 10:57, kirk.john...@zootweb.com wrote: Is it possible to do an LDAP Password Modify Extended Operation, as specified in RFC 3062? The password hashing scheme in the LDAP directory I am working with may change periodically, so it is my understanding that I can't hash a new password according to a specific scheme, e.g., {SHA}, on my side. Instead, I should use an Extended Operation and let the directory do the hashing. Is that correct? The help page for ldap_set_option suggests that it might be possible, but I sure can't find any example code anywhere. TIA Kirk I have an example of this on my lab box at home. I noticed issues depending on if the requesting application was Linux or windows due to the different Linux LDAP libraries. When I get home I'll forward you the example of what I have so far Woohoo! Extended Operation doesn't seem to be a practice that is in wide-spread use. Looking forward to what you've come up with. Thanks.
Re: [PHP] basic captcha
On Fri, 17 Feb 2012, Ashley Sheridan wrote: I would avoid making a user type in something they see in a picture, as you've just succeeded in pissing off a bunch of blind people. Thank you! Glad someone pointed this out so I didn't have to. And if you use a system like Recaptcha which has an audio option, you've still locked out deafblind users. Also, avoid relying on javascript. It can be turned off, disabled, blocked and sometimes isn't available at all, such as with some speech/Braille browsers. Or lynx. Yes I'm a blind person, but even a person who isn't may want to use it quickly from a shell to get something done. One popular route is to ask a question that only a human could answer. I use this method on the contact page of my site. I just ask a question such as Multiply the number of heads a person has by the number of legs on 2 dogs. It's easy for a human, but requires context, something a bot can't do effectively. Since the person was looking for a ready-made solution, I'd like to recommend TextCaptcha.com. It claims to have 180,243,205 easy questions, and even has an article on ways to avoid needing a CAPTCHA in the first place. I once (and only once) struck a test like this on a New Zealand government website. I nearly died of shock. And I was able to use it with lynx with no problems at all. Geoff. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Wrong POSTFIELDS Posted
I have a script that accepts four POST variables. Three are used and five more are added for a total of eight keys and their urlencode() values all strung together in the proper format. Then cURL is initialized with the field string given to: curl_setopt($ch, CURLOPT_POST,8); curl_setopt($ch, CURLOPT_POSTFIELDS, $string); But that's not the string arriving at cURL's target URL! What's arriving at the target is exactly the POST array that this script received in the first place. Here's what I don't understand... The cURL request is coming from this script on domainA, but the target address is also domainA. Does everybody play nice in this situation? PHP 5.3.5 Apache 2.2 Note: CURLOPT_POST evaluates to true, regardless that I use an integer. All other curl* commands are set. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wrong POSTFIELDS Posted
Am 18.02.12 01:54, schrieb Brian Smither: I have a script that accepts four POST variables. Three are used and five more are added for a total of eight keys and their urlencode() values all strung together in the proper format. Then cURL is initialized with the field string given to: curl_setopt($ch, CURLOPT_POST,8); curl_setopt($ch, CURLOPT_POSTFIELDS, $string); But that's not the string arriving at cURL's target URL! What's arriving at the target is exactly the POST array that this script received in the first place. Here's what I don't understand... The cURL request is coming from this script on domainA, but the target address is also domainA. Does everybody play nice in this situation? PHP 5.3.5 Apache 2.2 Note: CURLOPT_POST evaluates to true, regardless that I use an integer. All other curl* commands are set. Maybe you could provide a bit more of information. var_dump($_POST); // at the beginning of the script // the code that assembles $string // the target url for your curl request from curl_init or CURLOPT // the other curloptions not mentioned here but used -- Marco Behnke Dipl. Informatiker (FH), SAE Audio Engineer Diploma Zend Certified Engineer PHP 5.3 Tel.: 0174 / 9722336 e-Mail: ma...@behnke.biz Softwaretechnik Behnke Heinrich-Heine-Str. 7D 21218 Seevetal http://www.behnke.biz signature.asc Description: OpenPGP digital signature
Re: [PHP] Do an LDAP Password Modify Extended Operation?
On Feb 17, 2012, at 3:34 PM, kirk.john...@zootweb.com wrote: Mike Mackintosh mike.mackint...@angrystatic.com wrote on 02/17/2012 12:36:06 PM: On Feb 17, 2012, at 10:57, kirk.john...@zootweb.com wrote: Is it possible to do an LDAP Password Modify Extended Operation, as specified in RFC 3062? The password hashing scheme in the LDAP directory I am working with may change periodically, so it is my understanding that I can't hash a new password according to a specific scheme, e.g., {SHA}, on my side. Instead, I should use an Extended Operation and let the directory do the hashing. Is that correct? The help page for ldap_set_option suggests that it might be possible, but I sure can't find any example code anywhere. TIA Kirk I have an example of this on my lab box at home. I noticed issues depending on if the requesting application was Linux or windows due to the different Linux LDAP libraries. When I get home I'll forward you the example of what I have so far Woohoo! Extended Operation doesn't seem to be a practice that is in wide-spread use. Looking forward to what you've come up with. Thanks. Kirk, What i've been trying to do, is revive the patch i found here: http://www.mail-archive.com/internals@lists.php.net/msg19665.html It provides a lot of the functionality that you can only imagine and more, but it fails against versions 5.3.x. I sent an email to the original maintainer, Pierangelo, but have not received a response yet on that status of maintenance. Do you use OpenLDAP? I am not sure if it built, if it would support AD or not. Mike Mackintosh PHP, the drug of choice - www.highonphp.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ASP to PHP
I've done a site from Classic ASP (no .net) to non-oop PHP. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php