[PHP] creating .PS or .PRN *files* from the command line or php???
Does anyone know how to create .PS or .PRN files from the *command line* or PHP under Windows 2000 ??? Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] check for a number
Steve Bradwell wrote: is_int($f) will return true if $f is an integer, false otherwise. is_int will return false in this case, because it's a string. You have to use is_numeric HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] finding next and previous db entries
hey all, if im displaying pages with data from a database eg www.domain.com/file.php?id=40 on that page i would like to have a previous and next link that would take it to id 41 and 39 respectively, the only problem being what if 39 or 41 was empty? then i would want the link to be id=42 or id=38.. is the best way to do this just loop through the id's until it finds a entry that isnt empty? or is there any functions for this? jo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Javascript ?
try www.ozoneasylum.com Elias Christopher J. Crane [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anyone know of a Javascript forum like this one that I can post a question to? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sorting a text string
I want to sort text strings, but how could i do this ? Example: 04.09.2002 05.09.2002 19.03.1999 Is there a way to change the string to something like this ... 2002.09.04 2002.09.05 1999.03.19 Or is there a better way to solve this ?? Bård Tommy Nilsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sorting a text string
Hi There. One way of doing this: split each string into an array, delimited by the periods $sDate = '04.09.2002'; $aDate = split( '.', $sDate ); this will give you an array like array( [0]='04', [1]='09', [2]='2002' ) now reverse the array: $aDate = array_reverse( $aDate ); join back into a string, using periods: $sDate = join( '.', $aDate ); $sDate = '2002.09.04' HTH Regards -|Scott -Original Message- From: Bård Tommy Nilsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 10:36 AM To: '[EMAIL PROTECTED]' Subject: [PHP] Sorting a text string I want to sort text strings, but how could i do this ? Example: 04.09.2002 05.09.2002 19.03.1999 Is there a way to change the string to something like this ... 2002.09.04 2002.09.05 1999.03.19 Or is there a better way to solve this ?? Bård Tommy Nilsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with starting apache in win2k with mcrypt and mhash
Hello i've uncommended the mcrypt and mhash line in c:\winnt\php.ini. then i try to start the apache but encounter the following error msg The procedure entry point _ecalloc could not be located in the dynamic link library php4ts.dll Unable to load dynamic library 'c:\php\extensions\php_mcrypt.dll - The specified procedure could not be found. mhash: Unable to initialize module Module compiled with module API=20010901, debug=0, thread-safety=1 PHP compiled with module API=20020429, debug=0, thread-safety=1 There options need to match i m sure that the php_mcrypt.dll is already in that location. i've also tried to change the extension_dir in c:\winnt\php.ini to c:\php c:\php\extensions\ c:\winnt c:\winnt\system32 and copied all the required dll to corresponding directories. same error was encountered when i start the apache. can you advice how can i solve it? i've also installed the terence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem on starting apache in win2k with mcrypt and mhash module
Hello (i've confirmed my email address but not sure if you will read my previous mail, so i send it once more.) i've uncommended the mcrypt and mhash line in c:\winnt\php.ini. then i try to start the apache but encounter the following error msg The procedure entry point _ecalloc could not be located in the dynamic link library php4ts.dll Unable to load dynamic library 'c:\php\extensions\php_mcrypt.dll - The specified procedure could not be found. mhash: Unable to initialize module Module compiled with module API=20010901, debug=0, thread-safety=1 PHP compiled with module API=20020429, debug=0, thread-safety=1 There options need to match i m sure that the php_mcrypt.dll is already in that location. i've also tried to change the extension_dir in c:\winnt\php.ini to c:\php c:\php\extensions\ c:\winnt c:\winnt\system32 and copied all the required dll to corresponding directories. same error was encountered when i start the apache. can you advice how can i solve it? Terence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 5 Sep 2002 10:40:19 -0000 Issue 1567
php-general Digest 5 Sep 2002 10:40:19 - Issue 1567 Topics (messages 115239 through 115284): Re: post doesn't work? 115239 by: Matt Zur Returning Rows Question 115240 by: Christopher J. Crane 115242 by: Mike richardson 115244 by: Christopher J. Crane 115245 by: Ashley M. Kirchner 115247 by: Christopher J. Crane 115248 by: joshua 115250 by: David Freeman Nevermind... I got it... Thanks! 115241 by: Matt Zur Mail list/message board 115243 by: Brian V Bonini 115246 by: nicos.php.net Domxml: coping with UTF-16 115249 by: Gwyn whitespace... 115251 by: Matt Zur 115252 by: Philip Hallstrom 115254 by: nicos.php.net 115255 by: Matt Zur 115257 by: joshua 115260 by: Steve Edberg Re: FORUM CODE 115253 by: joshua Javascript ? 115256 by: Christopher J. Crane 115258 by: nicos.php.net 115280 by: lallous cURL and cookies 115259 by: Jeff Schwartz Help, Convincing upgrade of PHP 115261 by: JJ Harrison 115262 by: Michael Geary 115265 by: David Rice Good free PHP web stats package? 115263 by: tomba 115275 by: olinux php and a printer 115264 by: Ric Mañalac emacs on win32 115266 by: Victor ebay auction manager 115267 by: electroteque ebay management and auction listings using php 115268 by: electroteque convert ISO-8859-1 to EUC-JP 115269 by: prabahar Currency Exchange and Weather 115270 by: César Aracena 115274 by: Justin French Encryption of emails. 115271 by: Bob Irwin 115272 by: Manuel Lemos 115273 by: Justin French creating .PS or .PRN *files* from the command line or php??? 115276 by: Jason Caldwell Re: check for a number 115277 by: Erwin finding next and previous db entries 115278 by: tux 115279 by: Petre Agenbag Sorting a text string 115281 by: Bård Tommy Nilsen 115282 by: Scott Houseman problem with starting apache in win2k with mcrypt and mhash 115283 by: Terence Lee problem on starting apache in win2k with mcrypt and mhash module 115284 by: Terence Lee Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Didn't seem to fix it. -Matt [EMAIL PROTECTED] wrote: If you have register globals off, you must use $_POST['name'] and not $name. Check your php.ini (? phpinfo(); ?) -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Matt Zur [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] I have a form that posts to another php file. But it won't display the var? It just shows a blank screen. For example test.php has form input name test2.php prints name On test2.php it shows a blank screen, but if I assign $name on test2.php and reload, it will print the var. Is there something in the php.ini that I have to change to get vars to post? or some setting somewhere else? -Matt -- Matt Zur [EMAIL PROTECTED] http://www.zurnet.com Need a Web Site??? - Visit... www.zurnet.com 1997 - 2002 - 5th Anniversary!!! -- Matt Zur [EMAIL PROTECTED] http://www.zurnet.com Need a Web Site??? - Visit... www.zurnet.com 1997 - 2002 - 5th Anniversary!!! ---End Message--- ---BeginMessage--- How do you alternate colors of the rows in a table inside a while statement when dealing with the output of data from a DB. I am sure it's something simple but I keep getting into some really long math thing... ---End Message--- ---BeginMessage--- While( ) { ... $color = ($color == FF)? EAEAEA : FF; print td bgcolor='#$color'\n; ... } -Original Message- From: Christopher J. Crane [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 3:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Returning Rows Question How do you alternate colors of the rows in a table inside a while statement when dealing with the output of data from a DB. I am sure it's something simple but I keep getting into some really long math thing... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Thanks. I will give it a shot. I have never seen anything written like that. Can you give me a brief explanation of what it means? Thanks again. - Original Message - From: Mike richardson [EMAIL PROTECTED] To: 'Christopher J. Crane' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 04, 2002 7:03 PM Subject: RE: [PHP] Returning Rows Question While( ) { ... $color = ($color == FF)?
[PHP] dropdown Newbie question
Hello! I am very new in php and i have a little dummy question ;D I have a dropdown box with a entry in it called Coctail Blue Now i want to put the selected string (Coctail Blue in this case) in to a variable when i press the button below. options.php is the page it should go after. // ..SNIP ... // Start Dropdown echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } //end dropdown // Button echo '/selectnbsp;nbsp;input type=submit name=get value=select'; //doesnt work: $var_from_dropdown = theme // ..SNIP ... What did i do wrong? Thank you! Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array Javascript
Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
Hi there. The value from that dropdown will be returned to you in the variable $_POST OR $_GET, depending on which method you used to submit the form. Assuming you use POST, you can access the selected value like this: $var_from_dropdown = $_POST['theme']; Regards -|Scott -Original Message- From: Mario Ohnewald [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 1:11 PM To: [EMAIL PROTECTED] Subject: [PHP] dropdown Newbie question Hello! I am very new in php and i have a little dummy question ;D I have a dropdown box with a entry in it called Coctail Blue Now i want to put the selected string (Coctail Blue in this case) in to a variable when i press the button below. options.php is the page it should go after. // ..SNIP ... // Start Dropdown echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } //end dropdown // Button echo '/selectnbsp;nbsp;input type=submit name=get value=select'; //doesnt work: $var_from_dropdown = theme // ..SNIP ... What did i do wrong? Thank you! Mario -- 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] Array Javascript
You can't. Javascript happens on the client side AFFTER PHP has happend on the server side. For PHP to ready variables made with javascrip,t you'd have to submit those variables/arrays via POST of GET to the PHP file. Justin on 05/09/02 9:11 PM, kale ([EMAIL PROTECTED]) wrote: Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Array Javascript
Hi To Assign values from an array in PHP to JavaScript, you could try something like this. $Array = array( 'one', 'two', 'three' ); Now in your JavaScript: SCRIPT LANGUAGE=JavaScript JSArray = new Array(?= sizeof( $Array )?); ?php for ( $iSubscript = 0; $iSubscript sizeof( $Array ); $iSubscript++ ) { // Add each member of the php array to the JS array echo 'JSArray['.$iSubscript.'] = '.$Array[$iSubscript].';'; } ? /SCRIPT Regards -|Scott -Original Message- From: kale [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 1:12 PM To: [EMAIL PROTECTED] Subject: [PHP] Array Javascript Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale. -- 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] Array Javascript
var tmp,url; url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += 'phparray[]' + escape(tmp); } document.location.href = url; In script.php, you'll find array named phparray kale wrote: Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and VISA cards? help!
Hi How is possible to charge some products on E-Shop in php to users with VISA cards??? Are there some good tutorials on net about this??? Or examples??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with starting apache in win2k with mcrypt and mhash
Terence Lee wrote: Hello i've uncommended the mcrypt and mhash line in c:\winnt\php.ini. then i try to start the apache but encounter the following error msg The procedure entry point _ecalloc could not be located in the dynamic link library php4ts.dll Unable to load dynamic library 'c:\php\extensions\php_mcrypt.dll - The specified procedure could not be found. mhash: Unable to initialize module Module compiled with module API=20010901, debug=0, thread-safety=1 PHP compiled with module API=20020429, debug=0, thread-safety=1 There options need to match The problem is here: These options need to match Your modules are too old, they use one year old API , get new ones. i m sure that the php_mcrypt.dll is already in that location. i've also tried to change the extension_dir in c:\winnt\php.ini to c:\php c:\php\extensions\ c:\winnt c:\winnt\system32 and copied all the required dll to corresponding directories. same error was encountered when i start the apache. can you advice how can i solve it? i've also installed the terence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP MySQL Apache on Linux vs. Solaris
Hi Since i moved from a Sun / Solaris Machine to a Compaq / Linux machine I'm having weird problems with MySQL crashing while running reports written in php. The site is amazingly fast now on the Linux server but running a report that locks the main tables for about 20 seconds raises the load and crashes the server. While this makes some sense (maybe) i did not have this while i was on Solaris. Why would Solaris know how to hold the queries in the Queue till the tables are freed and Linux does not? Is this PHP, MySQL or maybe Linux to blame? thanks berber
Re: [PHP] Array Javascript
I forgot , the right version: var tmp,url,separator; url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += separator + 'phparray[]' + escape(tmp); separator = ''; } document.location.href = url; Marek Kilimajer wrote: var tmp,url; url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += 'phparray[]' + escape(tmp); } document.location.href = url; In script.php, you'll find array named phparray kale wrote: Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dropdown Newbie question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey, If your php version is = 4.1.0 use: $var_from_dropdown = $_GET['theme']; else use: $var_from_dropdown = $HTTP_GET_VARS['theme']; You might want to change the method used to submit your form from get to post, like: // Start Dropdown echo 'form name=theme action=options.php method=post target=right class=menu Then you code should read: $var_from_dropdown = $_POST['theme']; or $var_from_dropdown = $HTTP_POST_VARS['theme']; applying the rules from above. Hope that helps! ~Pauly On Thursday 05 September 2002 07:18 am, Scott Houseman wrote: Hi there. The value from that dropdown will be returned to you in the variable $_POST OR $_GET, depending on which method you used to submit the form. Assuming you use POST, you can access the selected value like this: $var_from_dropdown = $_POST['theme']; Regards -|Scott -Original Message- From: Mario Ohnewald [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 1:11 PM To: [EMAIL PROTECTED] Subject: [PHP] dropdown Newbie question Hello! I am very new in php and i have a little dummy question ;D I have a dropdown box with a entry in it called Coctail Blue Now i want to put the selected string (Coctail Blue in this case) in to a variable when i press the button below. options.php is the page it should go after. // ..SNIP ... // Start Dropdown echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } //end dropdown // Button echo '/selectnbsp;nbsp;input type=submit name=get value=select'; //doesnt work: $var_from_dropdown = theme // ..SNIP ... What did i do wrong? Thank you! Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9d0OmDyXNIUN3+UQRAmbzAJ9qUW6LYEndO81ybqFsMpeklHzs1wCfUGDK Egom83QUipWIZ0ko2q1x5/s= =OiSG -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array Javascript
You have a JavaSript array on the client side, so you want to provide some click here link or button. The whole thing will look like this: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head titleUntitled/title script language=JavaScript !-- var myArray; var tmp,url,separator; myArray = new Array('one','two','three'); function sendArray(){ url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += separator + 'phparray[]' + escape(tmp); separator = ''; } document.location.href = url; return false; } //-- /script /head body a href= onClick=return sendArray()Click Here/a /body /html kale wrote: This is a javascript? Where must I put this lines? Thanks for help. Kale. -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 2:31 PM To: PHP Subject: Re: [PHP] Array Javascript var tmp,url; url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += 'phparray[]' + escape(tmp); } document.location.href = url; In script.php, you'll find array named phparray kale wrote: Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
Hi, I tried it but i wasnt luck: // Theme echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; // or: echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); the exec line seems to works since it created the file. But it stays emty. Cheers, Matio From: Scott Houseman [mailto:[EMAIL PROTECTED]] Hi there. The value from that dropdown will be returned to you in the variable $_POST OR $_GET, depending on which method you used to submit the form. Assuming you use POST, you can access the selected value like this: $var_from_dropdown = $_POST['theme']; Regards -|Scott -Original Message- From: Mario Ohnewald [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 1:11 PM To: [EMAIL PROTECTED] Subject: [PHP] dropdown Newbie question Hello! I am very new in php and i have a little dummy question ;D I have a dropdown box with a entry in it called Coctail Blue Now i want to put the selected string (Coctail Blue in this case) in to a variable when i press the button below. options.php is the page it should go after. // ..SNIP ... // Start Dropdown echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } //end dropdown // Button echo '/selectnbsp;nbsp;input type=submit name=get value=select'; //doesnt work: $var_from_dropdown = theme // ..SNIP ... What did i do wrong? Thank you! Mario -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XML doubt
I am not sure, but my best guess is if you are using Apache and Php as a module is that each request will be handled by a seperate child process of Apache. Perhaps someone can correct me if I am wrong. Rodrigo Dominguez wrote: Ok, thank you just one more doubt Is it threading safe? For example: At 13:30:10 [Proccess 1] cliente request index.php At 13:30:11 [Proccess 1] index.php is putting the content of the querey into index.xml At 13:30:12 [Proccess 2]a new client request index.php At 13:30:13 [Proccess 2]a new instance of index.php is invoked and it starts to put the content of the query into index.xml, but [Proccess 1] is still working with index.xml What happends? Geoff Hankerson [EMAIL PROTECTED] escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Forgot a step: (1C) make an xslt stylesheet which is basically just a beefed-up html page. Check out devshed.cm xml.com and w3c.org for info on xslt stlyesheets Geoff Hankerson wrote: Rodrigo Dominguez wrote: I don't know how to work with XML... I know that it's a good standard to pass information between computer or applications, but I don't know how to separe my data from my presentation on my PHP projects. I always use OOP, I organize all the data in databases and clases, but I always have to put some code on my presentation files, like index.php, viewstock.php, and it will be great if I can organize my projects so the presentation can be handled by any designersm, at this time I always have to make the changes on the presentation files because I am the one who know about PHP. Can you give some example about how to separate the data from the presentation using XML and databases? Or can you tell me about a project where I can see it? Thank you. 1. Convert sql queries into xml (I'm glad to send a copy of my class if you'd like) basically its: A. Loop over query as you normally would B. Loop through each column in a record for a query and make an xml compatible string like: record fieldname value /fieldname /record 2. Then just follow the xslt section of the php manual it's pretty straight forward Give it a shot, if you have trouble send specific questions to the list I and quite a few other will be glad to help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dropdown Newbie question
method is an attribute of form, not sure about input. --- // Theme echo ' form name=theme action=options.php target=right class=menu METHOD=POST nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit value=select'; // or: echo '/selectnbsp;nbsp;input type=submit value=select'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); --- Justin French on 05/09/02 10:42 PM, Mario Ohnewald ([EMAIL PROTECTED]) wrote: Hi, I tried it but i wasnt luck: // Theme echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; // or: echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); the exec line seems to works since it created the file. But it stays emty. Cheers, Matio From: Scott Houseman [mailto:[EMAIL PROTECTED]] Hi there. The value from that dropdown will be returned to you in the variable $_POST OR $_GET, depending on which method you used to submit the form. Assuming you use POST, you can access the selected value like this: $var_from_dropdown = $_POST['theme']; Regards -|Scott -Original Message- From: Mario Ohnewald [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 1:11 PM To: [EMAIL PROTECTED] Subject: [PHP] dropdown Newbie question Hello! I am very new in php and i have a little dummy question ;D I have a dropdown box with a entry in it called Coctail Blue Now i want to put the selected string (Coctail Blue in this case) in to a variable when i press the button below. options.php is the page it should go after. // ..SNIP ... // Start Dropdown echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } //end dropdown // Button echo '/selectnbsp;nbsp;input type=submit name=get value=select'; //doesnt work: $var_from_dropdown = theme // ..SNIP ... What did i do wrong? Thank you! Mario -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
[snip] // Theme echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; // or: echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); the exec line seems to works since it created the file. But it stays emty. [/snip] You need to place METHOD=POST in the original form tag and remove it from the submit tag. Try that HTH! Jay * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Encryption of emails.
Actually, there ARE servers at both ends. And the one I am sending to is cut off from the net except for the SMTP mail port so I can do whatever I want to with it. That's an excellent idea! *slaps head* Why didn't I think of that? :) Thanks Justin! Bob - Original Message - From: Justin French [EMAIL PROTECTED] To: Bob Irwin [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 05, 2002 4:00 PM Subject: Re: [PHP] Encryption of emails. Perhaps not EXACTLY what you're after, but I wrote a small, simple function to encrypt a string with a key (i'll skip a long note about keeping the key safe). Then I send an email with the data encrypted, and decrypt it at the other end (me) using a decrypt script located on my local server. It required PHP at both ends, which is a little catch. If I move it into client systems, I'll look at a windows GUI to decrypt. Justin on 05/09/02 3:29 PM, Bob Irwin ([EMAIL PROTECTED]) wrote: Hey guys, Can anyone recommend any PHP functions or plugins that will allow me to send encrypted emails via PHP? Something similar to PGP would be excellent. I have use PGP with a formmail cgi previously, but obviously it'd be easier to have in-PHP support for it. Any suggestions are much appreciated! Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cURL,libPNG,libJPG download
Hi, guys, Just a short question, I want to add cURL,libJPG and libPNG for my site and my hostscan you tell me where you downloaded it if you used it and what version? Thanks, -Ryan.
RE: [PHP] cURL,libPNG,libJPG download
[snip] RAI want to add cURL, http://www.google.com/search?hl=enlr=ie=UTF-8oe=UTF-8q=cURL RAlibJPG http://www.google.com/search?hl=enlr=ie=UTF-8oe=UTF-8q=libJPG RAand libPNG http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=libPNG RAwhat version? The latest one, of course. [/snip] I refer you to; http://www.ietf.org/rfc/rfc2795.txt?number=2795 I am having the thought of writing a similar IETF informational RFC about Google Searches and monkeys who cannot be bothered with same. HTH! Jay * Ask smart questions: * * http://www.tuxedo.org/~esr/faqs/smart-questions.html * * Top Questions on php-general;* * (Answers can be found by RTFM, STFW, or STFA,* * save for #3 and #6 which can probably be found * * the same way, since they are usually one of the * * other questions on this list.) * * 1. How can I make file uploads work? * * 2. How come my form will not pass variables? * * 3. HELP! HELP! Please HELP! * * 4. Register_Globals ?!? * * 5. Is there a function to ... [insert thought here]? * * 6. Anyone see the error in this code?* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP MySQL Apache on Linux vs. Solaris
Go to www.mysql.com and make sure you are using the latest version of MySQL. Adam On Thu, 5 Sep 2002, Boaz Yahav wrote: Hi Since i moved from a Sun / Solaris Machine to a Compaq / Linux machine I'm having weird problems with MySQL crashing while running reports written in php. The site is amazingly fast now on the Linux server but running a report that locks the main tables for about 20 seconds raises the load and crashes the server. While this makes some sense (maybe) i did not have this while i was on Solaris. Why would Solaris know how to hold the queries in the Queue till the tables are freed and Linux does not? Is this PHP, MySQL or maybe Linux to blame? thanks berber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Jay- [PHP] cURL,libPNG,libJPG download
Hey, Thanks for your help dude, even appreciate the sarcasm :-) Cheers, -Ryan. - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: 'Ryan A' [EMAIL PROTECTED]; :[EMAIL PROTECTED] Sent: Thursday, September 05, 2002 3:10 PM Subject: RE: [PHP] cURL,libPNG,libJPG download [snip] RAI want to add cURL, http://www.google.com/search?hl=enlr=ie=UTF-8oe=UTF-8q=cURL RAlibJPG http://www.google.com/search?hl=enlr=ie=UTF-8oe=UTF-8q=libJPG RAand libPNG http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=libPNG RAwhat version? The latest one, of course. [/snip] I refer you to; http://www.ietf.org/rfc/rfc2795.txt?number=2795 I am having the thought of writing a similar IETF informational RFC about Google Searches and monkeys who cannot be bothered with same. HTH! Jay * Ask smart questions: * * http://www.tuxedo.org/~esr/faqs/smart-questions.html * * Top Questions on php-general;* * (Answers can be found by RTFM, STFW, or STFA,* * save for #3 and #6 which can probably be found * * the same way, since they are usually one of the * * other questions on this list.) * * 1. How can I make file uploads work? * * 2. How come my form will not pass variables? * * 3. HELP! HELP! Please HELP! * * 4. Register_Globals ?!? * * 5. Is there a function to ... [insert thought here]? * * 6. Anyone see the error in this code?* -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] formatting a filename
i want to format the filename of an uploaded file as follows :- -- replace blankspace with _ -- remove any illegal characters. Which string functions should I use to do this? Thanks, Javier _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sorting a text string
$date = '04.09.2002'; $date = preg_replace('/(\d{2}).(\d{2}).(\d{4})/', '\\3.\\2.\\1', $date); echo $date; Output: 2002.09.04 Read up for more info. http://www.php.net/manual/en/ref.pcre.php regards alan Bård tommy nilsen wrote: I want to sort text strings, but how could i do this ? Example: 04.09.2002 05.09.2002 19.03.1999 Is there a way to change the string to something like this ... 2002.09.04 2002.09.05 1999.03.19 Or is there a better way to solve this ?? Bård Tommy Nilsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formatting a filename
Here is a function that is used in the My_eGallery modules for PHP nuke. function find_nom_dif($nom) { $nom=stripslashes($nom); $nom=str_replace(',,$nom); $nom=str_replace(\,,$nom); $nom=str_replace(\,,$nom); $nom=str_replace(,,$nom); $nom=str_replace(,,,$nom); $nom=str_replace(;,,$nom); $nom=str_replace(/,,$nom); $nom=str_replace(\\,,$nom); $nom=str_replace(`,,$nom); $nom=str_replace(,,$nom); $nom=str_replace(,,$nom); $nom=str_replace( ,_,$nom); $nom=str_replace(:,,$nom); $nom=str_replace(*,,$nom); $nom=str_replace(|,,$nom); $nom=str_replace(?,,$nom); $nom=str_replace(é,e,$nom); $nom=str_replace(è,e,$nom); $nom=str_replace(ç,c,$nom); $nom=str_replace(@,,$nom); $nom=str_replace(â,a,$nom); $nom=str_replace(ê,e,$nom); $nom=str_replace(î,i,$nom); $nom=str_replace(ô,o,$nom); $nom=str_replace(û,u,$nom); $nom=str_replace(ù,u,$nom); $nom=str_replace(à,a,$nom); $nom=str_replace(!,,$nom); $nom=str_replace(§,,$nom); $nom=str_replace(+,,$nom); $nom=str_replace(^,,$nom); $nom=str_replace((,,$nom); $nom=str_replace(),,$nom); $nom=str_replace(#,,$nom); $nom=str_replace(=,,$nom); $nom=str_replace($,,$nom); $nom=str_replace(%,,$nom); $nom=str_replace(ä,ae,$nom); $nom=str_replace(Ä,Ae,$nom); $nom=str_replace(ö,oe,$nom); $nom=str_replace(Ö,Oe,$nom); $nom=str_replace(ü,ue,$nom); $nom=str_replace(Ü,Ue,$nom); $nom=str_replace(ß,ss,$nom); return $nom; } /Martin Citat Javier Montserat [EMAIL PROTECTED]: i want to format the filename of an uploaded file as follows :- -- replace blankspace with _ -- remove any illegal characters. Which string functions should I use to do this? Thanks, Javier _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php mvh Martin Hjort Eriksen Studenterrådet, Roskilde Universitetscenter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formatting a filename
check out preg replace in the manual... particularly example 3 of this page: http://www.php.net/manual/en/function.preg-replace.php personally, i'd replace anything other than a-zA-z0-9 with _ Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] formatting a filename
[snip] i want to format the filename of an uploaded file as follows :- -- replace blankspace with _ -- remove any illegal characters. Which string functions should I use to do this? [/snip] http://www.php.net/manual/en/function.eregi-replace.php HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: formatting a filename
You shouldn't use str_replace as he said, but preg_replace() or ereg_replace(), ereg are easier to use. take a look at www.php.net/ereg_replace . -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Javier Montserat [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] i want to format the filename of an uploaded file as follows :- -- replace blankspace with _ -- remove any illegal characters. Which string functions should I use to do this? Thanks, Javier _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
Well, this is my original Code: -- // Theme echo ' form name=theme action=options.php target=right class=menu METHOD=POST nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); The file /tmp/varfromdropdown is still emty. (the dropdown field is NOT emty by the time i press the select button) Any other ideas? From: Jay Blanchard [mailto:[EMAIL PROTECTED]] [snip] // Theme echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; // or: echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); the exec line seems to works since it created the file. But it stays emty. [/snip] You need to place METHOD=POST in the original form tag and remove it from the submit tag. Try that HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
[snip] Well, this is my original Code: // Theme echo ' form name=theme action=options.php target=right class=menu METHOD=POST nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); The file /tmp/varfromdropdown is still emty. (the dropdown field is NOT emty by the time i press the select button) Any other ideas? [/snip] Did you put a closing form tag? /form Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formatting a filename
I use this, it includes also national characters $name=strtr( $name, `O}ao~¾YYµAÁÂAÄAAÇEÉEËIÍÎI?NOÓÔOÖOUÚUÜÝßaáâaäaaçeéeëiíîi?noóôoöouúuüýy *!@#$%^()+=, SOZsozlYYuAAACDNOOYsaaaconooyy_); Javier Montserat wrote: i want to format the filename of an uploaded file as follows :- -- replace blankspace with _ -- remove any illegal characters. Which string functions should I use to do this? Thanks, Javier _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dropdown Newbie question
Why don't you take the guesswork out of it a bit, and NOT write to a file just yet... instead, just echo the var to the screen. IF that works, then we know it's not your form that is the problem, it's the exec(). Justin on 06/09/02 12:08 AM, Mario Ohnewald ([EMAIL PROTECTED]) wrote: Well, this is my original Code: -- // Theme echo ' form name=theme action=options.php target=right class=menu METHOD=POST nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); The file /tmp/varfromdropdown is still emty. (the dropdown field is NOT emty by the time i press the select button) Any other ideas? From: Jay Blanchard [mailto:[EMAIL PROTECTED]] [snip] // Theme echo ' form name=theme action=options.php target=right class=menu nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; // or: echo '/selectnbsp;nbsp;input type=submit name=get value=select METHOD=POST'; $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); the exec line seems to works since it created the file. But it stays emty. [/snip] You need to place METHOD=POST in the original form tag and remove it from the submit tag. Try that HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE : include interpreted php file
hi, thanks for your help again. i've noticed that file function have two different behaviors. i tested file function with the url and it seems that the file is interpreted. But i tried the code u give me and without the http://myurl.com/; at the beginning, a warning is raised : Warning: file(test.php?foo=test) - Invalid argument in c:\program files\easyphp\www\un.php on line 10 otherwise, without the http string, it reads the file as text file and print exactly his content. You Timo Stamm [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] @all: I just noticed that I was not replying to the list, but to the posting email adresses. I just switched to another email client and was not aware of this. My apologies :-( --- You, could it be that you want to do the following?: ?php // primary php $foo = $_REQUEST[foo] // I guess you want to do something with $foo here. $outputfromsecondaryphp = file(secondary.php?foo=.$foo) echo implode('', $outputfromsecondaryphp); ? Am Dienstag den, 3. September 2002, um 00:15, schrieb you: Thanks for ur help and i'm sorry to have a so bad english I guess my french is worse than your english :-) Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
From: Jay Blanchard [mailto:[EMAIL PROTECTED]] Did you put a closing form tag? /form you are right, the closeing tag was missing, well, it still doesnt work/stays emty ;/ // Theme echo ' form name=theme action=options.php target=right class=menu method=POST nbsp;nbsp;select name=theme'; for($i=0;$isizeof($theme_name);$i++) { echo option value='.$i.'.$theme_name[$i]./option\n; } echo '/selectnbsp;nbsp;input type=submit name=get value=select'; echo '/form'; //i tried it here $var_from_dropdown = $_POST['theme']; exec(echo $var_from_dropdown /tmp/varfromdropdown); //echo '/form'; //and here, to be sure. Of course never toghether! Mario Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] dropdown Newbie question
[snip] Did you put a closing form tag? /form you are right, the closeing tag was missing, well, it still doesnt work/stays emty ;/ [/snip] Does this form refer to itself, or another page? Also, like Justin said, echo the variable before writing to a directory to see what is getting written, if anything. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Currency Exchange and Weather
oanda www.oanda.com had a service where you could socket into it , that is now not free but they still have a free email service which i parse the information out of the email and add it to a currency table in the database which is run via a daily cron job Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... This appears to do what you want... or at least provide some inspiration: http://www.phpclasses.org/browse.html/file/1220.html I'm sure there are hundreds of web services based on currency conversion and weather... usually they send XML data which you parse... google will help :) Justin French on 05/09/02 3:30 PM, César Aracena ([EMAIL PROTECTED]) wrote: Hi all. I need to find FREE world wide weather reports and also a FREE currency converter from US Dollars to other currencies that can serve PHP requests 24 hours a day, so I can customize the look and feel of these results in my site(s). Does anyone knows where to get all this? Has anyone out there fulfilled this kind of requirements in the past? Thanks in advance, Cesar Aracena mailto:[EMAIL PROTECTED] On Dial-Up CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing error code vars
hi there i am trying to pass error code vars within a page say i post to a query string like ?action=upload i would like to be able to send an error code if any back to the page and then it can bring it up the only way i can think of it when i redirect back to the previous page is adding a ?errorcode=1 etc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD with PHP on win2000
Hello, I am looking for usefull pointers on how to install GD graphing libraries with PHP 4.0 on a windows 2000 system. Thanks, Adnane. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: formatting a filename
$filename = strtolower (eregi_replace ([^A-Za-z0-9_.], _, $filename)); seems to be what I want. thanks to everyone for the help Javier _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dynamic screencapture using gd
is there a way to do a dynamic screen capture of a website using gd ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file download/open and ie bug
I'm using version 6 of IE and Netscape I'm allowing the user to open/dowload a file from a secure locaiton on our server. Under Netscape it works great! Under IE, it doesn't work at all. IE complains about not being able to read from the server. Anyone know of any workarounds? here's the command I send: header(Content-type: {$mimetype[PDF]} \n); header(Content-transfer-encoding: binary\n); header(Content-length: . filesize($fname) . \n); readfile($fname);
[PHP] PHP e GD big files
Hi, I'm using GD to put a dinamic text in some buttons. The problem is that the original image that I use has 8k and after i put a black text it jumps to 20K. What I'm doing wrong? there's a way to compact this? Thank's -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sort dinamic generated table
Hi, I have a resume system that put a rank in it resume at runtime. example: If you do a serach for each match that it finds it atribute 1 point, now I need to sort the generated list based in this rank, how can i do this, since this rank is dinamic and isn't in database?? Thank's -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] sort dinamic generated table
stick the values in an array and use asort() to sort it. -Original Message- From: Rodrigo Peres [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 8:30 AM To: PHP Subject: [PHP] sort dinamic generated table Hi, I have a resume system that put a rank in it resume at runtime. example: If you do a serach for each match that it finds it atribute 1 point, now I need to sort the generated list based in this rank, how can i do this, since this rank is dinamic and isn't in database?? Thank's -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sort dinamic generated table
Rodrigo Peres wrote: Hi, I have a resume system that put a rank in it resume at runtime. example: If you do a serach for each match that it finds it atribute 1 point, now I need to sort the generated list based in this rank, how can i do this, since this rank is dinamic and isn't in database?? Thank's Did you try putting it all in into an array and sorting the array? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP e GD big files
Attach the two GIFs (pre and post text) in an email to me... Justin on 06/09/02 1:26 AM, Rodrigo Peres ([EMAIL PROTECTED]) wrote: Hi, I'm using GD to put a dinamic text in some buttons. The problem is that the original image that I use has 8k and after i put a black text it jumps to 20K. What I'm doing wrong? there's a way to compact this? Thank's -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic screencapture using gd
I seriously doubt it, because really, what you want to capture is how the *browser* renders the HTML code... GC is not a browser, nor a parser of HTML code. This topic has been discussed a few times in various shapes and forms in the archive... it'd be worth doing a search for screen grab and screen capture to see if anything got resolved. You could probably automate a large amount of it with Applescript (Mac, or equiv. PC scripting) and Photoshop's actions (macros)... but someone has prolly got a better solution that they've thought thru :) Justin on 06/09/02 1:07 AM, electroteque ([EMAIL PROTECTED]) wrote: is there a way to do a dynamic screen capture of a website using gd ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems with PHP post and get
I'm running Apache 1.3.26 and PHP 4.2.2 on a windows NT system. I've been having problems with some scripts I got from a friend off the net. The script runs an initial setup process and asks for a username and password and e-mail address.. you submit the info and it will set up an admin account then you refresh the page and it will ask you to login with the username and junk that you just set up.. But, when I try to submit the information, it simply reloads the page. Can anyone tell me if there is something in my PHP.INI file i need to change or anything else? If anyone wants to try the script out, it is newsPHP from http://www.nphp.net/. Please, someone help! -- Dion Munk [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problems with PHP post and get
[snip] I'm running Apache 1.3.26 and PHP 4.2.2 on a windows NT system. I've been having problems with some scripts I got from a friend off the net. The script runs an initial setup process and asks for a username and password and e-mail address.. you submit the info and it will set up an admin account then you refresh the page and it will ask you to login with the username and junk that you just set up.. But, when I try to submit the information, it simply reloads the page. Can anyone tell me if there is something in my PHP.INI file i need to change or anything else? If anyone wants to try the script out, it is newsPHP from http://www.nphp.net/. Please, someone help! [/snip] My SWAG is that you need to set register_globals = On in your php.ini. Either that or you need the rtfm() function. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic screencapture using gd
yeh i was getting too deep into automation scripts on windoze but became system intensive thanks Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I seriously doubt it, because really, what you want to capture is how the *browser* renders the HTML code... GC is not a browser, nor a parser of HTML code. This topic has been discussed a few times in various shapes and forms in the archive... it'd be worth doing a search for screen grab and screen capture to see if anything got resolved. You could probably automate a large amount of it with Applescript (Mac, or equiv. PC scripting) and Photoshop's actions (macros)... but someone has prolly got a better solution that they've thought thru :) Justin on 06/09/02 1:07 AM, electroteque ([EMAIL PROTECTED]) wrote: is there a way to do a dynamic screen capture of a website using gd ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP e GD big files
The answer is compression - the image with text is more complicated, so the compression ration is lower Rodrigo Peres wrote: Hi, I'm using GD to put a dinamic text in some buttons. The problem is that the original image that I use has 8k and after i put a black text it jumps to 20K. What I'm doing wrong? there's a way to compact this? Thank's -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dynamic screencapture using gd
Shouldn't be possible, as it would be a security risk. electroteque wrote: yeh i was getting too deep into automation scripts on windoze but became system intensive thanks Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I seriously doubt it, because really, what you want to capture is how the *browser* renders the HTML code... GC is not a browser, nor a parser of HTML code. This topic has been discussed a few times in various shapes and forms in the archive... it'd be worth doing a search for screen grab and screen capture to see if anything got resolved. You could probably automate a large amount of it with Applescript (Mac, or equiv. PC scripting) and Photoshop's actions (macros)... but someone has prolly got a better solution that they've thought thru :) Justin on 06/09/02 1:07 AM, electroteque ([EMAIL PROTECTED]) wrote: is there a way to do a dynamic screen capture of a website using gd ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing error code vars
If the variable is within a form you could do: input type=hidden name='name_of_var' value=$err_code This would pass to the next page, otherwise the ?name_of_var=$err_code mau be the way to go? -Brad hi there i am trying to pass error code vars within a page say i post to a query string like ?action=upload i would like to be able to send an error code if any back to the page and then it can bring it up the only way i can think of it when i redirect back to the previous page is adding a ?errorcode=1 etc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PEAR Documentation
Hello, I just started to use some PEAR classes, by now, I'm dealing with PEAR::DB that has a lot of examples and documentation but I can't find anything similar for PEAR::HTML_QuickForm. Where can I find documentation about this class ? I'm trying to learn it just by trial and error but a list of functions, methods and properties would be very nice. Thanks, _ Mauricio Cuenca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] formatting a filename
On Thu, 5 Sep 2002, Javier Montserat wrote: i want to format the filename of an uploaded file as follows :- -- replace blankspace with _ -- remove any illegal characters. Which string functions should I use to do this? http://www.php.net/manual/en/function.ereg.php http://www.php.net/manual/en/function.ereg.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems with PHP post and get
Thanks. As you can prolbably tell, I am quite the beginner. Thanks for the help!!! -- Dion Munk [EMAIL PROTECTED] Jay Blanchard [EMAIL PROTECTED] wrote in message 003701c254f2$f3e5aed0$8102a8c0@000347D72515">news:003701c254f2$f3e5aed0$8102a8c0@000347D72515... [snip] I'm running Apache 1.3.26 and PHP 4.2.2 on a windows NT system. I've been having problems with some scripts I got from a friend off the net. The script runs an initial setup process and asks for a username and password and e-mail address.. you submit the info and it will set up an admin account then you refresh the page and it will ask you to login with the username and junk that you just set up.. But, when I try to submit the information, it simply reloads the page. Can anyone tell me if there is something in my PHP.INI file i need to change or anything else? If anyone wants to try the script out, it is newsPHP from http://www.nphp.net/. Please, someone help! [/snip] My SWAG is that you need to set register_globals = On in your php.ini. Either that or you need the rtfm() function. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] formatting a filename
Ereg() would be an excellent choice. To move a step further, although it is a little more complex to become familiar with, the perl regular expressions are considerably faster and more efficient for anything with an expression, and str_replace() is faster yet, if replacing a simple string. Thus, it would probably be best to use: $clean_term = str_replace( , _, $term); // replace spaces with _ $clean_term = preg_replace(@[^a-zA-Z0-9_.]@, , $term); // remove any non-alphanumeric chars There is an excellent article somewhere that gives some benchmark times for the various methods... Anyone know where this is? I can't seem to find it anymore. However, I remember the basic concept: on a given string, preg_replace ran about 1 second, ereg_replace ran about 4 seconds, and str_replace ran about .2 seconds. See these docs for info about syntax: http://www.php.net/manual/en/function.preg-replace.php http://www.php.net/manual/en/function.str-replace.php http://www.php.net/manual/en/function.ereg-replace.php Best wishes Michael phpzen -Original Message- From: Rodolfo Gonzalez [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 9:34 AM To: Javier Montserat Cc: [EMAIL PROTECTED] Subject: Re: [PHP] formatting a filename On Thu, 5 Sep 2002, Javier Montserat wrote: i want to format the filename of an uploaded file as follows :- -- replace blankspace with _ -- remove any illegal characters. Which string functions should I use to do this? http://www.php.net/manual/en/function.ereg.php http://www.php.net/manual/en/function.ereg.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] PHP MySQL Apache on Linux vs. Solaris
I'm using 3.23.52-log -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 3:22 PM To: Boaz Yahav Cc: PHP General (E-mail) Subject: Re: [PHP] PHP MySQL Apache on Linux vs. Solaris Go to www.mysql.com and make sure you are using the latest version of MySQL. Adam On Thu, 5 Sep 2002, Boaz Yahav wrote: Hi Since i moved from a Sun / Solaris Machine to a Compaq / Linux machine I'm having weird problems with MySQL crashing while running reports written in php. The site is amazingly fast now on the Linux server but running a report that locks the main tables for about 20 seconds raises the load and crashes the server. While this makes some sense (maybe) i did not have this while i was on Solaris. Why would Solaris know how to hold the queries in the Queue till the tables are freed and Linux does not? Is this PHP, MySQL or maybe Linux to blame? thanks berber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP MySQL Apache on Linux vs. Solaris
I haven't had any problems with mysql like you are having. I would recommand you recompile the source rpm to the binary rpms and then install them. Adam On Thu, 5 Sep 2002, Boaz Yahav wrote: I'm using 3.23.52-log -Original Message- From: Adam Williams [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 3:22 PM To: Boaz Yahav Cc: PHP General (E-mail) Subject: Re: [PHP] PHP MySQL Apache on Linux vs. Solaris Go to www.mysql.com and make sure you are using the latest version of MySQL. Adam On Thu, 5 Sep 2002, Boaz Yahav wrote: Hi Since i moved from a Sun / Solaris Machine to a Compaq / Linux machine I'm having weird problems with MySQL crashing while running reports written in php. The site is amazingly fast now on the Linux server but running a report that locks the main tables for about 20 seconds raises the load and crashes the server. While this makes some sense (maybe) i did not have this while i was on Solaris. Why would Solaris know how to hold the queries in the Queue till the tables are freed and Linux does not? Is this PHP, MySQL or maybe Linux to blame? thanks berber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file upload problem
Hey I have a prob with my php file upload. i am using windows my html file looks like HTML HEAD/HEAD BODY FORM ACTION=upload1.php3 METHOD=post ENCTYPE=multipart/form-data Upload the datafile here INPUT TYPE=file NAME=file brbr INPUT TYPE=submit NAME=Submit VALUE=Submit Form /FORM /BODY /HTML my php file looks like ? $endresult = File Was Uploaded; $newfile = C:\\upload\\.$file_name; echo $newfile.br; echo $file.br; copy($file, $newfile) or $endresult = Couldn't Copy File To Server; echo $endresult; ? when i run i get an error \\php2 c:\upload\a.gif cannot upload file any ideas why?? also i am not clear as to where the \\php2 comes from thanks in advance regards ram __ Give your Company an email address like ravi ravi-exports.com. Sign up for Rediffmail Pro today! Know more. http://www.rediffmailpro.com/signup/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file upload problem
Take a look at http://www.php.net/manual/sv/printwn/features.file-upload.php, your pages should be named .php and not .php3 if you support PHP4. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Ram K [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hey I have a prob with my php file upload. i am using windows my html file looks like HTML HEAD/HEAD BODY FORM ACTION=upload1.php3 METHOD=post ENCTYPE=multipart/form-data Upload the datafile here INPUT TYPE=file NAME=file brbr INPUT TYPE=submit NAME=Submit VALUE=Submit Form /FORM /BODY /HTML my php file looks like ? $endresult = File Was Uploaded; $newfile = C:\\upload\\.$file_name; echo $newfile.br; echo $file.br; @copy($file, $newfile) or $endresult = Couldn't Copy File To Server; echo $endresult; ? when i run i get an error \\php2 c:\upload\a.gif cannot upload file any ideas why?? also i am not clear as to where the \\php2 comes from thanks in advance regards ram __ Give your Company an email address like ravi @ ravi-exports.com. Sign up for Rediffmail Pro today! Know more. http://www.rediffmailpro.com/signup/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] finding next and previous db entries
You have to use recursive functions for this. You can write one.. function linkchecker($id) { $query=SELECT COUNT(*) AS mycount FROM tablename WHERE id=.$id.; $result=mysql_query($query); $row=mysql_fetch_array($result); $nextid = $id + 1; if (($row[mycount]) 0 ) { echo a href=link.php?id=\.$nextid.\ link /a; } else { linkchecker($nextid); } } Modify this to your needs.. I hope this helps.. Gurhan On Thu, 2002-09-05 at 17:20, tux wrote: hey all, if im displaying pages with data from a database eg www.domain.com/file.php?id=40 on that page i would like to have a previous and next link that would take it to id 41 and 39 respectively, the only problem being what if 39 or 41 was empty? then i would want the link to be id=42 or id=38.. is the best way to do this just loop through the id's until it finds a entry that isnt empty? or is there any functions for this? jo -- 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] XSLT - Sablotron
I am trying to find out a way I can pass a variable that is basically an XML document to xslt_process and make it all work. My script works if I have: $xp = xslt_create(); $result = xslt_process($xp, 'test.xml', 'test.xsl'); however, if I try to do: $xp = xslt_create(); $result = xslt_process($xp, $xmldata, 'test.xsl'); it won't work. $xmldata contains an XML document, but for some reason it errors out on me, any ideas on how to make this work? I basically have the XML data generated dynamically from a database and then I want to pass it to the XSLT to process the page. Any help would greatly be appreciated.
[PHP] xml parsing (while loop question)
Hi, I have Marc Robards article on XML Parsing with PHP (wirelessdevnet.com).. which talks about parsing an XML FILE. My XML is from a remote server (used curl to get it back to PHP as a variable). How do I change the following while to read from variable instead of file without getting these lame XML error: junk after document element at line 1? while($data=fread($fp, 4096)){ if(!xml_parse($sml_parser, $data, feof($fp))){ die. } } What I tried was $data being the variable containing xml from remote host.. so I say while($data){ } which works but when it gets to the end it dies with: XML error: junk after document element at line 1 Can anybody help me? Can anybody see? Sundays on the phone with monday.. sorry beatles flashback. I am not the walrus but I'm not a newbie either.. so very sorry for this newbie-esque question. Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: XSLT - Sablotron
You should put the content into a file. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Devin Atencio [EMAIL PROTECTED] a écrit dans le message de news: 067301c25516$ff18c4d0$[EMAIL PROTECTED] I am trying to find out a way I can pass a variable that is basically an XML document to xslt_process and make it all work. My script works if I have: $xp = xslt_create(); $result = xslt_process($xp, 'test.xml', 'test.xsl'); however, if I try to do: $xp = xslt_create(); $result = xslt_process($xp, $xmldata, 'test.xsl'); it won't work. $xmldata contains an XML document, but for some reason it errors out on me, any ideas on how to make this work? I basically have the XML data generated dynamically from a database and then I want to pass it to the XSLT to process the page. Any help would greatly be appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] precision using pow()
Hi: I am attempting to calculate a mortgage payment using the following code. ?PHP $P = 10;// principal outstanding $I = 4.5; // annual interest rate percentage $N = 20;// number of years // The formula that I am using //(P*(((1+i/200)^(1/6)-1))/(1-(((1+i/200)^(1/6)))^-(n*12))) $Pmt = $P*((pow(1+($I/200),(1/6))-1)/(1-pow(pow((1+$I/200),(1/6)),-($N*12; echo $Pmt; ? which produces: 630.40515566726 What I am looking for is 632.65 (rounded to 2 places). (I am not looking for a rounding mechanism, just a more accurate result) The manual states that the pow function attempts to return an Integer. Is this the source of the inaccurate result? The manual also says to look at exp but appears to be missing some sort of usage example. I have no idea how that works. I tried a few things with no success. I also came across a mention of bcpow() but am unable to use this in the build that I am using. So is it some boneheaded coding error on my part or am I asking for too much of pow()? Thanks David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] XSLT - Sablotron
On Thu, 5 Sep 2002, Devin Atencio wrote: I am trying to find out a way I can pass a variable that is basically an XML document to xslt_process and make it all work. My script $xmldata = a whole boatload of well-formed XML; $xsltArgs = array( '/_xml' = $xmlStr ); $xp = xslt_create(); $result = xslt_process( $xp, 'arg:/_xml', 'file.xsl', NULL, $xsltArgs ); Don't waste the code/resources on putting the xml into a file. g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with inserting Flash into MySQL database
Hi Mitja, If I understand this right, the SWF file has to be a SWF file. To make it work like you want, you need a script that - writes the SWF from the db to a SWF file on the server, - returns HTML with object/embed tags and the path to the SWF file. Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multiple keywords in search boxes
Hi Jason, have a look at Richard Lynchs reply posted at Sat, 31. Aug. 2002 03:08:39 Europe/Berlin with subject [PHP] Re: performing searches with random entries Timo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ending a session
Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ending a session
Because there is absolutely no way for PHP to know that the user has closed the browser window. Nothing is sent from the browser to the server on a window close. By using session cookies (cookies without a specified expiry time) the session is effectively ended since the cookie is gone once the browser has been completely shut down (not just a window). When that user comes back to the site after starting their browser again they will get a new session. -Rasmus On Thu, 5 Sep 2002, Raphael Hamzagic wrote: Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- 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] ending a session
You can end the session by using function session_destroy(). See: http://www.php.net/manual/en/function.session-destroy.php For general information on how PHP handles sessions see: http://www.php.net/manual/en/ref.session.php Hope this helps. Gurhan On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote: Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- 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] ending a session
Thanks, But, if the client don't accept cookies? And if the user open a new browser window with the same url, the new window will use the same opened session. I'm having trouble with this Thanks, Raphael Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Because there is absolutely no way for PHP to know that the user has closed the browser window. Nothing is sent from the browser to the server on a window close. By using session cookies (cookies without a specified expiry time) the session is effectively ended since the cookie is gone once the browser has been completely shut down (not just a window). When that user comes back to the site after starting their browser again they will get a new session. -Rasmus On Thu, 5 Sep 2002, Raphael Hamzagic wrote: Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- 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] ending a session
Of course Gurhan, I have read all the php manual. How can I send a message when the user closes the browser to destroy the session? Thanks in advance Raphael Gurhan Ozen [EMAIL PROTECTED] wrote in message 1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST... You can end the session by using function session_destroy(). See: http://www.php.net/manual/en/function.session-destroy.php For general information on how PHP handles sessions see: http://www.php.net/manual/en/ref.session.php Hope this helps. Gurhan On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote: Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- 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] ending a session
Ohhh, I see what you are looking for.. You have to play around with some javascript to do it. Have a logout.php file, and destroy session in that file ... And in the main page, have the javascript to open up a new window with logout.php page. Makes sense? I hope this helps. Gurhan On Thu, 2002-09-05 at 17:32, Raphael Hamzagic wrote: Of course Gurhan, I have read all the php manual. How can I send a message when the user closes the browser to destroy the session? Thanks in advance Raphael Gurhan Ozen [EMAIL PROTECTED] wrote in message 1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST... You can end the session by using function session_destroy(). See: http://www.php.net/manual/en/function.session-destroy.php For general information on how PHP handles sessions see: http://www.php.net/manual/en/ref.session.php Hope this helps. Gurhan On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote: Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- 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] ending a session
A little addition/clarification, I mean in the main page, have the javascript open up a new window with logout.php file when the user closes the browser. Gurhan On Thu, 2002-09-05 at 18:04, Gurhan Ozen wrote: Ohhh, I see what you are looking for.. You have to play around with some javascript to do it. Have a logout.php file, and destroy session in that file ... And in the main page, have the javascript to open up a new window with logout.php page. Makes sense? I hope this helps. Gurhan On Thu, 2002-09-05 at 17:32, Raphael Hamzagic wrote: Of course Gurhan, I have read all the php manual. How can I send a message when the user closes the browser to destroy the session? Thanks in advance Raphael Gurhan Ozen [EMAIL PROTECTED] wrote in message 1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST... You can end the session by using function session_destroy(). See: http://www.php.net/manual/en/function.session-destroy.php For general information on how PHP handles sessions see: http://www.php.net/manual/en/ref.session.php Hope this helps. Gurhan On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote: Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- 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] Good free PHP web stats package?
Agreed, This is quite a good engine. I don't have very big log files as I just rolled them over a couple of weeks ago, but you gan view sample live stats here: http://www.nudenurd.com/stats/ Cheers, Liam - Original Message - From: olinux [EMAIL PROTECTED] To: tomba [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 05, 2002 4:21 PM Subject: Re: [PHP] Good free PHP web stats package? Webalizer is a fairly popular package, even used by a few fortune 500's if I remember correctly. Not PHP but fast and free. http://www.webalizer.com/ olinux --- tomba [EMAIL PROTECTED] wrote: I have a client that is hosted with a company that has a rather lame web stats package. I am looking for a PHP based stats package and have waded through the sites that have apps shown under PHP at hotscripts.com and wasn't drawn to the dozen or so that I looked at. So if you have recommendations, send them along. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hardware Address
Hello all, I am working on a LAN application and am interested in obtaining the user's network card address to limit usage of the program. Is there a way to do this in PHP? I am on a network that uses DHCP so using the IP address probably wont work and I am also worried about IP spoofing. Thanks for any help you can provide, Chris _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Hardware Address
Hi, The best way I think is to use exec() or system() to ask that to the system. May be someone knows something better too. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Chris Cook [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hello all, I am working on a LAN application and am interested in obtaining the user's network card address to limit usage of the program. Is there a way to do this in PHP? I am on a network that uses DHCP so using the IP address probably wont work and I am also worried about IP spoofing. Thanks for any help you can provide, Chris _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with inserting values into database through php
The best way IMHO, to debug problems like this is to echo out your insert query to the screen and not actually run the query, or run it and make sure you use: $sql = INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position'); $result = mysql_query($sql) or die(Invalid query: $sql); (This is always good practice anyways, especially if the page depends upon that query's execution) Anyhow, echo out the query: $sql to the screen and then run it against your actual MySQL database and see how it responds? Chances are there is some error there, and you'll get more meaningful feedback from the database backend. HTH -Brad Olli Sinerma wrote: Hi, I´m having a weird problem with getting my forms work within php. I have a running MySQL server, php installed on a apache server and I can make SQL queries through php, but I´m unable to insert any data into it through forms. This is an example file that I´m using (it´s from http://hotwired.lycos.com/webmonkey/99/21/index3a_page4.html?tw=programming ) __ html body ?php if ($submit) { // process form $db = mysql_connect(localhost, root, mypassword); mysql_select_db(mydb,$db); $sql = INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position'); $result = mysql_query($sql); echo Thank you! Information entered.\n; } else{ // display form ? form method=post action=?php echo $PHP_SELF? First name:input type=Text name=firstbr Last name:input type=Text name=lastbr Address:input type=Text name=addressbr Position:input type=Text name=positionbr input type=Submit name=submit value=Enter information /form ?php } // end if ? /body /html I have set the database in working order according to the manual, but after I enter some writing into the text fields and press submit: It refreshes the page and doesn't add any information into the db. I recon that the problem might be within the $php_self command, for I got all the previous php/mySQL tutorials working, but when this command appeared...problems started...or more accurate word would be: nothing happened. I have phpMyAdmin 2.3.0 running on my apache server and it can send/receive data from the db normally, so the problem shouldn't be in the db server or in the php, so it´s in me or in the code :) I have read through all the FAQ:s and manuals that I have found and I still can´t understand what is the problem in this one! -Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with inserting values into database through php
I´m quite a newbie in making php, but I managed to run the test you suggested, but nothin happened. This time it was propably the code I did: first I added the or die(Invalid query: $sql); part and ran the form, but everything happened just like when refreshing a page. Then I did this: $result = mysql_query($sql) or die(Invalid query: $sql); echo $sql; but the database was silentit just refreshed the page and cleared out the form. -Olli Brad Bonkoski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... The best way IMHO, to debug problems like this is to echo out your insert query to the screen and not actually run the query, or run it and make sure you use: $sql = INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position'); $result = mysql_query($sql) or die(Invalid query: $sql); (This is always good practice anyways, especially if the page depends upon that query's execution) Anyhow, echo out the query: $sql to the screen and then run it against your actual MySQL database and see how it responds? Chances are there is some error there, and you'll get more meaningful feedback from the database backend. HTH -Brad Olli Sinerma wrote: Hi, I´m having a weird problem with getting my forms work within php. I have a running MySQL server, php installed on a apache server and I can make SQL queries through php, but I´m unable to insert any data into it through forms. This is an example file that I´m using (it´s from http://hotwired.lycos.com/webmonkey/99/21/index3a_page4.html?tw=programming ) __ html body ?php if ($submit) { // process form $db = mysql_connect(localhost, root, mypassword); mysql_select_db(mydb,$db); $sql = INSERT INTO employees (first,last,address,position) VALUES ('$first','$last','$address','$position'); $result = mysql_query($sql); echo Thank you! Information entered.\n; } else{ // display form ? form method=post action=?php echo $PHP_SELF? First name:input type=Text name=firstbr Last name:input type=Text name=lastbr Address:input type=Text name=addressbr Position:input type=Text name=positionbr input type=Submit name=submit value=Enter information /form ?php } // end if ? /body /html I have set the database in working order according to the manual, but after I enter some writing into the text fields and press submit: It refreshes the page and doesn't add any information into the db. I recon that the problem might be within the $php_self command, for I got all the previous php/mySQL tutorials working, but when this command appeared...problems started...or more accurate word would be: nothing happened. I have phpMyAdmin 2.3.0 running on my apache server and it can send/receive data from the db normally, so the problem shouldn't be in the db server or in the php, so it´s in me or in the code :) I have read through all the FAQ:s and manuals that I have found and I still can´t understand what is the problem in this one! -Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Anyone use DB_DataObject
Hi, I'm trying to use Pear stuff but don't know if I should post to that list as just a user. I'm lost when it comes to Auto Building. It has an example of that and I tried to do it on a local linux box where I'm root but it failed all to undefined function: getstaticproperty and I found something via Google that did not help at all. It *SEEMS* I have to create a config file for each table. Personally, I admit it, I generate that stuff automatically in other languages, I did do the config file to represent a database schema but change happens so much that I just did not want to bother updating the config file all the time so I just generated it dynamically from then on. Anyhow, I think I know where to put those config files, where I put the path for: schema_location but now do I put one file with all the tables defined by the example given in the docs? Or do I create a file for each table? What do I name these files? I'm lost. I got as far as this: dataobjects_users Object ( [__table] = user_config [_DB_DataObject_version] = 1.0 [N] = 0 [_database_dsn] = [_database_dsn_md5] = [_database] = [_condition] = [_group_by] = [_order_by] = [_limit] = [_data_select] = * [_link_loaded] = [_lastError] = ) Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ending a session
Why not unregistered the session variables first, destroy the session second and redirect the user with a header location to a plain html page that includes a one line JavaScript in the body tag like onload+thiswindow cloase or something like that, and a message that please closes this window for complete logout. That's what I do and it works, in mozilla the script closes the window, in i.e. it asks that the user verify if they want to close the window, if they say no, then the user sees the message that please close this window to logout and that would pretty much take care of everything as far as I know. - Victor www.argilent.com -Original Message- From: Raphael Hamzagic [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 5:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] ending a session Of course Gurhan, I have read all the php manual. How can I send a message when the user closes the browser to destroy the session? Thanks in advance Raphael Gurhan Ozen [EMAIL PROTECTED] wrote in message 1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST... You can end the session by using function session_destroy(). See: http://www.php.net/manual/en/function.session-destroy.php For general information on how PHP handles sessions see: http://www.php.net/manual/en/ref.session.php Hope this helps. Gurhan On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote: Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- 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 __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Hardware Address
using exec() or system() will only be able to execute commands on the machine php is installed on. I sometimes wonder how universities and broadband isp's do this. I'd be interested in seeing how it works. Sorry, I'm not much help anymore. tyler On Fri, 6 Sep 2002 01:24:07 +0200 [EMAIL PROTECTED] wrote: Hi, The best way I think is to use exec() or system() to ask that to the system. May be someone knows something better too. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Chris Cook [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hello all, I am working on a LAN application and am interested in obtaining the user's network card address to limit usage of the program. Is there a way to do this in PHP? I am on a network that uses DHCP so using the IP address probably wont work and I am also worried about IP spoofing. Thanks for any help you can provide, Chris _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] largest value of 2nd parameter in fgets functions
hello i've tried to read a line from a text file by fgets($fp,8192). it work fine. however, there is a line over 8192 char and i tried to increase the 2nd parameter (e.g. 8193, 16384, 88192) still only 8192 char are read to my string variables. is it a limit of fgets or length of a string? any way to achieve getting more than 8192 char from a line in a text file? pls advice. terence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Safe_Mode problem....
PHP will not allow me to do this because safe_mode is on. I've been trying for the past two weeks to turn it off. Nothing I do changes it. I've changed, You'll have to re-compile without safe mode in the ./configure -- 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: regex help
?php $str = 'hi bmy friend/b! br / this message uses html entities a href=http://www.trini0.org;test/a!'; $str = preg_replace('/(a href=http:\/\/.*.*\/a)/', htmlspecialchars($1), $str); Maybe I'm missing something here, but can't you just do: $str = htmlspecialchars($str); -- 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: Escape characters won't go away
I'm getting multiple backslashes in data I get out of a mysql database. That's crazy... You'd have to be adding an awful lot of backslashes *before* you put it in there. MySQL eats up one (1) set of \s when it reads data. 1. $string = stripslashes($string); - Doesn't do anything Sure it does! $string = insert into names(name) values('Conan O\\'Brien'); print(Before: $stringBR\n); $string = stripslashes($string); print(After: $stringBR\n); 2. $string = ereg_replace(\\, , $string); - Doesn't do anything Try it with maybe. 3. $string = ereg_replace(\\, , $string); - Gives the following error message: Warning: REG_EESCAPE in script.php on line 1684 Here's why: PHP turns \\ into \ Regex sees \ and is looking for the *next* character after that to 'escape' it. There ain't no next character, and that's just wrong. would work like this: PHP turns that into: \\ (Each pair of \ in turns into one \) Regex then sees \\ and turns that into: \\ Or, let's assume that the '.' character is special in Regex. You'd need \\. in PHP to get a non-special '.' in Regex. Here's why: PHP turns \\. into \. Regex sees \. and knows that you want an actual '.', not the special character '.' that is a wild-card. None of these have worked. Any thoughts on how to get rid of them? I'm going batty. My first guess is you have Magic Quotes on in php.ini *AND* you are using addslashes() before you insert the data. Another possibility is that your FORMs are passing the strings along as you go... Here's the deal: The whole point of MagicQuotes and addslashes is to *prepare* data to be inserted into a database. If you choose *not* to insert that data, and spew it out to the browser either in a TEXTBOX or in an INPUT TYPE=HIDDEN, then you need to use stripslashes() at that point. Otherwise, you've failed to remove the 'extra' slashes that were added in anticipation of you using that data in a database query. Use View Source in your browser as you work on this. HTML *also* uses \ in some situations as an escape character, and you can confuse yourself very easily by looking at browser output, instead of what's really there. -- 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: SNMP Support Problem
Fatal error: Call to undefined function: snmpwalk() ... ... and this for all snmp functions. This means that the --with-snmp part of ./configure didn't really work. Go back and do the ./configure again, only like this: ./configure --with-snmp ... 21 configure.output You can use: tail -f configure.output to watch the messages go by (control-c to exit) But you'll have a permanent record of what happened, and you can use vi or joe or pico to look at it and search for 'snmp' and/or 'SNMP' to see what happened. -- 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: empty php.ini
Hi, I am new to PHP. I am running the module version 4.2.2 from Marc Lyanage (entropy.ch) on OS X 10.1 and noticed that my /usr/local/lib/php.ini is empty!? Is there a way Just copy the php.ini-dist from the PHP source tarball or wherever you can find it into there. -- 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: mailing a cookiecontent
if ($REQUEST_METHOD=='POST') { $name = escapeshellcmd($name); $group = escapeshellcmd($group); $to = [EMAIL PROTECTED]; $from = FROM: $name, $group; $subject = The subject of this mail\n\n; $body = Name: $name\t; $body .= Group: $group\n; $body .= \n\n$comments\n\n; mail($to,$subject,$body,$from); exit; } Well, I recieve a mail, but the mailcontent is empty. The cookie string is written to a hidden field like this: document.write('FORMINPUT TYPE=HIDDEN NAME=\comments\ VALUE=\'+cookiestr+'\/FORM'); Get rid of the JavaScript, and just do something like this: $body .= implode(\r\n, $_COOKIE); -- 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: Printing ASCII on Linux Server
Printing works fine, however 2 problems: 1. linefeed (\n) doesn't work 2. escape sequences to print BOLD, ITALIC, UNDERLINE, NARROW don't work Probably the same problem, really. $lp = popen(lpr -Plp1, w); I'm guessing that popen uses the shell or something, and it's eating your control characters. Try things like: $print_string = \$print_string\; $bytes_written = fwrite($lp, $print_string); $print_string = str_replace(\n, \\n, $print_string); $bytes_written = fwrite($lp, $print_string); I suspect that something along those lines of convincing the shell to leave your data alone will fix your problems. It may also be a Good Idea to add: if ($bytes_written != ($strlen = strlen($print_string)){ die(Only wrote $bytes_written of $strlen characters); } -- 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