Re: [PHP] for loop and array
I think you add square brackets: input name='labtype[]' type='checkbox' value='Hepb_ag' so you'd have an array with a numeric key (0-n) and the value of the key would be the value of the input. or perhaps you'd prefer input name='labtype[Hepb_ag]' type='checkbox' value='1' in this case the key of the array would be 'Hepb_ag', and the value would be true (1). In both cases, I don't think anything is set for false values... ie, if 3 out of 5 checkboxes are ticked, the array will have 3 items, not 5. Justin on 25/09/02 4:16 PM, Chris Grigor ([EMAIL PROTECTED]) wrote: Good Morning all I need some help as to how to print this array, its input name is labtype and they all have differnet values. Amylaseinput name='labtype' type='checkbox' value='Amylase' td align=rightCholesterolinput name='labtype' type='checkbox' value='Cholesterol'/td/tr trtd align=rightCMV Ab IgM/Ginput name='labtype' type='checkbox' value='CMV'/td td align=rightGLUCOSE - Fastinginput name='labtype' type='checkbox' value='GLU_Fast'/td/tr trtd align=rightGLUCOSE - Randominput name='labtype' type='checkbox' value='GLU_Rand'/td td align=rightHepatitus B S Aginput name='labtype' type='checkbox' value='Hepb_ag'/td/tr On the page I created if the person selects any of these then it should submit it as name=labtype and value=whatever is selected this works. Now upon getting this info onto my php script how would I say something like for each item in the array labtype, print its value? Any help would be really appreciated, I have had a look at a for loop trying to use the following for ($a=1; $a50; $a++) { echo br$labtype[$a]; } but this is not working for me. Can anyone direct me in the right way ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Installation under WinXP Apache 2.0.39
Sascha Braun wrote: I have a small problem I'm not able to solve. I wanted to install PHP 2.2.3 under WinXP together with an Apache 2.0.39, but after installation and reconfiguration of all Ini's and conf files the service did not start again. Isn't it PHP 4.2.3? ;-)) After starting the Apache manually from command´line it stops with the following error (translatet from german) : Syntax Error on line 174 of C:/Webverzeichnis/bin/apache/conf: Cannot load C:/Webverzeichnis/bin/php/sapi/php4apache2.dll into server: Procedure could not be found. I think this problem is related with the interface change of Apache2. Since version 2.0.39 (?) the interface changed a bit, so some functions don't work. You'll have to compile the php4apache2.dll from PHP 4.3.x and use that with your Apache2. I'll send you one trough e-mail, and hope it works for you. HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: problems with opendir()
Man In The Box wrote: hmm i seem to be having a problem with opendir(). perhaps one of you could shed some light on the subject. here is the line of code (practically right out of the documentation) if ($handle = opendir('$_SERVER[DOCUMENT_ROOT]/files/$dir')) { blah blah blah; } Because you are using single quotes (') the line don't get parsed, and the directory you're pointing at is: $_SERVER[DOCUMENT_ROOT]/files/dir That doesn't seems correct to me, because the $_SERVER part won't be replaced by the actual value. Use $_SERVER['DOCUMENT_ROOT'] . '/files/dir'OR $_SERVER['DOCUMENT_ROOT']/files/dir instead HTH Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] time to seconds
select time_to_sec('00:12:30) ?? From: adi [EMAIL PROTECTED] Date: 2002/09/18 Wed PM 04:54:31 CST To: PHP-General [EMAIL PROTECTED] Subject: [PHP] time to seconds Hi, I have a table table1, with a column Duration time type(ex 00:12:30) I want to make in PHP a sql selection: SELECT * from table1 WHERE condition, and after that, to make sum of values of column Duration and display it. Any Help? How to transform time in seconds, with php functions? tx saYANg forever! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Automatic Form Generation with PHP
Hi We are shortly to release the next version of Form Generator Pro (automatic generation of HTML form/PHP processing code) and are looking for some comments on the way in which we intend to make the software available. Due to the fact that we cannot distribute this PHP application without comprising copyright (the Zend Encoder is not an affordable option for us - we are a small start-up business), the current version of Form Generator Pro is only available for use online at the C U Online site which is fine because 1. it only generates mail forms and 2. it's free. However this won't work for version 2 because version 2 automatically generates forms for MySQL databases by querying the database for table information (field lengths, types etc). Opening up connections from our server to other servers to get database info is not an option - for security reasons (and also many MySQL servers are set up to only accept local connections anyway for this reason). To resolve this problem, the software has been split into 2 parts. The part that retrieves the database information sits on the customers server (secured). Field definitions are then extracted and sent to the generator which remains on our site. I will stress here that no actual database data is sent between the 2 servers, nor any MySQL server usernames or passwords - just the field lengths, types etc of the selected table. Access to the generator will then be sold as opposed to selling the actual software (although mail form generation will remain free). This is not an ideal solution but it seems to be the only way to make the software available and at the same time protect copyright. I would be grateful for any thoughts from other businesses/developers on this solution. Regards Debbie Dyer Software Engineer for C U Online
[PHP] RE: PHP Form and Arrays help
use a hidden input in front of each checkbox with the same name and the value '0' (as opposed to '1' for the checkbox). Tim www.chessish.com -Original Message- From: Tom Ray [mailto:[EMAIL PROTECTED]] Sent: 24 September 2002 17:24 To: [EMAIL PROTECTED] Subject: PHP Form and Arrays help I'm having a small problem with a form I'm designing and I hope someone can point me in the right direction here. The form's function is rather simple actaully. It's supposed to take the information, run through it to make sure all the required fields have data in them, if there is a blank required field it is supposed to redraw the form showing the field missed but also store the data that was already submitted so you don't have to fill the form out all over again. Now I have it so it stores the values of text boxes, drop down menus and radio buttons but I'm having a real tough time with the check box values. Example of what I'm doing: (Gender Selection with Radio Buttons). I declare an array in my PHP by doing $genderarray=array(); Then I store the value of the form for the redraw like so: $mygender=$HTTP_POST_VARS[gender]; $genderarray[$mygender]=checked; In the actaul form I decalre a global: global genderarray(); And under the gender selection I have: input name=gender type=radio value=Male ?= $genderarray[Male] ? (works the same for the Female) Now my question is how can I do this with check boxes. I thought I could through them all into a single array, then pull out the ones who have values to them, but that's not working the way I thought. Any thoughts or suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting a mysql set info
Hi All, I would like to get at the SET information for a particular field in a MySQL database. I know how to get the type, length, name and flags alla the manual pages but; If I have a field which is of type SET ('one','two','three','four') how can I get at this information from within PHP in order to generate a collection of checkboxes for setting the field in HTML. Any Help Much Appreciated Henry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: session_start function breaks flush function in 4.2.1
Michael, Thanks for the detailed reply. After some tests of my own I'd realized it was the trans-sid parameter that was giving me problems. In 4.2.1, php is compiled with this parameter set by default - it would appear. I'll give your idea a try - thou' I'll have to reinstate my script, since I'd written a work around - basically I echo the message, and recall the script with a meta refresh to do the actual processing. Thanks again, Chris Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Chris Andrew [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I use a script which initially sends a friendly message to a browser, and then goes about some lengthy processing. The browser is IE and I am aware of the 256 byte issue. The script worked nicely in php.4.1.1 but since installing 4.2.1, the flush function doesn't do its job. However, it works if I ommit session_start() ? I can't speak for the differences between 4.1.1 and 4.2.1, but maybe the following information will help you: On my site I have a custom error handler than displays a friendly error message screen and emails me an error report. I use output buffering because if an error occurs I don't want this friendly error message screen to be rendered in the middle of whatever else was going on when the error occured...I get the contents of the buffer and then and then call ob_end_clean() to empty it before I display the friendly error message. I noticed that this was not working properly on one section of my site that used sessions. I noticed that if I called session_start() and then an error occured, I got the error message in the middle of the the page, just as if I hadn't cleared the buffer. I then discovered why... I am using trans sid support to perpetuate the session id, and apparently this is implemented internally using an output buffer. Trans sid buffers the page output, then rewrites the hrefs and insert the hidden form values before flushing the buffer to the screen. Apparently you can start multiple buffers, and they are stacked. If you call a buffer function such as ob_end_clean(), it *automatically* operates on the last buffer in the stack...i.e. the buffer that was most recently created. In my case this buffer what the trans sid one, and NOT the one that I started. To make a long story short, I had to end up calling ob_end_clean() TWICE...once to flush the trans sid buffer and once more to flush mine. Maybe something similar is at work with your problem. Try calling the flush function twice back to back and see if that makes any difference... If anyone knows of a way to determine how many output buffers have been started or are currently active please let me know... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting a mysql set info
You need to use SHOW COLUMNS FROM table LIKE 'yoursetfieldname' You can then retrieve the values from the [Type] column which will look like - set('val1','val2'...etc) - you will need to parse this string Debbie - Original Message - From: Henry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 8:57 AM Subject: [PHP] Getting a mysql set info Hi All, I would like to get at the SET information for a particular field in a MySQL database. I know how to get the type, length, name and flags alla the manual pages but; If I have a field which is of type SET ('one','two','three','four') how can I get at this information from within PHP in order to generate a collection of checkboxes for setting the field in HTML. Any Help Much Appreciated Henry -- 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] Newsletter Script
Hi, I wanted to write an Newsletter script. So I created two tables in my Database. One is storing the Newsletters and one is Storing the bunch of folks who want to have them. Everything works fine, I can write the Newsletter very easy in my selfwritten admin tool, but when I send the Newsletter only the first person in the list it getting this awfull Newsletter. Here is the script which sends out the Newsletter: if ($_REQUEST['action'] == 'send') { $Query = SELECT * FROM newsletters_db WHERE id = '.$_REQUEST['id'].'; $Result = mysql_query($Query, $connect); $arrResult = mysql_fetch_array($Result, MYSQL_ASSOC); $MailQuery = SELECT * FROM newsletter_db; $MailResult = mysql_query($MailQuery, $connect); $subject = $arrResult['head']; $message = $arrResult['text']; while ($arrMailResult = mysql_fetch_array($MailResult, MYSQL_ASSOC)) { mail($arrMailResult['address'], $subject, $message, From: webmaster@$SERVER_NAME\r\n .Reply-To: info@$SERVER_NAME\r\n .X-Mailer: PHP/ . phpversion()) or die(mysql_error()); } echo 'p class=text01Newsletter erfolgreich verschickt./p'; } Would be nice if i could get a hint =O) Sascha
Re: [PHP] Getting a mysql set info
Thanks Debbie, Your a star Henry Debbie_dyer [EMAIL PROTECTED] wrote in message 00dc01c2646f$06223dd0$19153c3e@homepc">news:00dc01c2646f$06223dd0$19153c3e@homepc... You need to use SHOW COLUMNS FROM table LIKE 'yoursetfieldname' You can then retrieve the values from the [Type] column which will look like - set('val1','val2'...etc) - you will need to parse this string Debbie - Original Message - From: Henry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 8:57 AM Subject: [PHP] Getting a mysql set info Hi All, I would like to get at the SET information for a particular field in a MySQL database. I know how to get the type, length, name and flags alla the manual pages but; If I have a field which is of type SET ('one','two','three','four') how can I get at this information from within PHP in order to generate a collection of checkboxes for setting the field in HTML. Any Help Much Appreciated Henry -- 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] Ftp_size returns wrong file size
Hi everybody, Does anybody know why ftp_size returns the wrong file size? I get 1069602 bytes instead of 1065635 (which it should be) and 10458669 instead of 10419043. A difference of 3967 and 39626 does not really give me any clues. I know the manual says that not all servers support this feature, but then I suppose I should get -1 and not a numeric size. Regards Rudolf Visagie Principal Software Developer Digital Healthcare Solutions mailto:[EMAIL PROTECTED] Tel: 011 6901019 Cell: 082 895 1598 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Automatic Form Generation with PHP
Hi Debbie, What are you going to do about customers who don't have PHP? To run the field definition extractor part of the system. Henry Debbie_dyer [EMAIL PROTECTED] wrote in message 00a001c26468$80a50530$19153c3e@homepc">news:00a001c26468$80a50530$19153c3e@homepc... Hi We are shortly to release the next version of Form Generator Pro (automatic generation of HTML form/PHP processing code) and are looking for some comments on the way in which we intend to make the software available. Due to the fact that we cannot distribute this PHP application without comprising copyright (the Zend Encoder is not an affordable option for us - we are a small start-up business), the current version of Form Generator Pro is only available for use online at the C U Online site which is fine because 1. it only generates mail forms and 2. it's free. However this won't work for version 2 because version 2 automatically generates forms for MySQL databases by querying the database for table information (field lengths, types etc). Opening up connections from our server to other servers to get database info is not an option - for security reasons (and also many MySQL servers are set up to only accept local connections anyway for this reason). To resolve this problem, the software has been split into 2 parts. The part that retrieves the database information sits on the customers server (secured). Field definitions are then extracted and sent to the generator which remains on our site. I will stress here that no actual database data is sent between the 2 servers, nor any MySQL server usernames or passwords - just the field lengths, types etc of the selected table. Access to the generator will then be sold as opposed to selling the actual software (although mail form generation will remain free). This is not an ideal solution but it seems to be the only way to make the software available and at the same time protect copyright. I would be grateful for any thoughts from other businesses/developers on this solution. Regards Debbie Dyer Software Engineer for C U Online -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Visual Studio .NET as PHP IDE
Does anyone use VStudio .NET as your IDE in developing PHP Scripts? If so, have you found a way to make it so that it understands PHP? In particular color coding and the understanding of where functions start and end (for the solution explorer, etc). I was not using VStudio .NET but if I know Microsoft they try to cut using any other no-microsoft technologies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why my php pages are cached in browsers?
In browsers, my php pages are cached. All the code that is returned by php are stored. In version 4.1 this not ocurred, anybody can help me? First: Check if you send headers: header('Pragma: no-cache'); header('Expires: Thu, 01 Jan 1970 01:00:00 GMT'); header('Cache-Control: no-cache, must-revalidate, private'); Second: If your appache sends HTTP 1.0 try to change to HTTP 1.1. HTTP 1.0 do not know Cache-Control. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why my php pages are cached in browsers?
In the german apache Mailinglist somebody wrote some like this: a) aktivate the modul mod_expires.so b) Fill in the lines # enable expirations ExpiresActive On # expire php pages after a minute in the client's cache ExpiresByType text/php A6 into httpd.conf But I don't really know if it works (:0 Thought about I maybe have to write application/x-httpd-php instead of text/php Please tell me if it works Sascha In browsers, my php pages are cached. All the code that is returned by php are stored. In version 4.1 this not ocurred, anybody can help me? First: Check if you send headers: header('Pragma: no-cache'); header('Expires: Thu, 01 Jan 1970 01:00:00 GMT'); header('Cache-Control: no-cache, must-revalidate, private'); Second: If your appache sends HTTP 1.0 try to change to HTTP 1.1. HTTP 1.0 do not know Cache-Control. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Automatic Form Generation with PHP
Hi Henry Well the software generates the code to process the forms as well (eg for an insert form the code to check required fields are not empty, perform any data validation and insert the record into the db) as well as the forms themselves and this code is in PHP. You can choose to generate a sticky form where you would get 1 PHP page (containing a mixture of PHP and HTML) or non-sticky where you would get separate HTML PHP pages for the forms/processing. Because all this generated processing code is in PHP customers who don't have PHP either wouldn't be interested in the software or if they were interested in the software they would need to install it - both to use the software and also to be able to use the processing code that it generated. Debbie - Original Message - From: Henry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 10:05 AM Subject: [PHP] Re: Automatic Form Generation with PHP Hi Debbie, What are you going to do about customers who don't have PHP? To run the field definition extractor part of the system. Henry Debbie_dyer [EMAIL PROTECTED] wrote in message 00a001c26468$80a50530$19153c3e@homepc">news:00a001c26468$80a50530$19153c3e@homepc... Hi We are shortly to release the next version of Form Generator Pro (automatic generation of HTML form/PHP processing code) and are looking for some comments on the way in which we intend to make the software available. Due to the fact that we cannot distribute this PHP application without comprising copyright (the Zend Encoder is not an affordable option for us - we are a small start-up business), the current version of Form Generator Pro is only available for use online at the C U Online site which is fine because 1. it only generates mail forms and 2. it's free. However this won't work for version 2 because version 2 automatically generates forms for MySQL databases by querying the database for table information (field lengths, types etc). Opening up connections from our server to other servers to get database info is not an option - for security reasons (and also many MySQL servers are set up to only accept local connections anyway for this reason). To resolve this problem, the software has been split into 2 parts. The part that retrieves the database information sits on the customers server (secured). Field definitions are then extracted and sent to the generator which remains on our site. I will stress here that no actual database data is sent between the 2 servers, nor any MySQL server usernames or passwords - just the field lengths, types etc of the selected table. Access to the generator will then be sold as opposed to selling the actual software (although mail form generation will remain free). This is not an ideal solution but it seems to be the only way to make the software available and at the same time protect copyright. I would be grateful for any thoughts from other businesses/developers on this solution. Regards Debbie Dyer Software Engineer for C U Online -- 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] exec(echo ... issuse
Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Automatic Form Generation with PHP
Hi Debbie, That's fair enough. How are you ensure that only valid servers request information from the field enquiry part? Otherwise people might be able to use this part to gain access to the database structure if not the actual data. Henry. Debbie_dyer [EMAIL PROTECTED] wrote in message 00f501c26476$49fcd4a0$19153c3e@homepc">news:00f501c26476$49fcd4a0$19153c3e@homepc... Hi Henry Well the software generates the code to process the forms as well (eg for an insert form the code to check required fields are not empty, perform any data validation and insert the record into the db) as well as the forms themselves and this code is in PHP. You can choose to generate a sticky form where you would get 1 PHP page (containing a mixture of PHP and HTML) or non-sticky where you would get separate HTML PHP pages for the forms/processing. Because all this generated processing code is in PHP customers who don't have PHP either wouldn't be interested in the software or if they were interested in the software they would need to install it - both to use the software and also to be able to use the processing code that it generated. Debbie - Original Message - From: Henry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 10:05 AM Subject: [PHP] Re: Automatic Form Generation with PHP Hi Debbie, What are you going to do about customers who don't have PHP? To run the field definition extractor part of the system. Henry Debbie_dyer [EMAIL PROTECTED] wrote in message 00a001c26468$80a50530$19153c3e@homepc">news:00a001c26468$80a50530$19153c3e@homepc... Hi We are shortly to release the next version of Form Generator Pro (automatic generation of HTML form/PHP processing code) and are looking for some comments on the way in which we intend to make the software available. Due to the fact that we cannot distribute this PHP application without comprising copyright (the Zend Encoder is not an affordable option for us - we are a small start-up business), the current version of Form Generator Pro is only available for use online at the C U Online site which is fine because 1. it only generates mail forms and 2. it's free. However this won't work for version 2 because version 2 automatically generates forms for MySQL databases by querying the database for table information (field lengths, types etc). Opening up connections from our server to other servers to get database info is not an option - for security reasons (and also many MySQL servers are set up to only accept local connections anyway for this reason). To resolve this problem, the software has been split into 2 parts. The part that retrieves the database information sits on the customers server (secured). Field definitions are then extracted and sent to the generator which remains on our site. I will stress here that no actual database data is sent between the 2 servers, nor any MySQL server usernames or passwords - just the field lengths, types etc of the selected table. Access to the generator will then be sold as opposed to selling the actual software (although mail form generation will remain free). This is not an ideal solution but it seems to be the only way to make the software available and at the same time protect copyright. I would be grateful for any thoughts from other businesses/developers on this solution. Regards Debbie Dyer Software Engineer for C U Online -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newsletter Script
Shouldn't you have some selection criteria after $MailQuery = SELECT * FROM newsletter_db; such as WHERE `newsletterID`=$_REQUEST['id']; ?? Other than that if its not dying and you actuall do have more than one recipient I cannot see it. Henry Sascha Braun [EMAIL PROTECTED] wrote in message 001901c26470$3c6fcd70$0a7652d9@squitta">news:001901c26470$3c6fcd70$0a7652d9@squitta... Hi, I wanted to write an Newsletter script. So I created two tables in my Database. One is storing the Newsletters and one is Storing the bunch of folks who want to have them. Everything works fine, I can write the Newsletter very easy in my selfwritten admin tool, but when I send the Newsletter only the first person in the list it getting this awfull Newsletter. Here is the script which sends out the Newsletter: if ($_REQUEST['action'] == 'send') { $Query = SELECT * FROM newsletters_db WHERE id = '.$_REQUEST['id'].'; $Result = mysql_query($Query, $connect); $arrResult = mysql_fetch_array($Result, MYSQL_ASSOC); $MailQuery = SELECT * FROM newsletter_db; $MailResult = mysql_query($MailQuery, $connect); $subject = $arrResult['head']; $message = $arrResult['text']; while ($arrMailResult = mysql_fetch_array($MailResult, MYSQL_ASSOC)) { mail($arrMailResult['address'], $subject, $message, From: webmaster@$SERVER_NAME\r\n .Reply-To: info@$SERVER_NAME\r\n .X-Mailer: PHP/ . phpversion()) or die(mysql_error()); } echo 'p class=text01Newsletter erfolgreich verschickt./p'; } Would be nice if i could get a hint =O) Sascha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: exec(echo ... issuse
use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: exec(echo ... issuse
Oops, I didn't read on Sorry Henry Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: exec(echo ... issuse
Have you tried using single quotes arround the main string? i.e. 'echo echo blah blah' Henry Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: exec(echo ... issuse
Hi Henry, From: Henry [mailto:[EMAIL PROTECTED]] Have you tried using single quotes arround the main string? i.e. 'echo echo blah blah' I have tried serveral of version, maybe you could give me your example from the lines below. I couldnt work it out ;( Henry Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] looping through array with list()/each()
OK so I've done this hundreds of times, but this time I cannot get it to work. Please cast an eye over the following code and output and tell me why $k and $v are not being set: Code: - $ser = array( 'first', 'second', 'third', 'fourth', 'fifth' ); reset($ser); while ( list($key, $val) = each($ser) ); { echo \$key = $key, \$val = $valbr; } - Output: -- $key = , $val = -- I tried giving the $ser array numeric keys and string keys, both made no difference. thanks, - Kev ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] looping through array with list()/each()
I meant $key and $val of course :o) - Kev -Original Message- From: Kevin Porter [SMTP:[EMAIL PROTECTED]] Sent: 25 September 2002 12:00 To: '[EMAIL PROTECTED]' Subject: [PHP] looping through array with list()/each() OK so I've done this hundreds of times, but this time I cannot get it to work. Please cast an eye over the following code and output and tell me why $k and $v are not being set: Code: - $ser = array( 'first', 'second', 'third', 'fourth', 'fifth' ); reset($ser); while ( list($key, $val) = each($ser) ); { echo \$key = $key, \$val = $valbr; } - Output: -- $key = , $val = -- I tried giving the $ser array numeric keys and string keys, both made no difference. thanks, - Kev ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] looping through array with list()/each()
while ( list($key, $val) = each($ser) ); --- ; should not be here -Original Message- From: Kevin Porter [mailto:[EMAIL PROTECTED]] Sent: 25 September 2002 12:13 To: Kevin Porter; '[EMAIL PROTECTED]' Subject: RE: [PHP] looping through array with list()/each() I meant $key and $val of course :o) - Kev -Original Message- From: Kevin Porter [SMTP:[EMAIL PROTECTED]] Sent: 25 September 2002 12:00 To: '[EMAIL PROTECTED]' Subject: [PHP] looping through array with list()/each() OK so I've done this hundreds of times, but this time I cannot get it to work. Please cast an eye over the following code and output and tell me why $k and $v are not being set: Code: - $ser = array( 'first', 'second', 'third', 'fourth', 'fifth' ); reset($ser); while ( list($key, $val) = each($ser) ); { echo \$key = $key, \$val = $valbr; } - Output: -- $key = , $val = -- I tried giving the $ser array numeric keys and string keys, both made no difference. thanks, - Kev ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] looping through array with list()/each()
Thank you, thank you, thank you. And, er, D'oh! :o) - Kev -Original Message- From: Karl Phillipson [SMTP:[EMAIL PROTECTED]] Sent: 25 September 2002 12:13 To: [EMAIL PROTECTED] Subject: RE: [PHP] looping through array with list()/each() while ( list($key, $val) = each($ser) ); --- ; should not be here -Original Message- From: Kevin Porter [mailto:[EMAIL PROTECTED]] Sent: 25 September 2002 12:13 To: Kevin Porter; '[EMAIL PROTECTED]' Subject: RE: [PHP] looping through array with list()/each() I meant $key and $val of course :o) - Kev -Original Message- From: Kevin Porter [SMTP:[EMAIL PROTECTED]] Sent: 25 September 2002 12:00 To: '[EMAIL PROTECTED]' Subject:[PHP] looping through array with list()/each() OK so I've done this hundreds of times, but this time I cannot get it to work. Please cast an eye over the following code and output and tell me why $k and $v are not being set: Code: - $ser = array( 'first', 'second', 'third', 'fourth', 'fifth' ); reset($ser); while ( list($key, $val) = each($ser) ); { echo \$key = $key, \$val = $valbr; } - Output: -- $key = , $val = -- I tried giving the $ser array numeric keys and string keys, both made no difference. thanks, - Kev ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.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 ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Automatic Form Generation with PHP
Hi Henry On set up of the side of the software that sits on the customers server a table is created for users. Adminstration screens are provided for adding/deleting users and a user can only gain access by logging in and they can only log in if a record exists in this table. The whole thing (on this side) is secured by cookies. After logging in the software attempts to connect to a MySQL database using the host, username, pass db name specified in a mysqlvars.php file - these vars are never passed across the network. No usernames/passwords either for MySQL or access to the software are stored in the cookie - the cookie is authenticated using a checksum value. The generator side is secured by sessions but again no MySQL vars are sent across nor any access usernames/passwords for the customer software. What is sent between the servers is: 1. the customers email address and password for the generator (encoded and different from their MySQL/customer software username/passwords) and. 2. table structure information which has been retrieved. This information could of course be intercepted but could be of no use to a hacker without a valid username and password for the MySQL database. If you disagree please tell me. It's this aspect of the software (security) that causes most concern as with any application enabling online access to databases. Debbie - Original Message - From: Henry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 11:14 AM Subject: Re: [PHP] Re: Automatic Form Generation with PHP Hi Debbie, That's fair enough. How are you ensure that only valid servers request information from the field enquiry part? Otherwise people might be able to use this part to gain access to the database structure if not the actual data. Henry. Debbie_dyer [EMAIL PROTECTED] wrote in message 00f501c26476$49fcd4a0$19153c3e@homepc">news:00f501c26476$49fcd4a0$19153c3e@homepc... Hi Henry Well the software generates the code to process the forms as well (eg for an insert form the code to check required fields are not empty, perform any data validation and insert the record into the db) as well as the forms themselves and this code is in PHP. You can choose to generate a sticky form where you would get 1 PHP page (containing a mixture of PHP and HTML) or non-sticky where you would get separate HTML PHP pages for the forms/processing. Because all this generated processing code is in PHP customers who don't have PHP either wouldn't be interested in the software or if they were interested in the software they would need to install it - both to use the software and also to be able to use the processing code that it generated. Debbie - Original Message - From: Henry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 10:05 AM Subject: [PHP] Re: Automatic Form Generation with PHP Hi Debbie, What are you going to do about customers who don't have PHP? To run the field definition extractor part of the system. Henry Debbie_dyer [EMAIL PROTECTED] wrote in message 00a001c26468$80a50530$19153c3e@homepc">news:00a001c26468$80a50530$19153c3e@homepc... Hi We are shortly to release the next version of Form Generator Pro (automatic generation of HTML form/PHP processing code) and are looking for some comments on the way in which we intend to make the software available. Due to the fact that we cannot distribute this PHP application without comprising copyright (the Zend Encoder is not an affordable option for us - we are a small start-up business), the current version of Form Generator Pro is only available for use online at the C U Online site which is fine because 1. it only generates mail forms and 2. it's free. However this won't work for version 2 because version 2 automatically generates forms for MySQL databases by querying the database for table information (field lengths, types etc). Opening up connections from our server to other servers to get database info is not an option - for security reasons (and also many MySQL servers are set up to only accept local connections anyway for this reason). To resolve this problem, the software has been split into 2 parts. The part that retrieves the database information sits on the customers server (secured). Field definitions are then extracted and sent to the generator which remains on our site. I will stress here that no actual database data is sent between the 2 servers, nor any MySQL server usernames or passwords - just the field lengths, types etc of the selected table. Access to the generator will then be sold as opposed to selling the actual software (although mail form generation will remain free). This is not an ideal solution but it seems to be the only way to make the software available and at the same time protect
Re: [PHP] Re: exec(echo ... issuse
How about ?php $command=\`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes\ | smbclient -M $popup_1 $script; exec(echo \$command\); ? Mario Ohnewald [EMAIL PROTECTED] wrote in message 001901c26480$5e280df0$350aa8c0@W2KDP">news:001901c26480$5e280df0$350aa8c0@W2KDP... Hi Henry, From: Henry [mailto:[EMAIL PROTECTED]] Have you tried using single quotes arround the main string? i.e. 'echo echo blah blah' I have tried serveral of version, maybe you could give me your example from the lines below. I couldnt work it out ;( Henry Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MyPHPNuke1.8.8-1 *** Nuked ***
Some themes are not as fully worked out as they should be. At the MySQL console, use this to reset the them to PostnukeSilver. mysql update nuke_module_vars set pn_value = 's:14:PostNukeSilver;' where pn_id = '9' The s denotes a string The 14 is the length of the theme name Make certain the name you use matches the case used in the directory holding the theme. The closing ; must be included. I also tried clicking and swearing, but the system would not respond. g Hope this helps - Miles Thompson At 03:58 AM 9/25/2002 +0100, James Redfern wrote: I used Update System on my E-smith server to install dmc-mitel-myphpnuke-1.8.8.-1.noarch.rpm without errors. Looked good but I thought I'd change the theme, so after having read the manual for 30 minutes, logged in as God and selected a yellow one. It started to load and then stopped with just a header. And that's as far as I got. Now I have no access to the interface or admin as there are no working links on the page. No amount of clicking, refreshing or swearing at it seems to work. Any ideas? I even tried to uninstall it but RPM reports an error and says it isn't installed. It seems I'm damned if I do and damned if I don't! JR. -- James Redfern [The Redfern Organization] PGP Auto-responder mailto:[EMAIL PROTECTED]?subject=0xCB81E8E8 Fingerprint: 6809 FE89 4CEF E76F C6DF 04BF 46DC 58B9 CB81 E8E8 ...You always suppress momentary anger at something you deeply and permanently hate--Robert M. Persig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: looping through array with list()/each()
Please cast an eye over the following code and output and tell me why $k and $v are not being set: Code: - $ser = array( 'first', 'second', 'third', 'fourth', 'fifth' ); reset($ser); while ( list($key, $val) = each($ser) ); { echo \$key = $key, \$val = $valbr; } Small typo: while ( list($key, $val) = each($ser) ); change into: while ( list($key, $val) = each($ser) ) Remove the ; HTH Erwin P.S.: Take a break ;-)) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] slashes added before '
this code snippet: function save($file) { $my_file=fopen($file,wb); $my_status=fwrite($my_file,$text); fclose($my_file); } is intended to overwrite a file or create a file and write to it from a string that's already containing text. the problem is the after the script writes the file i find \ before all single and double qoutes in the whole file this problem occured on red hat linux but in windows it didn't happen. can any one help? khalid _ 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] table-wide or database-wide search and replace?
-Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 1:19 AM To: [EMAIL PROTECTED]; 'php' Subject: Re: [PHP] table-wide or database-wide search and replace? [snip] Give it a database name, the program find all the names of the tables, then loops through them all. It find all the rows for each table (maybe limit to just text based ones, to be fancy), and makes an sql statement to call the ereg. To really be feasible, you'd want to use the replace and regex functions already in MySQL. Only issues you may run into is the 30 second time limit... good point... specifically, is that a time limit imposed by mysql, php or the browser you are referring to? PHP limitation that scripts have 30 seconds to complete. This can be changed in PHP.ini or with a function call at the beginning of the script. because i could do this on the command line (once off), and could also break the process into individual tables, or even groups of 50 rows or something if needed -- although i'd do almost anything to avoid it :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] slashes added before '
Use stripslashes() on the text before you write it to the file. Where is this text coming from? The slashes are probably getting added by magic_quotes. ---John Holmes... -Original Message- From: Khalid El-Kary [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 8:08 AM To: [EMAIL PROTECTED] Subject: [PHP] slashes added before ' this code snippet: function save($file) { $my_file=fopen($file,wb); $my_status=fwrite($my_file,$text); fclose($my_file); } is intended to overwrite a file or create a file and write to it from a string that's already containing text. the problem is the after the script writes the file i find \ before all single and double qoutes in the whole file this problem occured on red hat linux but in windows it didn't happen. can any one help? khalid _ 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
Re: [PHP] XSLT
I was able to pass parameters to the xsl stylesheet like this: ?php $args = array(); $params[test] = parameter_to_pass; // create XSLT processor $xh = xslt_create(); // call xslt processor // Process the document $result = xslt_process($xh, $xmlfile, $xslfile, NULL, $args, $params); if ($result) { print $result; } else { print Sorry, the xml could not be transformed by the xsl into; print the \$result variable the reason is that . xslt_error($xh) . print and the error code is . xslt_errno($xh); } xslt_free($xh); ? Then in the stylesheet do this (The parameter must be defined before any template is declared): ?xml version=1.0 encoding=iso-8859-1 ? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:output method=html indent=yes/ xsl:param name=test / xsl:template match=/ html head titleYour html page/title /head body bgcolor=#FF xsl:value-of select=$test/ /body /html /xsl:template /xsl:stylesheet This will print parameter_to_pass to the browser On Tue, 2002-09-24 at 22:33, [EMAIL PROTECTED] wrote: I'm wondering if there is a way to include a query string parameter in an xsl stylesheet. I have a script that does this: xslt_process($xsltprocessor,$xml,$xsl); I'd like to include the value of a variable passed to this script via a query string (eg. xmlscript.php?p=3 ), whereby the value '3' is passed to the xsl stylesheet somehow. The xsl stylesheet should then only process section 3 of the xml document. I've played about with extra arguments to xslt_process and xsl:param name=p/ to no avail. Hope this is clear enough. TIA Mick MICHAEL HALL Web Development Officer Batchelor Institute of Indigenous Tertiary Education W: [EMAIL PROTECTED](08) 8951 8352 H: [EMAIL PROTECTED](08) 8953 1442 -- 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] pretty simple problem in mailing a dynamic page
I just want to email a dynamic page ( So I designed a page consisting of datas pulled from db and are formated with html tags: here in below code $d is such variable to be mailed) But the problem is that, instead the code contained in $d is sent. The code is as such: $ebody=html$d/html; mail([EMAIL PROTECTED], The subject,$ebody,From: [EMAIL PROTECTED]\r\n); Cna anyone give me solution for this pretty simple problem. Regards Usha
Re: [PHP] slashes added before '
You probably have magic_quotes_gpc in php.ini off on your Windows platform and on on your Linux platform Magic_quotes_gpc automatically applies addslashes to POST, GET and cookie data if its on. Use stripslashes to remove it or to write code thats portable - write a function like:- function stripData($data) { return ini_get('magic_quotes_gpc') ? stripslashes($data) : $data; } Debbie - Original Message - From: Khalid El-Kary [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 1:07 PM Subject: [PHP] slashes added before ' this code snippet: function save($file) { $my_file=fopen($file,wb); $my_status=fwrite($my_file,$text); fclose($my_file); } is intended to overwrite a file or create a file and write to it from a string that's already containing text. the problem is the after the script writes the file i find \ before all single and double qoutes in the whole file this problem occured on red hat linux but in windows it didn't happen. can any one help? khalid _ 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] Session testing on local machine
Hi, I was wondering if somebody could tell me how to get sessions to work on my local machine. I am using easyPhp 1.6 to run my design platform, but have been unable to get the sessions to work. I tried the pages on a website and all worked so its not the scripts. Any suggestions appreciated. Thanks Will -- ICQ # 133565401 === So many times it's hopeless dark and grey No way out And other times it's hope that saves the day - - Jon Schaffer (Demons Wizards / Iced Earth)
RE: [PHP] Re: exec(echo ... issuse
Hi Henry! From: Henry [mailto:[EMAIL PROTECTED]] How about ?php $command=\`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes\ | smbclient -M $popup_1 $script; exec(echo \$command\); ? Nope, hasnt worked either ;( any other idea? this is quite important ;) Cheers, Mario Mario Ohnewald [EMAIL PROTECTED] wrote in message 001901c26480$5e280df0$350aa8c0@W2KDP">news:001901c26480$5e280df0$350aa8c0@W2KDP... Hi Henry, From: Henry [mailto:[EMAIL PROTECTED]] Have you tried using single quotes arround the main string? i.e. 'echo echo blah blah' I have tried serveral of version, maybe you could give me your example from the lines below. I couldnt work it out ;( Henry Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario 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] pretty simple problem in mailing a dynamic page
You need to add another header telling it the content type = text/html On Wed, 2002-09-25 at 17:04, usha wrote: I just want to email a dynamic page ( So I designed a page consisting of datas pulled from db and are formated with html tags: here in below code $d is such variable to be mailed) But the problem is that, instead the code contained in $d is sent. The code is as such: $ebody=html$d/html; mail([EMAIL PROTECTED], The subject,$ebody,From: [EMAIL PROTECTED]\r\n); Cna anyone give me solution for this pretty simple problem. Regards Usha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: exec(echo ... issuse
this must work: exec('echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 minutes | smbclient -M '. $compname); Mario Ohnewald wrote: Hi Henry! From: Henry [mailto:[EMAIL PROTECTED]] How about ?php $command=\`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes\ | smbclient -M $popup_1 $script; exec(echo \$command\); ? Nope, hasnt worked either ;( any other idea? this is quite important ;) Cheers, Mario Mario Ohnewald [EMAIL PROTECTED] wrote in message 001901c26480$5e280df0$350aa8c0@W2KDP">news:001901c26480$5e280df0$350aa8c0@W2KDP... Hi Henry, From: Henry [mailto:[EMAIL PROTECTED]] Have you tried using single quotes arround the main string? i.e. 'echo echo blah blah' I have tried serveral of version, maybe you could give me your example from the lines below. I couldnt work it out ;( Henry Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... use \ instead of so that you don't actually end the string Henry Mario Ohnewald [EMAIL PROTECTED] wrote in message 001801c2647a$070aa100$350aa8c0@W2KDP">news:001801c2647a$070aa100$350aa8c0@W2KDP... Hello! I want to write a line into a file (called $script) wich goes like that: echo `date` 192.168.10.123 is down, lets call the admin. I was sleeping for 10 Minutes | smbclient -M Computer This is what i have tried: exec(echo echo `date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1 Minutes | smbclient -M $popup_1 $script); The problem is that after exec(echo its command ends due to that . I tried \ to let php ignore this but then it doesn´t write my anymore: exec(echo \echo \`date` === $ip is down, lets call the admin. I was sleeping for $var_timer_rechner1\ | smbclient -M $popup_1\ $script); this is the result: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server but i want: echo Wed Sep 25 12:29:17 CEST 2002 === 192.168.10.1 is down, lets call the admin. I was sleeping for | smbclient -M Server ^^ ^^ missing missing Can anyone tell me where the my mistake is? Cheers, Mario 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
[PHP] replacing literal in string
Could somebody help me with the correct syntax for an ereg_replace to replace literal occurences of the quote character in a string. I can't seem to get it right. In other words, I have a form input variable -- that literally may look like this: some_value, and I want it to literally look like this: some_value. I tried: $key=str_replace (\, , $key); and other variations but can't get it to work. What am I missing? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] replacing literal in string
Could somebody help me with the correct syntax for an ereg_replace to replace literal occurences of the quote character in a string. I can't seem to get it right. In other words, I have a form input variable -- that literally may look like this: some_value, and I want it to literally look like this: some_value. I tried: $key=str_replace (\, , $key); and other variations but can't get it to work. What am I missing? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Authentication on NT??
Hi I have installed PHP on a Windows NT Server 4.0 and it works (almost) fine! The thing is that I get the Enter network password - prompt when I first go to a PHP-file. Not if I go to an ASP file. So if I just hit enter in the prompt, I get in to the PHP-page and can continue surfing. I guess it has something with Anonymous user to do, but I dont know what?! Per L. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question
I have variables $sk1,$fr2,$fr3,$sk4, how i write values in this variables in statement for... roman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pretty simple problem in mailing a dynamic page
Multipart Mime messages... you can't just put HTML source in an email... See Manuel's class on phpclasses.org for Regards, Justin French on 26/09/02 3:04 AM, usha ([EMAIL PROTECTED]) wrote: I just want to email a dynamic page ( So I designed a page consisting of datas pulled from db and are formated with html tags: here in below code $d is such variable to be mailed) But the problem is that, instead the code contained in $d is sent. The code is as such: $ebody=html$d/html; mail([EMAIL PROTECTED], The subject,$ebody,From: [EMAIL PROTECTED]\r\n); Cna anyone give me solution for this pretty simple problem. Regards Usha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] where's waldo
hi all. i'm interested in creating a php game that generates a page of random (ish) images, one of which is waldo (or the like). when the player clicks on waldo, they're taken to the next, slightly harder level. anyone think that sounds fun? any pointers, tips, advice, criticisms? -- -- http://kennethlove.onewingedangel.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pdflib output reolution higher than 72 dpi possible?
Hi there, I would like to output a pdf with pdflib with 300 dpi How could I define the output resolution? Default seems to be 72 dpi Thanx for any hint, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Set a default global - $_GET[]
How do i set a default value for a url parameter ($_GET[..]) in PHP 4.1? I currently have a class that sets a default global value but this does not work in this version - the script displays an error if no url value is passed in the url. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stress Test Script?
Does anyone have a good php script that will test (i.e. benchmark) my MySQL machine and my Web server? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where's waldo
This is for java, javascript, or flash, not much to do for php. Kenneth Love wrote: hi all. i'm interested in creating a php game that generates a page of random (ish) images, one of which is waldo (or the like). when the player clicks on waldo, they're taken to the next, slightly harder level. anyone think that sounds fun? any pointers, tips, advice, criticisms? -- -- http://kennethlove.onewingedangel.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Set a default global - $_GET[]
How do i set a default value for a url parameter ($_GET[..]) in PHP 4.1? I currently have a class that sets a default global value but this does not work in this version - the script displays an error if no url value is passed in the url. if(!isset($_GET['...'])) { $_GET['...'] == default value; } ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stress Test Script?
Hi Jay, Does anyone have a good php script that will test (i.e. benchmark) my MySQL machine and my Web server? Give ab a go - it comes with Apache, you should find it in your bin/ directory. man ab for all the gory details. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] where's waldo
True. Perhaps. But, I think, you can actually do something like that WITH php. Say PHP+Flash or PHP+Javascript... Of course, if you're able to do something like this just by using PHP+Javascript (and HTML only), most probably, you can just take a peek at the code and find out where waldo is... ;) - E On Thursday, September 26, 2002 12:12 AM Marek Kilimajer wrote: This is for java, javascript, or flash, not much to do for php. Kenneth Love wrote: hi all. i'm interested in creating a php game that generates a page of random (ish) images, one of which is waldo (or the like). when the player clicks on waldo, they're taken to the next, slightly harder level. anyone think that sounds fun? any pointers, tips, advice, criticisms? -- -- http://kennethlove.onewingedangel.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] where's waldo
One more thing... if you store your 'waldo co-ordinates' data in a text file, make sure it is in a directory outside of the webtree... - Kev -Original Message- From: Kevin Porter [SMTP:[EMAIL PROTECTED]] Sent: 25 September 2002 16:52 To: '@ Edwin'; Marek Kilimajer Cc: [EMAIL PROTECTED] Subject: RE: [PHP] where's waldo Or, a simple way... When you show your image, make sure it is a form submit button of 'type=image'. On the PHP side you know the X and Y co-ordinates of waldo. When the user clicks on the image, the place they clicked on the image is passed along the URL in 'x' and 'y' variables. On the PHP side, check if their co-ordinates are close enough, if so give them the next (harder) image. If they're not near enough, make sure they get served a 'sorry - try again' message followed by the same image. That should work, yeah? I used to do spot the ball competitions this way at least... HTH, - Kev -Original Message- From: @ Edwin [SMTP:[EMAIL PROTECTED]] Sent: 25 September 2002 16:40 To: Marek Kilimajer Cc: [EMAIL PROTECTED] Subject:Re: [PHP] where's waldo True. Perhaps. But, I think, you can actually do something like that WITH php. Say PHP+Flash or PHP+Javascript... Of course, if you're able to do something like this just by using PHP+Javascript (and HTML only), most probably, you can just take a peek at the code and find out where waldo is... ;) - E On Thursday, September 26, 2002 12:12 AM Marek Kilimajer wrote: This is for java, javascript, or flash, not much to do for php. Kenneth Love wrote: hi all. i'm interested in creating a php game that generates a page of random (ish) images, one of which is waldo (or the like). when the player clicks on waldo, they're taken to the next, slightly harder level. anyone think that sounds fun? any pointers, tips, advice, criticisms? -- -- http://kennethlove.onewingedangel.com -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] replacing literal in string
Robert, That str_replace() you wrote should work. But you might also try these variations.. $key = str_replace('', '', $key); $key = str_replace(chr(34), '', $key); Good luck, Kevin - Original Message - From: ROBERT MCPEAK [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 7:52 AM Subject: [PHP] replacing literal in string Could somebody help me with the correct syntax for an ereg_replace to replace literal occurences of the quote character in a string. I can't seem to get it right. In other words, I have a form input variable -- that literally may look like this: some_value, and I want it to literally look like this: some_value. I tried: $key=str_replace (\, , $key); and other variations but can't get it to work. What am I missing? Thanks! -- 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] where's waldo
Good idea! And your idea about this is also great: input type="image" src="myimage.xxx" name="thename" / It should work... I forgot that there was someting like that in HTML... :) - E On Thursday, September 26, 2002 12:55 AM Subject: RE: [PHP] where's waldo Kevin Porter wrote: snip One more thing... if you store your 'waldo co-ordinates' data in a text file, make sure it is in a directory outside of the webtree... /snip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] authenticating and redirecting with special access
Chris, That is a very good point. As stupid as it sounds, I forgot about the include() statement (still new I guess, not used to all this extra cool stuff!). When I was suggesting the .htaccess, I was thinking more of the require valid-user and thinking maybe the php could tell it whether it is a valid user, but now as I look at my logs, the php login doesn't actually log the same type of username, so I guess that wouldn't work. I'm curious though, the file I need to include is just an html file, and also has links to others in that same directory (along with images). ow will this work, since the links would be trying to point to something in a web location? Thanks for all your help! Bryan On Tue, 24 Sep 2002, Chris Shiflett wrote: |Bryan, | |A .htaccess file is a Web server configuration file. It cannot know what |sort of PHP code you have in place to authenticate a user. :-) | |As has been suggested by someone else, you should place your restricted |files outside of document root. In PHP, it is a simple matter of an |include() to display the file: | |include(/path/to/file.inc); | |Also, this method keeps you from doing this redirecting you are talking |about. Unnecessary redirections like that double your traffic, which is |not a good idea. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Time is off?
Hello, I am trying to figure out why Squirrel Mail is giving the wrong time. I did a basic script ? echo date('h:I'); ? and the time is off in that script too. I have checked the server time and the server hardware clock. They are both on. Does anyone know a reason that the php time would be off? I am thinking maybe a setting in the php.ini or something? Thanks for any help, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com http://www.webintellects.com/
[PHP] Cronjob
I have PHP installed on a Cobalt RaQ550. I know there are two ways of installing PHP, one as a binary, and one as an Apache module. I am pretty sure PHP gets installed as an Apache module for the Cobalt installation. My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: RE: [PHP] where's waldo
I received this shortly after posting to this list. Anyone else get one of these? I'm confused... thanks, - Kev -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: 25 September 2002 17:10 To: [EMAIL PROTECTED] Subject: Re: RE: [PHP] where's waldo We have received a request to add your email address to the Interstate Auction email notification list. If you wish to have your email address removed, please reply with the word REMOVE followed by your email address as the subject. Thank you. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cronjob
You could setup cron to run lynx or some other command line web browser... something like: 0 * * * * /path/to/lynx -dump http://server/path/to/script.php /dev/null 21 Then as the first thing in that script you will probably want to set the time limit to 0 so it doesn't time out... On Wed, 25 Sep 2002, Daren Cotter wrote: I have PHP installed on a Cobalt RaQ550. I know there are two ways of installing PHP, one as a binary, and one as an Apache module. I am pretty sure PHP gets installed as an Apache module for the Cobalt installation. My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.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] Output Buffering - Am I using it correctly?
Howdy group! I am outputting a rather large data set to an Excel spreadsheet from a MySQL database on a healthy FreeBSD server. The Apache server is on the same server as the database. The code looks like this ? /* ** SWB CABS Project ** USOC Charges Detail ** Report By Criteria - Spreadsheet */ // open output buffer ob_start(); // excel headers header(Content-Type: application/vnd.ms-excel); header(Content-Disposition: inline; filename=\excel.xls\); header(Expires: 0); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); /* ** lots of code that gets roughly ** 15,000 - 20,000 rows of data ** each row is 209 bytes of data */ // close output buffer ob_end_flush(); ? Now, even though I have set ob_start() the headers get sent (as it says in the docs; While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer. ) The Task Manager shows that the processes on my local machine for EXCEL.EXE go to the maximum available CPU cycles and stays there until the spreadsheet is either delivered or the system times out. I thought that using output buffering would lower use of client system resources. Is this not true? Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Time is off?
Hi Brandon, I did a basic script ? echo date('h:I'); ? and the time is off in that script [...] I have checked the server time and the server hardware clock. Well, date(h:I) means display the hours (in 12-hour format), followed by a colon, followed by a 1 or a 0 depending on whether daylight saving is in effect, so you're unlikely to get the correct time from it ;-) Give either date(h:ia) or date(H:i) a try - these are 12-hour and 24-hour times respectively. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fw: Speed of the PHP Parser MySQL vs. textfiles
Hi people, maybe someone here has experience with this question: We have to create a CMS System for beginners. For storing data, we have 3 possibilities: 1. Store Data in MySQL, query the database, inlcude the dynamic content via php. echo $mysqldata[headline].P\n; 2. Store Data in Textfiles holding the Data like this: ? $userpreferences[headline] = My Headline; $userpreferences[bgcolor] = #00FF00; // etc. ? This would mean, we just include the preferences file at the top of the php script generating the output page. (A lot less coding i think) 3. Generate HTML pages (soc. cache) everytime the user makes changes to his pages. I just had an argument with a co-worker and I would like to have your guys' opinion on this: Combination 1: Store frequently changed info in 1. MySQL Database and rarely changed data in 2. Textfiles that are included. Combination 2: Store frequently changed info in 1. MySQL Database and rarely changed data in 3. Plain HTML Cache files. I won't say which one is mine! ;-) So, which one would you guys prefer, and what do you think is faster ... Included Textfiles or HTML or MySQL ? We also of course have to take the time and complexity of the coding into consideration. Thanks a lot for any answer! (Also thankful for urls to php parser benchmarks etc...) Holger Heinze -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fw: Speed of the PHP Parser MySQL vs. textfiles
Hi, apologies for the confirmation, didn't even know it was set on this Computer (not my own) until I got it myself. I hate it =) Sorry again, Holger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
What does the -dump and /dev/null 21 stuff do? --- Philip Hallstrom [EMAIL PROTECTED] wrote: You could setup cron to run lynx or some other command line web browser... something like: 0 * * * * /path/to/lynx -dump http://server/path/to/script.php /dev/null 21 Then as the first thing in that script you will probably want to set the time limit to 0 so it doesn't time out... On Wed, 25 Sep 2002, Daren Cotter wrote: I have PHP installed on a Cobalt RaQ550. I know there are two ways of installing PHP, one as a binary, and one as an Apache module. I am pretty sure PHP gets installed as an Apache module for the Cobalt installation. My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.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 __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
-dump is an option to lynx to tell it to output the page and quits. the rest of it says send all output (and errors) to /dev/null On Wed, 25 Sep 2002, Daren Cotter wrote: What does the -dump and /dev/null 21 stuff do? --- Philip Hallstrom [EMAIL PROTECTED] wrote: You could setup cron to run lynx or some other command line web browser... something like: 0 * * * * /path/to/lynx -dump http://server/path/to/script.php /dev/null 21 Then as the first thing in that script you will probably want to set the time limit to 0 so it doesn't time out... On Wed, 25 Sep 2002, Daren Cotter wrote: I have PHP installed on a Cobalt RaQ550. I know there are two ways of installing PHP, one as a binary, and one as an Apache module. I am pretty sure PHP gets installed as an Apache module for the Cobalt installation. My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.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 __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cronjob
Use lynx or wget to call your web page. lynx --dump http://www.domain.com/my_cron_page.php ---John Holmes... -Original Message- From: Daren Cotter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 25, 2002 12:36 PM To: PHP General Mailing List Subject: [PHP] Cronjob I have PHP installed on a Cobalt RaQ550. I know there are two ways of installing PHP, one as a binary, and one as an Apache module. I am pretty sure PHP gets installed as an Apache module for the Cobalt installation. My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.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
Re: [PHP] Output Buffering - Am I using it correctly?
Output buffering is doing nothing for you in the given example. It does not reduce client side resources... if anything it increases the usage serverside resources. Perhaps you are thinking of gz compression? You might use a combination of ob* functions and gz* functions to minimize bandwidth requirments.. but there's no guarantee that your user's browsers supports it. http://www.php.net/manual/en/printwn/function.gzcompress.php -Kevin - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 25, 2002 10:45 AM Subject: [PHP] Output Buffering - Am I using it correctly? Howdy group! I am outputting a rather large data set to an Excel spreadsheet from a MySQL database on a healthy FreeBSD server. The Apache server is on the same server as the database. The code looks like this ? /* ** SWB CABS Project ** USOC Charges Detail ** Report By Criteria - Spreadsheet */ // open output buffer ob_start(); // excel headers header(Content-Type: application/vnd.ms-excel); header(Content-Disposition: inline; filename=\excel.xls\); header(Expires: 0); header(Cache-Control: must-revalidate, post-check=0, pre-check=0); /* ** lots of code that gets roughly ** 15,000 - 20,000 rows of data ** each row is 209 bytes of data */ // close output buffer ob_end_flush(); ? Now, even though I have set ob_start() the headers get sent (as it says in the docs; While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer. ) The Task Manager shows that the processes on my local machine for EXCEL.EXE go to the maximum available CPU cycles and stays there until the spreadsheet is either delivered or the system times out. I thought that using output buffering would lower use of client system resources. Is this not true? Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Output Buffering - Am I using it correctly?
[snip] Output buffering is doing nothing for you in the given example. It does not reduce client side resources... if anything it increases the usage serverside resources. Perhaps you are thinking of gz compression? You might use a combination of ob* functions and gz* functions to minimize bandwidth requirments.. but there's no guarantee that your user's browsers supports it. [/snip] Fatal error: Call to undefined function: gzcompress() in /var/lib/apache/htdocs/swbcabs/gen.php on line 89 I guess that this means I am out of luck here. Anyone know a cleaner method for delivering spreadsheets? Thanks! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? --- Jason Young [EMAIL PROTECTED] wrote: Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Explorer-like drill down interface
I have two questions: 1. I would like to build a php page that contains a Windows explorer-like drill down mechanism, where clicking the '+' beside an item will expand the sub-items below (which can also have a '+' or '-' on the left) and clicking the '-' will collapse the item. Is there any existing code for that or hints how I can do it? 2. I have allowed packets through my firewall destined for port 3306, the mysql server. So I can connect to the server from a remote machine. Are there any known security vulnerabilities in the mySQL server? Many thanks, Rich
Re: [PHP] Explorer-like drill down interface
Hi Richard, There are a couple out there... I created one for myself (V1.un) that does something similar... It relies on a couple of support files for mime-types and icons. Here's the code... if you like the idea, I can zip up the icons and extension-to-mime folders and send it to ya. My website (www.jwfarrell.com) is supposed to be online later this afternoon (after a week of promises from my ISP), so you'll be able to look at the code in action. B listtree.php ?php $MetaTitle = Locally-Mirrored Documentation; $MetaDescription =Answerbase for Multivalue Programmers; $MetaKeywords = UNIVERSE, UNIDATA, APACHE PERL, HTML REFERENCE, CSS, CASCADING STYLE SHEET, REFERENCE, SEARCH; include( style/htmlhead.php ); $SuppressSearch = false; $OnLoad = ; include(style/bodytemplate_top.php); // user config $Gaol = $DocRoot/help;// set a ceiling so people don't prowl the system $GaolURL = /help; // ceiling in URLspace $IconsFolder = $DocRoot/graphics/icons; // directory for icons $MimeTypeFolder = $DocRoot/ext2mime; // extension-to-icon map $Subdirectories = array(); $SimpleFiles = array(); $TitleStart = ThEtItLe; $TitleReplacement = MV_FM . $TitleStart . MV_FM; $TitleEnd = MV_FM; //echo Method is $Methodbr\n; ? h2Browse the Documentation Tree/h2 form action=/listtree.php method=POST fieldset style=width: 500px; text-align: left; text-indent: 0em; table border=0 cellpadding=0 cellspacing=0 width=100% col style=width: 20px; col style=width: 20px; col captionFolder contents/caption ?php unset( $DocDirectory ); if ( $Method == POST ) { $TargetFolder = $Folder; if ( substr( $TargetFolder, -2 ) != '..' ) { if ( $TargetFolder == $GaolURL ) { $TargetFolder = ; } //echo Setting folders from $TargetFolderbr\n; $DocArray = explode( '/', $TargetFolder ); $DocDirectoryArray = array_slice( $DocArray, 1 ); $DocDirectory = implode( '/', $DocDirectoryArray ); $CurrentFolder = $TargetFolder; //echo Doc Directory is $DocDirectorybr\n; $FullPath = explode( '/', $DocDirectory ); $PreviousDirectoryArray = array_slice( $FullPath, 0, count( $FullPath ) - 2 ); $PreviousDirectory = implode( '/', $PreviousDirectoryArray ); $FullURL = explode( '/', $CurrentFolder ); $PreviousFolderArray = array_slice( $FullURL, 0, count( $FullURL ) - 1 ); $PreviousFolder = implode( '/', $PreviousFolderArray ); } } // init tree - disallow attempts to go above gaol if ( ( !isset( $DocDirectory ) ) | ( strlen( $DocDirectory ) strlen( $GaolURL ) ) ) { $DocDirectory = $Gaol; $DocDirectoryArray = array( $DocDirectory ); $CurrentFolder = $GaolURL; $PreviousFolderArray = array( ); $PreviousFolder = ; } if ( ( $Docs = opendir( $DocDirectory ) ) === false ) { die( $DocDirectory doesn't exist! ); } while ( false !== ( $Subdir = readdir( $Docs ) ) ) { if ( ( substr( $Subdir, 0, 1 ) != . ) ) { if ( is_dir( $DocDirectory/$Subdir ) ) { array_push( $Subdirectories, $Subdir ); } else { array_push( $SimpleFiles, $Subdir ); } } } sort( $Subdirectories ); sort( $SimpleFiles ); ? tr thnbsp;/th thnbsp;/th thName/th thSize/th /tr ?php $Level = 0; // how many t-bars in? echo tr\n; echo td align=\left\ valign=\top\ style=\line-height: 125%;\a href=\/help\img style=\border: none;background: transparent; line-height: 110%;\ height=\16\ src=\/graphics/icons/folder_home.png\/td\n; echo tdnbsp;/td\n; echo tdDocumentation Home Page/td\n; echo /tr\n; echo trtdnbsp;/td/td\n; if ( $DocDirectory != $Gaol ) { echo tr\n; echo td align=\left\ valign=\top\input name=\Folder\ style=\border: none;background: transparent;\ type=\image\ height=\16\ value=\\ src=\/graphics/icons/mark_top.gif\/td\n; echo tdnbsp;/td\n; echo tdTop of the Tree/td\n; echo /tr\n; echo trtdnbsp;/td/tr\n; echo tr\n; echo td align=\left\ valign=\top\input name=\Folder\ style=\border: none;background: transparent;\ type=\image\ height=\16\ value=\$PreviousFolder\ src=\/graphics/icons/back.gif\/td\n; echo tdnbsp;/td\n; echo tdUp one level to $PreviousFolder/td\n; echo /tr\n; echo trtdnbsp;/td/tr\n; } ? tr td align=left valign=topimg src=/graphics/icons/folder_open.png/td tdnbsp;/td td align=left?php echo $CurrentFolder; ?/td /tr ?php $LastFolder = $Subdirectories[ count( $Subdirectories ) - 1 ]; $LastFile = $SimpleFiles[ count( $SimpleFiles ) - 1 ]; foreach ( $Subdirectories as $Subdir ) { echo tr\n; if ( ( $Subdir == $LastFolder ) ( $LastFile
Re: [PHP] Explorer-like drill down interface
I would recommend using javascript for the expanding/contracting list stuff and I don't know of any vulnerablilities in MySQL Server... - Mike D I have two questions: 1. I would like to build a php page that contains a Windows explorer-like drill down mechanism, where clicking the '+' beside an item will expand the sub-items below (which can also have a '+' or '-' on the left) and clicking the '-' will collapse the item. Is there any existing code for that or hints how I can do it? 2. I have allowed packets through my firewall destined for port 3306, the mysql server. So I can connect to the server from a remote machine. Are there any known security vulnerabilities in the mySQL server? Many thanks, Rich -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
I can't say I'm really too familiar with the php commandline.. You're using /usr/bin/php (or equivalent) and attempting to use your exec() that way? If you do 'php -?' you'll get a list of commands that you can use, and I don't see a way to pass cmdline arguments as variables.. Having said that, I Just went and looked further into it.. if I make a test script, and at the top I put: $hi = $argv[1]; then $hi becomes whatever you've specified as the first argument.. I'm assuming this is what you want? To clarify: phpfile.php contains: ? $hi = $argv[1]; echo $hi; ? Running the command php -f phpfile.php test returns test Does this help at all?? -Jason Daren Cotter wrote: Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? --- Jason Young [EMAIL PROTECTED] wrote: Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Darren, Do you want to use a shell script or a php page to run your queries? - MD Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? --- Jason Young [EMAIL PROTECTED] wrote: Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Output Buffering - Am I using it correctly?
I guess that this means I am out of luck here. Anyone know a cleaner method for delivering spreadsheets? Can you get the server to write it to a file, and then let the client download the file normally? Beau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Jason Young wrote: I can't say I'm really too familiar with the php commandline.. You're using /usr/bin/php (or equivalent) and attempting to use your exec() that way? If you do 'php -?' you'll get a list of commands that you can use, and I don't see a way to pass cmdline arguments as variables.. Having said that, I Just went and looked further into it.. if I make a test script, and at the top I put: $hi = $argv[1]; then $hi becomes whatever you've specified as the first argument.. I'm assuming this is what you want? To clarify: phpfile.php contains: ? $hi = $argv[1]; echo $hi; ? Running the command php -f phpfile.php test returns test Does this help at all?? -Jason Daren Cotter wrote: Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? I'm think you're all forgetting about register_globals being off by default these days... The following may help: $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; HTH, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Output Buffering - Am I using it correctly?
[snip] I guess that this means I am out of luck here. Anyone know a cleaner method for delivering spreadsheets? Can you get the server to write it to a file, and then let the client download the file normally? [/snip] Believe me, if I could have taken that way out I would have done it. I am researching some classes, but they all seem to take just as long to create the spreadsheet. Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Jason, That's exactly what I'm trying to do, and it's not working: My Script: #!/usr/bin/php -f ?php $test = $argv[1]; print $test; $demo = This Works; print $demo; ? Running: ./test.php blah Yiels only This Works, but not blah. I'm using version 4.0.6 --- Jason Young [EMAIL PROTECTED] wrote: I can't say I'm really too familiar with the php commandline.. You're using /usr/bin/php (or equivalent) and attempting to use your exec() that way? If you do 'php -?' you'll get a list of commands that you can use, and I don't see a way to pass cmdline arguments as variables.. Having said that, I Just went and looked further into it.. if I make a test script, and at the top I put: $hi = $argv[1]; then $hi becomes whatever you've specified as the first argument.. I'm assuming this is what you want? To clarify: phpfile.php contains: ? $hi = $argv[1]; echo $hi; ? Running the command php -f phpfile.php test returns test Does this help at all?? -Jason Daren Cotter wrote: Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? --- Jason Young [EMAIL PROTECTED] wrote: Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
I'm using a PHP script. I got a PHP script to run mysql queries no problem, but the trouble is I need to pass off arguments to the script (those arguments shape the queries). --- Mike Dunlop [EMAIL PROTECTED] wrote: Darren, Do you want to use a shell script or a php page to run your queries? - MD Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? --- Jason Young [EMAIL PROTECTED] wrote: Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] dynamic website
I have a general question of a dynamic website using PHP4 and mysql database. If there are many, many users visiting a dynamic website at once, will it cause the database to be bogged down with so many users visiting the website? If so, how do you around this problem. Thanks, Ben __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Robert, This does not work, but thanks anyway =) Script: ? $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; $test = $argv[1]; print $test; $demo = This Works; print $demo; ? Command Line: /usr/bin/php -f test.php blah Output: This Works --- Robert Cummings [EMAIL PROTECTED] wrote: Jason Young wrote: I can't say I'm really too familiar with the php commandline.. You're using /usr/bin/php (or equivalent) and attempting to use your exec() that way? If you do 'php -?' you'll get a list of commands that you can use, and I don't see a way to pass cmdline arguments as variables.. Having said that, I Just went and looked further into it.. if I make a test script, and at the top I put: $hi = $argv[1]; then $hi becomes whatever you've specified as the first argument.. I'm assuming this is what you want? To clarify: phpfile.php contains: ? $hi = $argv[1]; echo $hi; ? Running the command php -f phpfile.php test returns test Does this help at all?? -Jason Daren Cotter wrote: Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? I'm think you're all forgetting about register_globals being off by default these days... The following may help: $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; HTH, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Daren, This post from Robert explains why you're having trouble :) I forgot the PHP version on my machine doesn't have the register_globals problem. THAT should work. -Jason I'm think you're all forgetting about register_globals being off by default these days... The following may help: $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; HTH, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Correction.. isn't it $_SERVER and not $SERVER Jason Young wrote: Daren, This post from Robert explains why you're having trouble :) I forgot the PHP version on my machine doesn't have the register_globals problem. THAT should work. -Jason I'm think you're all forgetting about register_globals being off by default these days... The following may help: $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; HTH, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Jeez.. pardon me.. $_GLOBALS .. I don't know where I got SERVER from.. *sleeps before posting from now on* -J Jason Young wrote: Correction.. isn't it $_SERVER and not $SERVER Jason Young wrote: Daren, This post from Robert explains why you're having trouble :) I forgot the PHP version on my machine doesn't have the register_globals problem. THAT should work. -Jason I'm think you're all forgetting about register_globals being off by default these days... The following may help: $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; HTH, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Encrypt data...
How do I encrypt the data and decrypt it back using PHP? I do know that hte random number can not be used becuase it will make it impossible to decrypt it. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Encrypt data...
http://php.net/mcrypt How do I encrypt the data and decrypt it back using PHP? I do know that hte random number can not be used becuase it will make it impossible to decrypt it. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Nope, $GLOBALS remains as always... http://www.php.net/manual/en/language.variables.predefined.php#language.variables.superglobals Cheers, Rob. Jason Young wrote: Jeez.. pardon me.. $_GLOBALS .. I don't know where I got SERVER from.. *sleeps before posting from now on* -J Jason Young wrote: Correction.. isn't it $_SERVER and not $SERVER Jason Young wrote: Daren, This post from Robert explains why you're having trouble :) I forgot the PHP version on my machine doesn't have the register_globals problem. THAT should work. -Jason I'm think you're all forgetting about register_globals being off by default these days... The following may help: $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; HTH, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
In any case, register_globals is ON for my server. I don't understand why this isn't working? I'm doing exactly what the manual says. What could I be missing? --- Robert Cummings [EMAIL PROTECTED] wrote: Nope, $GLOBALS remains as always... http://www.php.net/manual/en/language.variables.predefined.php#language.variables.superglobals Cheers, Rob. Jason Young wrote: Jeez.. pardon me.. $_GLOBALS .. I don't know where I got SERVER from.. *sleeps before posting from now on* -J Jason Young wrote: Correction.. isn't it $_SERVER and not $SERVER Jason Young wrote: Daren, This post from Robert explains why you're having trouble :) I forgot the PHP version on my machine doesn't have the register_globals problem. THAT should work. -Jason I'm think you're all forgetting about register_globals being off by default these days... The following may help: $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; HTH, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Output Buffering - Am I using it correctly?
[snip] I am researching some classes [/snip] OK. One of the silly classes fails, saying -- Fatal error: No parent class available in this context in biff.php on line 52 line 52 is -- 49 function BiffWriter() 50 { 51 error_reporting (E_ALL); 52 parent::BiffBase(); 53 $this-_fill_AA_notation(); 54 } This is on a server with PHP 4.04. Does anyone have any clues as to why it might not work? ACCCK! I am so frustrated at this point that I would almost rather write spreadsheets by hand! Thanks for your help! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
On 25-Sep-2002 Daren Cotter wrote: Jason, That's exactly what I'm trying to do, and it's not working: My Script: #!/usr/bin/php -f ?php $test = $argv[1]; print $test; $demo = This Works; print $demo; ? Running: ./test.php blah Yiels only This Works, but not blah. I'm using version 4.0.6 try var_dump($argv); var_dump($GLOBALS); --- Jason Young [EMAIL PROTECTED] wrote: I can't say I'm really too familiar with the php commandline.. You're using /usr/bin/php (or equivalent) and attempting to use your exec() that way? If you do 'php -?' you'll get a list of commands that you can use, and I don't see a way to pass cmdline arguments as variables.. Having said that, I Just went and looked further into it.. if I make a test script, and at the top I put: $hi = $argv[1]; then $hi becomes whatever you've specified as the first argument.. I'm assuming this is what you want? To clarify: phpfile.php contains: ? $hi = $argv[1]; echo $hi; ? Running the command php -f phpfile.php test returns test Does this help at all?? -Jason Daren Cotter wrote: Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? --- Jason Young [EMAIL PROTECTED] wrote: Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Don Read [EMAIL PROTECTED] -- Beer is proof that God loves us and wants us to be happy. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Daren Cotter wrote: In any case, register_globals is ON for my server. I don't understand why this isn't working? I'm doing exactly what the manual says. What could I be missing? No idea the following worked as expected for me: Script: ? $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; $test = $argv[1]; print $test; $demo = This Works; print $demo; ? Execute: php foo.php blah Output: X-Powered-By: PHP/4.1.2 Content-type: text/html blahThis Works Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and M$ Access
Hello, Sorry if this seems like a dumb question. But can PHP work with MS Access, for example if I want to develop a web database application? Does the API exist for that? The system is going to be like Linux/Apache/PHP as the web server, and Win2k/NT with M$ Access as the database. I am wondering if php can access the database, just like the way it does with MySQL, for example. I am not really familiar with M$ stuff, since I usually use MySQL or Oracle. But I have a client who insist to use M$ Access. Thanks for any respond. Reuben D. Budiardja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Holy wowsers...about 5 pages of jibberish printed out, and at the end: bWarning/b: Nesting level too deep - recursive dependency? in btest.php/b on line b3/bbr There isn't even a line 3 in the script: ?php var_dump($argv); var_dump($GLOBALS); ? --- Don Read [EMAIL PROTECTED] wrote: On 25-Sep-2002 Daren Cotter wrote: Jason, That's exactly what I'm trying to do, and it's not working: My Script: #!/usr/bin/php -f ?php $test = $argv[1]; print $test; $demo = This Works; print $demo; ? Running: ./test.php blah Yiels only This Works, but not blah. I'm using version 4.0.6 try var_dump($argv); var_dump($GLOBALS); --- Jason Young [EMAIL PROTECTED] wrote: I can't say I'm really too familiar with the php commandline.. You're using /usr/bin/php (or equivalent) and attempting to use your exec() that way? If you do 'php -?' you'll get a list of commands that you can use, and I don't see a way to pass cmdline arguments as variables.. Having said that, I Just went and looked further into it.. if I make a test script, and at the top I put: $hi = $argv[1]; then $hi becomes whatever you've specified as the first argument.. I'm assuming this is what you want? To clarify: phpfile.php contains: ? $hi = $argv[1]; echo $hi; ? Running the command php -f phpfile.php test returns test Does this help at all?? -Jason Daren Cotter wrote: Jason, I'm not using a web script any longer, I'm using command-line (I determined that it is installed on the server). I read about $argc and $argv, but when I call the script passing two arguments, both $argc and $argv are blank. Is this a php.ini setting I need to change or somethign? --- Jason Young [EMAIL PROTECTED] wrote: Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: Thanks for the info Chris, it works! How do I pass arguments to the script? I'm assuming it'd just be: test.php arg1 arg2 The stuff I've read says $argc should be the count of the # of arguments, and $argv should be an array holding them...but when I do a simple: print # of Arguments: $argc\n; It prints nothing, not even 0 --- Chris Hewitt [EMAIL PROTECTED] wrote: On Wed, 25 Sep 2002, Daren Cotter wrote: My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is there any way I can accomplish this, directly or indirectly? Are you sure its not already there? Commonly in /usr/bin. Try a which php and see if it finds anything? HTH Chris __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Don Read [EMAIL PROTECTED] -- Beer is proof that God loves us and wants us to be happy. __ Do you Yahoo!? New DSL Internet Access from SBC Yahoo! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php