Re: [PHP] php-cli - Controlling external programs
Bah, not the answer I was looking for...I really wanted to use PHP and I have most of what I wanted accomplished. Thanks for the tip, I will investigate. "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > --- Mike Maltese <[EMAIL PROTECTED]> wrote: > > I'm writing a script to be run from the command line. > ... > > How can I get the signal from tar that the tape needs to be changed? > > It sounds like you are wanting to write an interactive shell script. If this is > the case (e.g., I didn't misunderstand), you should probably use expect instead > of PHP. > > Hope that helps. > > Chris > > = > Become a better Web developer with the HTTP Developer's Handbook > http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php-cli - Controlling external programs
I'm writing a script to be run from the command line. It controls my DAT autoloader (tape changer) and runs tar so that I can automate my backups. With the -M option, tar will prompt for a new tape when the current tape is full. How can I get the signal from tar that the tape needs to be changed? Is there another way to interact with external programs other than, exec, backticks, etc.? I'm running 4.3.2-cli on FreeBSD with POSIX and pcntl functions enabled. Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Deleting File
Make sure the owner of the server process has delete permissions for the directory in question. - Original Message - From: "pong-TC" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 21, 2002 11:25 AM Subject: [PHP] Deleting File > Hello All > > I am trying to build a text file, and delete it by using unlink function, > but it always refuse to do so because of permission denied. It gives me > an error as follows: > > Warning: Unlink failed (Permission denied) in > d:\inetpub\wwwroot\cgi-bin\myfile.php on line 45 > > Actually, the file was created in the same page by using fopen, and then I > want to delete when no longer used. I had tried a delete function, but > not work. I am running PHP as a cgi on IIS 5, Win2K. > > If anyone can help. > > Pong > > > -- > 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] Checkboxe problem
just use iseet(); if(isset($private)){ //do stuff } - Original Message - From: "Gaylen Fraley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 05, 2002 8:41 PM Subject: [PHP] Checkboxe problem > I have a form with 1 checkbox and have coded it like this: > > > > When the form is submitted, $HTTP_POST_VARS[private] only exists IF checkbox > is checked. It doesn't exist otherwise, which is causing a problem because > there are several other elements before and after. What happens is the > value AFTER "private" is actually populating "private" if "private" is empty > (not checked). I am, no doubt, missing something small, but critical here. > Can someone point out the error of my ways and explain how to get the > checkbox key/value pair into the post vars array when the value is not > checked? > > TIA, > > -- > Gaylen > PHP KISGB v3.22 Guest Book http://www.gaylenandmargie.com/phpwebsite/ > > > > > -- > 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] date( ) - function
try date("H:i:s",time()). Mike - Original Message - From: "soma" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 05, 2002 12:32 AM Subject: [PHP] date( ) - function > i have one question > > linux system's time is right but php's date () function time is wrong... > > different system time and php's date( ) time > > is date () function call to the system time ? > > thansk > > /soma > > > > -- > 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] Oddity
You may want to give mysql_fetch_object a try. I like it because you end up typing less. You access elements like this: $row->data, instead of $row['data']. Just my $0.02. Mike - Original Message - From: "Chris Boget" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 04, 2002 8:42 AM Subject: Re: [PHP] Oddity > > $macroDataArray = mysql_fetch_array( $result ); > > I'm still curious what is going wrong, but I've found a work arround. > One of the things I love about PHP is that you learn something new > just about every day. Instead of fetch_array(), I can use fetch_assoc() > and it'll do just what I need. :) > > Chris > > > > -- > 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] mysql backup function in php?
Use PHPMyAdmin. You can dump to a CSV file or it can output all of the INSERT statements to rebuild a table. - Original Message - From: "Wilbert Enserink" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 04, 2002 8:22 AM Subject: [PHP] mysql backup function in php? > Hi all, > > i searched the manual for a php backup function for a mysql DB. > I can't seem to find it, but i'm not sure whether it exists. > > > mysql_backup_db maybe?? > > > > thx. Wilbert > > - > Pas de Deux > Van Mierisstraat 25 > 2526 NM Den Haag > tel 070 4450855 > fax 070 4450852 > http://www.pdd.nl > [EMAIL PROTECTED] > - > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, 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] Oddity
This could be the problem in your for loop: $elementKey = key( $macroDataArray ) - you're using the = assignment operator. Try == or <=. Mike - Original Message - From: "Chris Boget" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 04, 2002 8:29 AM Subject: [PHP] Oddity > Ok, could someone tell me why this isn't working? > (note, I took out all my error checks. This is just the > relevant code... > > $query = "Query that does return row(s)"; > $result = mysql( $dbname, $query ); > > $macroDataArray = mysql_fetch_array( $result ); > > for( reset( $macroDataArray ); $elementKey = key( $macroDataArray ); next( $macroDataArray )) { > echo "Value for key $elementKey = $macroDataArray[$elementKey]\n"; > > } > // this should spit out one line for every element. > > That doesn't work but this does: > > foreach( $macroDataArray as $elementKey => $elementValue ) { > echo "Value for key $elementKey = $elementValue\n"; > > } > // this spits out 2 lines for every element. > > Why? What's going on? I could use the second bit of code, but that returns > four pairs for each array element: > > ELEMENT VALUE > 05000 > KeyName 5000 > > for example, where the above is the same element. I really don't need the > numerical "key" (the 0 above), just the name and that's why I need to find > out why the first FOR loop isn't working. > > Any ideas? I've tried everything... :( > > Chris > > > > > -- > 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] HTTP Header
Just use header(). header("HTTP/1.1 200"); header(Date: Mon, 04 Feb 2002 10:01:54 GMT"); etc., etc. Just make sure that they are all sent before you start any output to the browser. Mike - Original Message - From: "Daniel Reichenbach" <[EMAIL PROTECTED]> To: "Php-General" <[EMAIL PROTECTED]> Sent: Monday, February 04, 2002 2:06 AM Subject: [PHP] HTTP Header > Hy list :-) > > I need to manually send the HTTP header with PHP. > > The following is an example what I have to send to the client: > > HTTP/1.1 200 OK > Date: Mon, 04 Feb 2002 10:01:54 GMT > Server: Apache/1.3.20 (Unix) mod_ssl/2.8.4 OpenSSL/0.9.6 > Connection: Keep-alive, close > Expires: Thu, 01 Dec 1994 16:00:00 GMT > Content-Length: 1078 > Content-Type: text/plain > > How would I Do that with PHP? > > Thx, > Daniel > > > -- > 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] this list has been mutated to a lamers paradise
Thanks, LAMER - Original Message - From: "Gregor Welters" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 31, 2002 5:06 PM Subject: [PHP] this list has been mutated to a lamers paradise > just wanted to point this out. > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] question reg trim-strlen
Yep. - Original Message - From: "B. Verbeek" <[EMAIL PROTECTED]> To: "Php-General (E-mail)" <[EMAIL PROTECTED]> Sent: Thursday, January 31, 2002 2:48 AM Subject: [PHP] question reg trim-strlen > Does this work? > > >>if(strlen($cust_adres = trim($cust_adres)) > 50){ /*code here*/ } > > I mean that the new $cust_adres is trimmed when nessecary? > > regards > Bart > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] No mcrypt.dll?
Well, I didn't get any replies so I'll try again... Seems like there is an implementation of every other library for windows, why is this one so elusive? I tried compiling once with Cygwin but gave up out of frustration. Anyone have a source for this or have a compiled copy they'd like to share with me? Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] A function that executes php code in a string?
eval()? - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 30, 2002 10:25 PM Subject: [PHP] A function that executes php code in a string? > I want to execute code in a mysql datrabase, but is this possible? I want > it to run exactly as if I had tyyped it in to the php file. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Why is there no mcrypt.dll?
Seems like there is an implementation of every other library for windows, why is this one so elusive? I tried compiling once with Cygwin but gave up out of frustration. Anyone have a source for this or have a compiled copy they'd like to share with me? Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP4.0 & Apache with WinXP
You should only have the same problems as those of us running it on 2K. =) - Original Message - From: "Ben Clumeck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 30, 2002 12:03 PM Subject: [PHP] PHP4.0 & Apache with WinXP > I am trying to install Apache and PHP4.0 on WinXP. Does anyone know of any > conflicts? > > Thanks, Ben > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] configuring php and apache
Problems I see: First, use forward slashes! extension_dir = c:\windows\system32//points to where i located the php4ts.dll file This should be the folder that contains extension dll's. If you used the installer it will be "C:/php/extensions" (no quotes) or wherever you installed PHP. doc_root = c:\program files\apache group\apache\htdocs Same thing about forward slashes here. Good luck! - Original Message - From: "liz lynch" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 29, 2002 3:00 AM Subject: [PHP] configuring php and apache hi all, i have installed php and apache on my home computer..i am running xp home edition. the problem is that the php and apache are not working together. what i have done so far: 1. configured the httpd.conf file by adding the following lines: ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .php .phtml Action application/x-httpd-php "/php/php.exe" 2.moved the php4ts.dll file to windows\system32note i do not have a directory called winnt 3.configured the php.ini file(located in windows dir)so that: extension_dir = c:\windows\system32//points to where i located the php4ts.dll file doc_root = c:\program files\apache group\apache\htdocs//points to the document root file. i will be storing my files in the htdocs dirrectory. what am i doing wrong -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Need help with Taking a phrase from a remote location.
str_replace() and eregi_replace() work well for this. Mike - Original Message - From: "Robby" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 27, 2002 1:45 PM Subject: [PHP] Need help with Taking a phrase from a remote location. > Hi Everyone, > > > I need to know which function a would use to take a phrase from a remote > location. > > Yes, I using my fopen and fread function. But I need to know what function I > would use to grab text between the one snip of code and a nother snip of > code. > > Please email me back at [EMAIL PROTECTED] > > Robby > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I'm not sure how to do some simple code...
Whoops, that should be: $mystring = "This is a string with the word script in it"; if(eregi("script",$mystring)){ //do something here } - Original Message - From: "Mike Maltese" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 8:41 PM Subject: Re: [PHP] I'm not sure how to do some simple code... > > } > > > - Original Message - > From: "Leif K-Brooks" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, January 25, 2002 8:12 PM > Subject: [PHP] I'm not sure how to do some simple code... > > > > I know this is probably a stupid question, but how do I make it so that if > a > > string contains the word "script" (I'm banning javascript) it does > > something? > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] I'm not sure how to do some simple code...
$mystring = "This is a string with the word script in it"; if(eregi("script",$mystring){ //do something here } - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 8:12 PM Subject: [PHP] I'm not sure how to do some simple code... > I know this is probably a stupid question, but how do I make it so that if a > string contains the word "script" (I'm banning javascript) it does > something? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] WinNT extensions
Give me a break, all they have to do is edit the php.ini file. I'd find another provider. - Original Message - From: "Paul Roberts" <[EMAIL PROTECTED]> To: "Malcolm" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, January 25, 2002 1:33 PM Subject: Re: [PHP] WinNT extensions > Don't you pay them for the very difficult stuff! > > > Paul Roberts > [EMAIL PROTECTED] > > - Original Message - > From: "Malcolm" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, January 25, 2002 11:04 AM > Subject: [PHP] WinNT extensions > > > > Hi all > > > > I am building a simple web based mail app. I tried to contact my mail server > > using imap_open() but all I got was this: > > > > Fatal error: Call to undefined function: imap_open() in d:\... on line > > 15 > > > > I got in touch with my provider who replied: > > > > IMAP support was not compiled into the > > Windows version of PHP. Unfortunately, > > compiling it by hand is very difficult. > > It requires having Microsoft Visual C++, along > > with a bunch of other tools. So...it looks like > > you'll need to use another method to view mail. > > Sorry for the bad news. > > > > I thought imap functionality was in a dll which can be loaded dynamically: > > dl("php_imap.dll"); > > imap_open("a","u","p"); > > > > Can anyone please enlighten me? Is it built in? They use PHP 4.1.1. > > > > Malcolm > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]