[PHP] writing binary data to file
hi, I must change some bytes in array filled from a msssql text field; now I do: function adjust (&$ar_in) { $ar_in{0}='Ð'; $ar_in{1}='Ï'; $ar_in{3}='à'; $ar_in{4}='¡'; $ar_in{5}='±'; $ar_in{7}='á'; } I've copied/pasted values from an hex editor and this works ok. Question is: does exists a more elegant way to do this, using directly hex values in the script? I tried $ar_in{0}=0xFF for example, but when I write on file I got hex 32 (ascii '2'). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] global value (php.ini) settings override with local (virtualhost) value
In php.ini i've set open_basedir = /usr/local/lib/php/:/tmp/ in vhost.conf (VirtualHost include file) i set php_admin_value open_basedir /web/htdocs/linuxtest4.aruba.it/home/ So if i execute phpinfo i view: LOCAL MASTER open_basedir /web/htdocs/linuxtest4.aruba.it/home/ /usr/local/lib/php/:/tmp/ but if i execute a script that try to open a file in /tmp i get limitations by open_basedir. If i put all these value in the php.ini and toggle php_admin_value open_basedir in vhost.conf i get all working ok. How can i avoid the open_basedir value to be overwritten by vhost.conf ? (i want to be "added") Regards. -- Davide Giunchi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compilation?
I just upgraded to PHP 5 from PHP 4. I am using the crack lib function for password dictionary uniqueness. However, now my web page utilizing the crack-lib is crashing with " PHP Fatal error: Call to undefined function crack_opendict()". Does anyone know of a specific Crack-lib module I can compile instead of compiling the entire PHP code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compilation?
I am very new to PHP. Can anyone tell me how do I compile my php 5 code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compilation?
Actually I want to compile my php 5 code --with-crack[=DIR] option. in order to use the crack lib. >>> "Daniel Brown" <[EMAIL PROTECTED]> 4/23/2007 4:27 PM >>> Or if you're wondering how to compile a .php file for viewing on the web (or running from the command line), then don't worry about it. PHP is meant to be compiled at runtime. If you're looking to find out how to *obfuscate* your code (such as what companies like WHM Autopilot and Modernbill do), then look into ionCube and Zend Guard/Zend Optimizer. This "compiles" the code so that it can't be read or modified by the end-user, but will still run as a run-time script, not a standalone application. So in any case, you still need a compiled PHP binary to run the code so if that is what you're asking about, refer to Tijnema's post. On 4/23/07, Tijnema ! <[EMAIL PROTECTED]> wrote: > > On 4/23/07, Davide Bernard <[EMAIL PROTECTED]> wrote: > > I am very new to PHP. Can anyone tell me how do I > > compile my php 5 code? > > > First you should tell us which operating system you are using, is it > windows or is it linux? > > If it's windows you'd be better off using the binary. > > If you're using linux,you might want to check out a binary release > first, else compiling is also quite simple. > Extract tarball. > ./configure > make > make install > > that will do it :) > > Tijnema > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Isset Errors
Anyone got any suggestions on getting rid of these errors below? [Wed May 09 08:59:05 2007] [error] [client 192.168.225.246] PHP Notice: Undefined index: userstate in /srv/www/htdocs/resetpw.php on line 31, referer: https://ams.unt.edu/resetpw.php [Wed May 09 08:59:05 2007] [error] [client 192.168.225.246] PHP Notice: Undefined index: userstate in /srv/www/htdocs/resetpw.php on line 36, referer: https://ams.unt.edu/resetpw.php Here's the lines of code I am getting the errors in PHP 5...Where can I insert some code to define 'userstate' ? 24. if (identifyUser()) { 25. if ((isset($_SESSION['clientinfo']['ssn'][0]) && strcmp('9', $_SESSION['clientinfo']['ssn'][0])) 26. || isset($_SESSION['clientsinfo'])) { 27. $_SESSION['userstate'] = 'confirmssn'; 28. } else { 29. $_SESSION['userstate'] = 'ssnverified'; 30. } 31. } elseif ($_SESSION['userstate'] == 'confirmssn' && confirmSSN()) { 32. $_SESSION['userstate'] = 'ssnverified'; 33. } 34. initMenu(); 35. if (isset($_SESSION['userstate'])) return 0; 36. if ($_SESSION['userstate'] == 'confirmssn') { 37. themeHeader(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help
I've found http://php.net/ to be very helpful. Especially in troubleshooting. >>> "Muhammad Hassan Samee" <[EMAIL PROTECTED]> 7/2/2007 8:38 AM >>> hay i m a C++ programmer and new to web development with basic knowledge of HTML, CSS and j.script now i want to start learning PHP anybody can direct me to some good/fast track tutorials \ books for getting start -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using Exec Function
I'm Windows XP Professional SP1, Apache 2.0.50 and PHP 5.0.4 I'm trying to run a Win32 application using Exec() or Shell_Exec() but it doesn't work. In PHP.INI safe_mode is Off Apache is running under SYSTEM user I also tryed to use backtick operator as shown in http://php.net/manual/en/language.operators.execution.php but with no success, in the browser I get something like this: C:\Programmi\Apache Group\Apache2\htdocs\prove>C:\HELLO.EXE php code $test"; ?> mybat.bat C:\HELLO.EXE I'm still learning to use PHP, so this obviously beyond me. Davide -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using Exec Function
I did as You suggested: but Hello.Exe, a very simple program, doesn't run and my browser seems waiting something from the server. Can I run a program (exe file) in another way ? Thank in advance for your help. Davide -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using Exec Function
I just need to understand how I can run Hello.exe Thanks for your help Davide ""Richard Lynch"" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > On Thu, June 16, 2005 6:23 am, Davide Pasqualini said: > > I'm Windows XP Professional SP1, Apache 2.0.50 and PHP 5.0.4 > > I'm trying to run a Win32 application using Exec() or Shell_Exec() but it > > doesn't work. > > > > In PHP.INI safe_mode is Off > > Apache is running under SYSTEM user > > > > I also tryed to use backtick operator as shown in > > http://php.net/manual/en/language.operators.execution.php > > but with no success, in the browser I get something like this: > > > > C:\Programmi\Apache Group\Apache2\htdocs\prove>C:\HELLO.EXE > > > > php code > > > $test = `c:\mybat.bat`; > > echo "$test"; > > ?> > > > > mybat.bat > > C:\HELLO.EXE > > > > I'm still learning to use PHP, so this obviously beyond me. > > What do you expect "hello.exe" to do?... > > Cuz it looks like it's printing out *something* even if it's not what you > want it to print out. > > "C:\Programmi\Apache Group\Apache2\htdocs\prove" is the output of > "hello.exe" far as I can see. > > -- > Like Music? > http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: just test
OK, in the task manager Hello.EXE is running (owner SYSTEM) but I don't see anything on the screen "Edgars Klavinskis" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > > Edgars > > > > Davide Pasqualini wrote: > > >I did as You suggested: > > > > >$win_cmd = "\"C:\\Hello.exe\""; > >exec($win_cmd, $stdout, $stderr); > >print "Standard output:\n"; > >print_r($stdout); > >print "Standard error:\n"; > >print_r($stderr); > >?> > > > >but Hello.Exe, a very simple program, doesn't run and my browser seems > >waiting something from the server. > > > >Can I run a program (exe file) in another way ? > > > >Thank in advance for your help. > > > >Davide > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php