Re: [PHP] fsockopen problems
On Friday 22 June 2007 10:59 am, Tijnema wrote: On 6/22/07, Ray [EMAIL PROTECTED] wrote: hello, I'm having some problems with fsockopen and was hopping for some help. I try to connect to a host via fsockopen and I get getaddrinfo failed errors, but if I try fsockopen with google, everything works. sample test code $fp=fsockopen('apps.subname.domain.com/xml_2.4/xml.php',80,$errno, $errstr); var_dump($errno); var_dump($errstr); $fp=fsockopen(000.00.00.000/xml_2.4/xml.php,80,$errno, $errstr); var_dump($errno); var_dump($errstr); $fp=fsockopen('www.google.ca',80,$errno, $errstr); var_dump($errno); var_dump($errstr); (sorry for sanitizing, not my choice.) I can ping the host from the server, and going to this site in a browser gives the expected output. Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/local/www/apache22/data/index.php on line 119 Warning: fsockopen() [function.fsockopen]: unable to connect to apps.subname.domain.com/xml_2.4/xml.php:80 (Unknown error) in /usr/local/www/apache22/data/index.php on line 119 int(0) string(0) [note no error for google. should be here] Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/local/www/apache22/data/index.php on line 122 Warning: fsockopen() [function.fsockopen]: unable to connect to 000.00.00.000/xml_2.4/xml.php:80 (Unknown error) in /usr/local/www/apache22/data/index.php on line 122 int(0) string(0) int(0) string(0) With fsockopen you connect to a host, not to the host with full path... This would work fine: $fp=fsockopen('apps.subname.domain.com',80,$errno, $errstr); var_dump($errno); var_dump($errstr); Now you probably want to get that file, so you should do a fwrite: fwrite($fp,GET /xml_2.4/xml.php HTTP/1.1\r\nHost: apps.subname.domain.com\r\n\r\n); *note: All above should be on one single line Then, after you made a request, you can get the data with fread: $data = fread($fp,102400); // 100KB of data max This returns the page, including the headers! If you only want data, you're better off using file_get_contents function, like this: $data = file_get_contents('apps.subname.domain.com/xml_2.4/xml.php); Hope this helps ;) Tijnema Thanks, that does help. Thats exactly what I was looking for. Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen problems
hello, I'm having some problems with fsockopen and was hopping for some help. I try to connect to a host via fsockopen and I get getaddrinfo failed errors, but if I try fsockopen with google, everything works. sample test code $fp=fsockopen('apps.subname.domain.com/xml_2.4/xml.php',80,$errno, $errstr); var_dump($errno); var_dump($errstr); $fp=fsockopen(000.00.00.000/xml_2.4/xml.php,80,$errno, $errstr); var_dump($errno); var_dump($errstr); $fp=fsockopen('www.google.ca',80,$errno, $errstr); var_dump($errno); var_dump($errstr); (sorry for sanitizing, not my choice.) I can ping the host from the server, and going to this site in a browser gives the expected output. Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/local/www/apache22/data/index.php on line 119 Warning: fsockopen() [function.fsockopen]: unable to connect to apps.subname.domain.com/xml_2.4/xml.php:80 (Unknown error) in /usr/local/www/apache22/data/index.php on line 119 int(0) string(0) [note no error for google. should be here] Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/local/www/apache22/data/index.php on line 122 Warning: fsockopen() [function.fsockopen]: unable to connect to 000.00.00.000/xml_2.4/xml.php:80 (Unknown error) in /usr/local/www/apache22/data/index.php on line 122 int(0) string(0) int(0) string(0) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Display paragraphs from a mysql db
On Sunday 24 June 2007 4:03 pm, nitrox . wrote: hi all, I have a news section on a website that im coding that isnt displaying properly. Every paragraph in each news post is being displayed as one big paragraph. how can i display my paragraphs in proper form? The field the news story is stored in is set as longtext. here is a link to view. http://area51.chalkthree.com/index.php?pg=3 the first update shows what im having an issue with. each item in the numbered list should be on a seperate line. there are some line breaks as well for new paragraphs that arent displaying properly. Hello Nitrox, I went to look at the site indicated, and as far as I can tell, your problem isn't with the php or the sql. It's with the html. to put each point on seperate lines, try using the list tags ordered or unordered list. http://www.w3schools.com/html/html_lists.asp just for one example. Also browsers don't deal with white space the way a word processor does. Very roughly speaking, your browser will display only one space for one or more whitespace characters. if you want spaces, use css, nbsp; or br HTH Ray snip code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] simple OCR in php
Hello all, I am looking for a way to incorporate some simple OCR into a php script. The user will bulk scan a pile of invoices. I want the php script to look at each invoice and read a number off the invoice. The image will then be renamed, and be organized into a directory and the file name will be added to a database. (all of these steps are straight forward once the number is read.) I have no problem with a system that requires a special OCR font and/or some sort of registration mark to help locate the Invoice number. Can anybody tell me of any tools out there that can do this? Thanks, Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple OCR in php
On Friday 29 June 2007 10:32 am, you wrote: [snip] I am looking for a way to incorporate some simple OCR into a php script. The user will bulk scan a pile of invoices. I want the php script to look at each invoice and read a number off the invoice. The image will then be renamed, and be organized into a directory and the file name will be added to a database. (all of these steps are straight forward once the number is read.) I have no problem with a system that requires a special OCR font and/or some sort of registration mark to help locate the Invoice number. Can anybody tell me of any tools out there that can do this? [/snip] In short PHP cannot perform OCR functions. You could insert an OCR application into the process and have the OCR app pass PHP the information. Exactly. Are there any third party tools or OCR applications that anybody can recommend? (I suppose you could write an OCR application in PHP, but that sounds like an awful lot of work.) Thanks Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple OCR in php
On Tuesday 03 July 2007 12:03 am, Richard Lynch wrote: On Sat, June 30, 2007 12:12 pm, Jay Blanchard wrote: [snip] In short PHP cannot perform OCR functions. Why? PHP provides all requisite functions/features so if someone was sadistic enough and talented enough there's nothing to stop them writing an OCR app using it. [/snip] Sure, but then the scanning device would have to be connected to the server. I suppose you could open a socket and stream the information to the server and then have PHP read and interpret the stream as it arrives. See how complex this is becoming? No, the scanning device could be on a desktop that builds a folder of files with names that can be tied back to the documents somehow. Or, for what the OP asked for, the whole thing could be on a server which is really a desktop where having the scanner connected would be pretty normal. actually, the scanner is on a desktop, and (to make a long story short) the server has part of the desktop hard-drive mounted as a network drive. Cron job tells php script to go look in a given folder on the desktop, process all files, and clean up after itself, all at 3 or 4 am. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unlink file older then 7 days
On Saturday 14 July 2007 9:16:06 pm [EMAIL PROTECTED] wrote: I have a directory with .txt and .txt.asc files. What I want to do is.. Check the age of all files ending in .txt.asc and if the file *.txt.asc is older then 7 days delete thatfile.txt.asc and also thatfile.txt look at these functions (and also related functions, the bar on the right hand side): http://ca3.php.net/manual/en/function.opendir.php http://ca3.php.net/manual/en/function.fileatime.php http://ca3.php.net/manual/en/function.unlink.php HTH Ray Thanks Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unlink file older then 7 days
-Original Message- From: [EMAIL PROTECTED] To: php-general@lists.php.net Date: Mon, 16 Jul 2007 14:25:47 +0100 Subject: Re: [PHP] Unlink file older then 7 days How would I use fileatime to check if the file is older then 7 days? something like: $access = fileatime (c:\path\to\file);//assuming windows server if ((time()-$access)(7*24*60*60)){ do whatever with old files } off the top of my head. There are other ways to do it. Ray I have a directory with .txt and .txt.asc files. What I want to do is.. Check the age of all files ending in .txt.asc and if the file *.txt.asc is older then 7 days delete thatfile.txt.asc and also thatfile.txt -- 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] get and post together
Hi all, I've done something and I want to know if I should be ashamed :) I've set up a form with method=POST and target =page.php?foo=bar it works fine. $_POST[...] gives me the data I want and $_GET['foo']=='bar'. I freely admit it's an ugly kludge, but is it bad? Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] get and post together
On Wednesday 08 August 2007 10:29:33 pm Richard Lynch wrote: On Wed, August 8, 2007 10:18 pm, Ray wrote: I've done something and I want to know if I should be ashamed :) I've set up a form with method=POST and target =page.php?foo=bar it works fine. $_POST[...] gives me the data I want and $_GET['foo']=='bar'. I freely admit it's an ugly kludge, but is it bad? Almost for sure that is a Documented Feature of HTTP protocol. I've certainly never seen it fail. Thanks, I feel better. (I definitely realize that method = post doesn't mean ignore security) Ray -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MAX_FILE_SIZE not working with file uploads
On Saturday 22 September 2007 7:44:55 pm Jeff Cohan wrote: Dan Parry wrote: I might be wrong but this would be classed as 'exploitable'... Webservers should not be allowed to read from or write to clients... Of course there is ActiveX... I think we're off the point. My script is simply interrogating the value of the $_FILES[userfile][size] array element. It's coming up as ZERO if it exceeds the MAX_FILE_SIZE. Exactly, no valid file was uploaded. The size of the valid file is therefore zero. That seems odd to me. But maybe that's the way it's SUPPOSED to work. That's why I started this thread out with What am I missing?. Said another way: It seems that the server had to know the size of the file in order to know it exceeded MAX_FILE_SIZE. So how can my script find out the size? Can you use Javascript to check file size client side, send data via AJAX then issue warnings? (Remember the php mantra: PHP is a server side language ) As noted in the php.net documentation you quoted, and as mentioned previously, MAX_FILE_SIZE is a _hint_ to the browser. some browsers just don't take hints. Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MAX_FILE_SIZE not working with file uploads
On Saturday 22 September 2007 7:39:01 pm Dan Parry wrote: -Original Message- From: Ray [mailto:[EMAIL PROTECTED] Sent: 23 September 2007 02:25 To: php-general@lists.php.net Subject: Re: [PHP] MAX_FILE_SIZE not working with file uploads On Saturday 22 September 2007 7:44:55 pm Jeff Cohan wrote: Dan Parry wrote: I might be wrong but this would be classed as 'exploitable'... Webservers should not be allowed to read from or write to clients... Of course there is ActiveX... I think we're off the point. My script is simply interrogating the value of the $_FILES[userfile][size] array element. It's coming up as ZERO if it exceeds the MAX_FILE_SIZE. Exactly, no valid file was uploaded. The size of the valid file is therefore zero. That seems odd to me. But maybe that's the way it's SUPPOSED to work. That's why I started this thread out with What am I missing?. Said another way: It seems that the server had to know the size of the file in order to know it exceeded MAX_FILE_SIZE. So how can my script find out the size? Can you use Javascript to check file size client side, send data via AJAX then issue warnings This would be the exploitable 'feature' I mentioned... Client-side files should never be readable Dan If the contents of a file were readable, I would definitely agree with you. I'm not convinced that the ability to detect the filesize of a file that the user selected would be exploitable, but it's a moot point as it doesn't work in javascript. (as someone else pointed out, maybe activeX?) I'm not a javaScript expert, but I am learning, so I dug out the book, and put together the following script. (Ugly, insecure, and doesn't really do anything, but quick and It works, at least on my machine/browser combo) Select a file, and the page will tell you everything It can about the file. My machine reports size as zero. Ray (Script guaranteed to occupy 0 or more bites of diskspace.) html headTITLEtest/TITLE script type=text/javascript function uptest() { alert (document.test.fileTest.defaultValue); alert (document.test.fileTest.form); alert (document.test.fileTest.name); alert (document.test.fileTest.readOnly); alert ('size follows'); alert (document.test.fileTest.size); alert (document.test.fileTest.type); alert (document.test.fileTest.value); } /script /head body form name=test method=post File: input type=file onchange=uptest() name=fileTest/ /form /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with exec()
hello; I am trying to write a script to do some auto configuration of my webserver. Part of the process involves copying some configuration files from other places on the server to a working directory where they can be modified. I am running freeBSD 6.0, Apache 2.2.3, php 5.1.5 I can't seem to get the exec() command to work. I have an external shell script called 'copy' that takes care of getting files. script is currently set to mode 777 when run from the shell it works perfectly. however, in the php script echo exec('whoami'); exec('/path/to/copy'); the only return is 'www' (the username correctly returned from whoami) also files aren't changed. any suggestions, pointers, log files to check would be appreciated as I have spent several hours on google, in manuals, etc. haven't tried the ougi board, but that's about it ;-) tia Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with exec()
Hi, thanks for your help. I was using exec('/path/to/copy', $return); var_dump($return); (but I simplified it for posting) and I was still getting no output. actually, the return value is the least of my concerns, I just want this script to move some files around and the script works from the command line. as for safe_mode, it's off. Also the whoami in the previous line works as expected. Any pointers would be appreciared. Tia Ray -Original Message- From: Jan Schröter [EMAIL PROTECTED] To: php-general@lists.php.net Date: Thu, 30 Nov 2006 09:09:49 +0100 Subject: Re: [PHP] problems with exec() Think he's not getting an general error - just didn't read the manual concerning the return value of exec. kind regards jan Juanjo Pascual wrote: What is the safe_mode value in your php.ini? To run exec the value of your safe_mode has to be OFF. [EMAIL PROTECTED] escribió: Try exec('/path/to/copy', $return); print_r($return); read the manual : http://nl3.php.net/manual/en/function.exec.php Description string exec ( string command [, array output [, int return_var]] ) gr, Thijs On Wed, 29 Nov 2006 23:22:13 -0700, Ray [EMAIL PROTECTED] wrote: hello; I am trying to write a script to do some auto configuration of my webserver. Part of the process involves copying some configuration files from other places on the server to a working directory where they can be modified. I am running freeBSD 6.0, Apache 2.2.3, php 5.1.5 I can't seem to get the exec() command to work. I have an external shell script called 'copy' that takes care of getting files. script is currently set to mode 777 when run from the shell it works perfectly. however, in the php script echo exec('whoami'); exec('/path/to/copy'); the only return is 'www' (the username correctly returned from whoami) also files aren't changed. any suggestions, pointers, log files to check would be appreciated as I have spent several hours on google, in manuals, etc. haven't tried the ougi board, but that's about it ;-) tia Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with exec() SOLVED
Thanks for the help. :) I posted to the freeBSD list and was given the answer there. in case anyone is interested and for the sake of the archive, I needed a path specified in the shell script. The following URL provides the necessary info for fixing the script. http://linux.dbw.org/shellscript_howto.html again thanks. Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need for $_POST[''] changed after server upgrade
Hello All, We just upgraded our server at work, and one client's web site stoped working. I didn't write the code, I just get to clean up someone else's mess. :) After a little troubleshooting, I found that forms refered back to the same script. so far, so good. very normal. The strange part was the variable names were just $foo not, $_POST['foo']. After the upgrade, the variable $foo was not recognized when the form was processed, so of course, everything failed. My solution was to put if (isset($_POST[foo])) {$foo=$_POST[foo]}; at the top of the script. This seems to make everything work. My two questions are: first, is there a better way to fix this, and second, how did this work in the first place? TIA Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] need for $_POST[''] changed after server upgrade
Hello, Thanks Matt, I appreciate your help. your solution is a lot easier than mine. It's also nice to understand what was happening. I was introduced to PHP after that type of globals were considered 'evil' so I hadn't seen code written that way. Ray -Original Message- From: Matt Babineau [EMAIL PROTECTED] To: 'Ray' [EMAIL PROTECTED], php-general@lists.php.net Date: Sun, 11 Dec 2005 22:42:46 -0800 Subject: RE: [PHP] need for $_POST[''] changed after server upgrade Register globals is no longer ON I believe. That is why it happened. To fix this: Foreach($_POST as $key = $value) ${$key} = $value; That will convert all of your post variables to local variables. :) Thanks, Matt Babineau Criticalcode 858.733.0160 [EMAIL PROTECTED] http://www.criticalcode.com TAKE ORDERS from the WEB and add them right into QUICKBOOKS! Ask me how... -Original Message- From: Ray [mailto:[EMAIL PROTECTED] Sent: Sunday, December 11, 2005 10:29 PM To: php-general@lists.php.net Subject: [PHP] need for $_POST[''] changed after server upgrade Hello All, We just upgraded our server at work, and one client's web site stoped working. I didn't write the code, I just get to clean up someone else's mess. :) After a little troubleshooting, I found that forms refered back to the same script. so far, so good. very normal. The strange part was the variable names were just $foo not, $_POST['foo']. After the upgrade, the variable $foo was not recognized when the form was processed, so of course, everything failed. My solution was to put if (isset($_POST[foo])) {$foo=$_POST[foo]}; at the top of the script. This seems to make everything work. My two questions are: first, is there a better way to fix this, and second, how did this work in the first place? TIA Ray -- 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] Parse Error
Jay Blanchard wrote: [snip] I am a noob and super confused right now. I have some really simple code and i am getting an error that reads: *Parse error*: syntax error, unexpected T_VARIABLE in */var/www/mysql_up.php* on line here is the code: html headtitleTest MySQL/title/head body !-- mysql_up.php -- ?php $host=localhost $user=ray $password=* [/snip] Notice anything missing here? Semi-colons at the end of each line. Thanks. did i say i was a n00b? :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] upgrading to php 4.3.11 gets me No input file specified
upgrading from 4.3.10 - 4.3.11 test script: ? phpinfo(); ? OS: Win2000 Server: Website 3.5 Server API: isapi php folder C:\php path includes c:\php PHPRC = c:\php C:\WINNT doesn't have any files with php in their name. installed 4.3.11 by renamed c:\php to php-4.3.10 unzipped the 4.3.11 file renamed the 4.3.11 folder to php copied php-4.3.10\php.ini to c:\php restarted WebSite opened up http://server/info.php - No input file specified switched back to 4.3.10 by renamed c:\php to php-4.3.11 renamed php-4.3.10 c:\php restarted WebSite opened up http://server/info.php - normal info What did i miss, or how do i get 4.3.11 to work? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Freelance code optimizations
also, if you can compare to a constant, there is a notable difference as well. ?php $i = 0; $a = 1000; while( $i++ $a ){} ? real0m10.268s user0m10.000s sys 0m0.030s ?php $i = 0; $a = 1000; while( $i++ 1000 ){} ? real0m7.057s user0m6.880s sys 0m0.020s so if $a is something like the size of an array or another thing that affects the number of times the loop needs to be run. then if you can, reverse the order of the loop so you can compare to 0 (or another constant) ?php $a = 1000; $i = $a; while( $i-- 0 ){} ? real0m7.111s user0m6.870s sys 0m0.040s YMMV On Monday 11 August 2003 13:10, Robert Cummings wrote: On Mon, 2003-08-11 at 13:29, Chris W. Parker wrote: * while loop $ctr = 0; $val = 0; while($ctr10) { $val++; $ctr++; } ** for loop $val = 0; for($ctr=0;$ctr10;$ctr++) { $val++; } I get the following results (very consistently +/- .1) which agrees with your results and also shows an improvement over your own optimization. for( $i = 0; $i 1000; $i++ ){} time php foo.php Content-type: text/html X-Powered-By: PHP/4.3.2 4.42user 0.03system 0:04.60elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (528major+216minor)pagefaults 0swaps --- $i = 0; while( $i 1000 ){ $i++; } time php fee.php Content-type: text/html X-Powered-By: PHP/4.3.2 4.22user 0.01system 0:04.43elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (527major+216minor)pagefaults 0swaps --- $i = 0; while( $i++ 1000 ){} time php foo.php Content-type: text/html X-Powered-By: PHP/4.3.2 2.97user 0.00system 0:03.09elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (526major+216minor)pagefaults 0swaps --- Notice the large difference when the incrementation occurs within the while check itself. Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Warning Spammer
so your one of those people tha bounce them. i have had my email address used in a number of spams (and a few virus sends) and it blows! the bounces follow the from. the spammer has no clue that it bounced, nor do they really care. instead there is someone (sometimes) at the other end of the from getting hate email and bounces, if not then its just another server recieving the spam in bulk from bad addresses or dictionary attacks. just check WHO your bouncing it to sometime is it bouncing to [EMAIL PROTECTED] or [EMAIL PROTECTED] On Tuesday 10 June 2003 17:13, you wrote: So dont buy it...download a free copy and for the next month or so bounce all the spam crap back to the spammersat least you will be taken off some of their lists as your address will be marked as invalid... Just my 2 cents coz thats what i am doing, cant do much else can we? Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!! can someone tell me whats wrong here? (newbie)
else if ($userlogin $userpass == $admin $adpw) { this line probably isn't going to do what your thinking it will. you probably want either else if ($userlogin == $admin $userpass == $adpw) { or else if (strcasecmp($userlogin,$admin) == 0 strcasecmp($userpass,$adpw) == 0) { -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function to discover if value is already in array
On Friday 21 February 2003 09:08, you wrote: Here is an example array: array( array(1,2), array(2,3), array(3,1) ) now suppose I get some form inputs with the value 1 and 1. I am trying to find a way to figure out if the first coloumn is already in the table and if so just add the second coloumn to the first. I have tried various combinations of foreaches, in_array and array_search. Has anyone had a similar problem and found a soloution? would something like array( 1 = 2, 2 = 3, 3 = 1 ) work? and use array_key_exists to see if the 1st 'colomn' has a value of one? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: functions and a href
does the function logout() log someone out of a session, or does it return the url for where they go to logout? and what about it isn't working? On Monday 03 March 2003 16:32, you wrote: Ok to make it simplier, this is what I wanna do! ?php echo a href=logout();Logout/A; function logout() { . } ? How do I do it!!! /M Hi I want to call a function logout() inside an a href statement: a href=\?= logout() ?\logout/a ?php function logout() { } ? but this doesnt work.. how shall I do it /M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] form submit oddities?
i have posted the question to phpMyAdmin user list already and after talking with someone about my problem, it looks like its not in the phpMyAdmin, but in my settings for php, but they seemed to have no clue as to what. anyways, with a clean install of phpMyAdmin 2.4.0 we can't query the database through any form that has a file upload when we disable file upload totally it works (minus the file uploading) i tacked echo pre; print_r(get_defined_vars()); echo /pre; at the begining of the file that the form submits to and when the form has enctype=multipart/form-data in it the page outputs Array ( [HTTP_POST_VARS] = Array ( ) [_POST] = Array ( ) [HTTP_GET_VARS] = Array ( ) [_GET] = Array ( ) at the top, and when there isn't the enctype attribute on the form tag there is post information available. Array ( [HTTP_RAW_POST_DATA] = is_js_confirmed=0lang=en-iso-8859-1server=5db=mysqltable=dbpos=0goto=tbl_properties.phpzero_rows=Your+SQL-query+has+been+executed+successfullyprev_sql_query=dummy=Hostsql_query=SELECT+*+FROM+%60db%60+WHERE+1show_query=1sql_file=sql_file_compression=text%2FplainSQL=Go [HTTP_POST_VARS] = Array ( [is_js_confirmed] = 0 [lang] = en-iso-8859-1 [server] = 5 [db] = mysql [table] = db [pos] = 0 [goto] = tbl_properties.php [zero_rows] = Your SQL-query has been executed successfully [prev_sql_query] = [dummy] = Host [sql_query] = SELECT * FROM `db` WHERE 1 [show_query] = 1 [sql_file] = [sql_file_compression] = text/plain [SQL] = Go ) [_POST] = Array ( [is_js_confirmed] = 0 [lang] = en-iso-8859-1 [server] = 5 [db] = mysql [table] = db [pos] = 0 [goto] = tbl_properties.php [zero_rows] = Your SQL-query has been executed successfully [prev_sql_query] = [dummy] = Host [sql_query] = SELECT * FROM `db` WHERE 1 [show_query] = 1 [sql_file] = [sql_file_compression] = text/plain [SQL] = Go ) [HTTP_GET_VARS] = Array ( ) [_GET] = Array ( ) server: win2k, apache 1.3.27, php 4.2.2 clients: linux galeon winxp ie6 win2k ie5 so, what is most likely wrong with my config/setup? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strange problem with size of uploaded files..
I've searched all over for the answer to this problem.. but haven't found anything.. I have a script that i use to upload files to a webserver and download them via my phone.. problem is, the files end up being about twice the size of the original file.. for example,i upload a midi that is 22022 bytes, on the server it ends up being 42762 bytes. they are mostly midi and jpeg files.. this has worked fine in for the last 3 or 4 months on a different server. i recently moved my script to my other server and this started happening.. the old server was on linux, Apache/1.3.27 PHP Version 4.3.0 the new server is on linux, Apache/2.0.44 PHP Version 4.3.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uncompressing gz string
i had a similar problem, it seems that a .gz file had 10 bytes of header that inflate and uncompress didn't like, or something wierd like that. but i can't find the code that i had in the end. http://www.php.net/manual/en/function.gzinflate.php but depending on how your actually using the data, one of the 'read from the file' might serve you better http://www.php.net/manual/en/function.gzread.php http://www.php.net/manual/en/function.gzgets.php http://www.php.net/manual/en/function.gzpassthru.php On Friday 24 October 2003 13:48, you wrote: I don't understand why gzinflate and gzuncompress don't work? ?php $gz_content = file_get_contents('hello.txt.gz'); echo gzinflate($gz_content); // Warning: data error echo gzuncompress($gz_content); // Warning: data error ? but if I make it from bash the content is there : cat hello.txt.gz | gunzip Hello! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] prepend file to all scripts...
snip from: http://www.php.net/manual/en/configuration.directives.php auto_prepend_file string Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the include() function, so include_path is used. The special value none disables auto-prepending. auto_append_file string Specifies the name of a file that is automatically parsed after the main file. The file is included as if it was called with the include() function, so include_path is used. The special value none disables auto-appending. Note: If the script is terminated with exit(), auto-append will not occur. http://www.php.net/manual/en/configuration.directives.php On Friday 24 October 2003 15:00, Jonathan Villa wrote: I thought I read that this was possible once, but I can't find anything to substantiate/refute it... Is it possible to prepend a configuration file to my pages? For example, I have a app.config.inc file which contains an application specific include path as well as includes the classes my application needs. Currently this file is in my web root, but I would like to place it outside of my web root but still include it in all of my pages... Is this possible? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why is the php loop, 'for()', so slow????
try $res_str_len = strlen($res_str); for ($i=1;$i$res_str_len;++$i) one less function call in the loop and the prefix version of ++ is sometimes a tad faster then the postfix version. On Wednesday 19 November 2003 15:11, you wrote: function CBC_XML_BreakUp($strResponse_XML, $strResponse_HTML) { global $res_str; $XML_Start = Null!; $XML_End = Null!; $HTML_Start = Null!; $HTML_End = Null!; //This loop work only for [XML[XML[HTML]]], not [XML[XML][HTML]]... //If the 'Options' variable in the Query URL string is altered to receive [XML[XML][HTML]] then this loop is invalid and a new loop script is needed... for ($i=1;$istrlen($res_str);$i++) { if (substr($res_str, $i, 9) == ![CDATA[) { if ($XML_Start == Null!) { $XML_Start = ($i + 9); } else { $HTML_Start = ($i + 9); } } if (substr($res_str, $i, 3) == ]]) { //The code ' $HTML_Start Null! ' was inserted to allow the closing of the Trans Union's CDATA (XML) tag //since HTML won't be present or returned at this time of the error... if (($HTML_End == Null!) ($HTML_Start != Null!)) { $HTML_End = $i; } else { $XML_End = $i; } } } //This few lines of codes loop work only for [XML[XML[HTML]]], not [XML[XML][HTML]]... //If the 'Options' variable in the Query URL string is altered to receive [XML[XML][HTML]] then this loop is invalid and a new loop script is needed... if ($HTML_Start != Null! || $HTML_End != Null!) { $strResponse_XML = substr($res_str, $XML_Start, ($HTML_Start - $XML_Start)).* HTML/JavaScript codes stripped out by Visual Basic's written codes *.substr($res_str, $HTML_End, (($XML_End - $HTML_End) - 3)); $strResponse_HTML = substr($res_str, $HTML_Start, ($HTML_End - $HTML_Start)); } else { $strResponse_XML = substr($res_str, $XML_Start, ($XML_End - $XML_Start)); $strResponse_HTML = Empty!; } } set_time_limit(160); $res_str = REPORT_RESPONSEClientAccountIdentifier**/ClientAccountIde ntifier ClientNameThe Motor Zone/ClientNameServiceProviderNameCBC Companies/ServiceProviderNameTransactionDateTime2003-11-19T15:1 8:39/Tra nsactionDateTimeRESPONSERESPONSEDATA Filename=\z002g1es.XML\ ResponseDataFormatType=\XML\![CDATA[?xml version=\1.0\ encoding=\UTF-8\?RESPONSE_GROUP MISMOVersionID=\2.1\RESPONDING_PARTY _Name=\CREDIT BUREAU\ _StreetAddress=\**\ _City=\***\ _State=\**\ _PostalCode=\*\CONTACT_DETAILCONTACT_POINT _RoleType=\Work\ _Type=\Phone\ _Value=\*\/CONTACT_POINT _RoleType=\Work\ _Type=\Fax\ _Value=\*\//CONTACT_DETAIL/RESPONDING_PARTYRESPOND_TO_P ARTY _Name=\*\ _StreetAddress=\*\ _StreetAddress2=\\ _City=\*\ _State=\**\ _PostalCode=\*\CONTACT_DETAIL _Name=\*\//RESPOND_TO_PARTYRESPONSE ResponseDateTime=\2003-11-19T15:19\ InternalAccountIdentifier=\***\KEY _Name=\Loan Number\ _Value=\0\/RESPONSE_DATACREDIT_RESPONSE MISMOVersionID=\2.1\ CreditResponseID=\RN1\ CreditReportIdentifier=\***\ CreditReportFirstIssuedDate=\2003-11-19T15:19\ CreditReportLastUpdatedDate=\2003-11-19T15:19\ CreditReportMergeType=\PickAndChoose\ CreditReportType=\Merge\ CreditRatingCodeType=\Equifax\CREDIT_BUREAU _Name=\CREDIT BUREAU\ _StreetAddress=\*\ _City=\**\ _State=\**\ _PostalCode=\**\CONTACT_DETAILCONTACT_POINT _RoleType=\Work\ _Type=\Phone\ _Value=\**\/CONTACT_POINT _RoleType=\Work\ _Type=\Fax\ _Value=\**\//CONTACT_DETAIL/CREDIT_BUREAUCREDIT_REPORT_ PRICE _Amount=\5.00\ _Type=\Total\/CREDIT_REPOSITORY_INCLUDED _EquifaxIndicator=\N\ _ExperianIndicator=\N\ _TransUnionIndicator=\Y\/REQUESTING_PARTY InternalAccountIdentifier=\**\ LenderCaseIdentifier=\0\ _Name=\**\ _StreetAddress=\*\ _StreetAddress2=\**\ _City=\**\ _State=\**\ _PostalCode=\**\ _RequestedByName=\**\/BORROWER BorrowerID=\BO1\ _FirstName=\BLUE\ _LastName=\SPEED\ _PrintPositionType=\Borrower\ _SSN=\0\ _UnparsedName=\BLUE SPEED\_RESIDENCE _StreetAddress=\333 W RACEWAY\ _City=\FANTASY ISLAND\ _State=\IL\ _PostalCode=\60750\ BorrowerResidencyDurationMonths=\00\ BorrowerResidencyDurationYears=\00\ BorrowerResidencyType=\Current\PARSED_STREET_ADDRESS _DirectionPrefix=\W\ _HouseNumber=\333\ _StreetName=\RACEWAY\//_RESIDENCE_RESIDENCE _StreetAddress=\333 W RACEWAY\ _City=\FANTASY ISLAND\ _State=\IL\ _PostalCode=\60750\ BorrowerResidencyType=\Prior\PARSED_STREET_ADDRESS _DirectionPrefix=\W\ _HouseNumber=\333\ _StreetName=\RACEWAY\//_RESIDENCEEMPLOYER _Name=\EMPRESS CASINO\ PreviousEmploymentStartDate=\2003-11-01\/EMPLOYER _Name=\NOT AVAILABLE\ PreviousEmploymentStartDate=\2003-11-01\//BORROWERBORROWER BorrowerID=\BO2\ _FirstName=\RACER\ _LastName=\SPEED\ _PrintPositionType=\CoBorrower\ _SSN=\600016000\ _UnparsedName=\RACER SPEED\_RESIDENCE _StreetAddress=\333 W RACEWAY\ _City=\FANTASY ISLAND\ _State=\IL\ _PostalCode=\60750\ BorrowerResidencyDurationMonths=\00\ BorrowerResidencyDurationYears=\00\
[PHP] Two-way on-the-fly encryption
I want to do two-way encryption on a file coming through the web server. In this context, I would want to generate a public and private key, encrypt the file stream (i.e., don't want to write the unencrypted file to disk first and then encrypt it; I want to encrypt the stream as it comes in) with the public, send the private to the recipient, and then destroy both keys on my end. When the file was accessed and the private key was provided, I would want to stream the unencrypted file out without ever writing the unencrypted file to disk. Any ideas on how to accomplish this within the PHP construct? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] On-the-fly encryption
I want to do two-way encryption on a file coming through the web server. In this context, I would want to generate a public and private key, encrypt the file stream (i.e., don't want to write the unencrypted file to disk first and then encrypt it; I want to encrypt the stream as it comes in) with the public, send the private to the recipient, and then destroy both keys on my end. When the file was accessed and the private key was provided, I would want to stream the unencrypted file out without ever writing the unencrypted file to disk. Any ideas on how to accomplish this within the PHP construct? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Two-way on-the-fly encryption
Chris, I thought of that and I do plan on implementing it on the way in and out. However, to meet HIPA and other business requirements, the data can not exist at any point in time on my system in unencrypted form. I do not want to be able to view it and I do not want to know what is there. Any other suggestions? Thanks! PS, sorry about the multiple posts. First time posting and the moderating system confused me. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Two-way on-the-fly encryption
1. When you say on my system in unencrypted form do you indeed mean you want data that can be encrypted and then unencrypted as opposed to a hash like md5() that cannot be reversed? (I only ask this because a lot times people use them synonymously when they should not.) Yes, two way, like PKI. Honestly, I'd like to be able to encrypt the stream as it comes in and decrypt it on the way out. I'd rather not know or have access to, at any time, what's being transfered... 2. This isn't a question really but I spoke with my friend google (maybe you two have met?) and he said this http://www.tonymarston.net/php-mysql/encryption.html;. Haha, Yes, I've heard of him. And yes, I did consult but didn't stumble across this link. Reading it now. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie question... date.
On Tuesday 13 January 2004 13:57, DL wrote: Hi all, I was wondering how you get the year, month, and day from a timestamp. (mySQL timestamp, Eg: 20040113130137) What PHP function(s) do I use? An example would be great Cheers, David http://www.php.net/manual/en/function.strtotime.php copied from the comments (formatting may be lost) scott at pigandcow dot com 29-Dec-2003 09:54 Unfortunately, strtotime() can't convert mysql timestamps of the form MMDDhhmmss (the default 14 character timestamp). Here's a function to do it for you: function convert_timestamp ($timestamp, $adjust=) { $timestring = substr($timestamp,0,8). . substr($timestamp,8,2).:. substr($timestamp,10,2).:. substr($timestamp,12,2); return strtotime($timestring. $adjust); } Remember that the $adjust string needs to be properly spaced- + 30 days, not +30days! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] geographical queries?
we import a database that has among other things, listings of locations by address, city, county and zip, and our customers would like their website to have a 'within $x miles of $address $city $zip' search in addition to the other searching they already have. another customer would like to have a click on the map to do a search of within 25 miles of where on the map they clicked on the same database. anyone have any pointers, tips or links on how to do either of these searches? the database changes frequently (nearly daily updates from a 3rd party that currently is having problems filling in all the fields they said they would give us) and contains over 1 records, so it wouldn't be practical to add information to the records manually to facilitate a location/distance based search. we do add some additional fields automaticly, so it won't be a huge problem/rewrite to add additional columns in an automated fashion. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Writing CRON jobs!
On Tuesday 27 January 2004 07:13, Stuart wrote: Hamid Hossain wrote: Is there any good reference on how to use CRON (I mean on the net)? I need to fire some PHP pages at scheduled time daily or weekly, ... so on. http://www.google.com/search?q=cron+tutorial+php depending on how you need them to fire off a) if cron is on the same machine as the php script, then write the script as a command-line php script http://www.php.net/manual/en/features.commandline.php b) if cron is on a different machine, create a normal web php script with some sort of security and use lynx -dump to call it from cron lynx -dump https://user:[EMAIL PROTECTED]/iben1Bj7s1N/sEg4gIh6G.php either way add the job to the /etc/crontab file man 5 crontab minute hour day of month month day of week user command ie 27 2 * * * bob php4 -q /usr/local/scripts/update.php at 2:27am everyday, run 'php4 -q /usr/local/scripts/update.php' as the user bob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] silly question - setting .php as default extension (Apache)
On Tuesday 09 November 2004 16:04, Brian A. Anderson wrote: Uuuuh... Where do I set the default server extension type to .php in the apache config? Right now the page will execute on my server, but if there is an index.php the server won't automatically open it, but instead browses the directory. Thanks in advance, -Brian Your probably looking for the DirectoryIndex directive. Apache 1.3.x http://httpd.apache.org/docs/mod/mod_dir.html#directoryindex Apache 2.0.x http://httpd.apache.org/docs-2.0/mod/mod_dir.html#directoryindex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with CURL please!
I'm having a problem getting Curl to work properly...and I know its because of this unique situation, so I'm hoping a CURL expert can help me out. I'm trying to access this URL (public search form) using CURL and grab the HTML contents http://enterprisedirectory.ucr.edu/phone/tel_search.show Now the problem is that in order to access that site, a Cookie must be set. For the web browser if you attempt to access the site, it redirects you to http://enterprisedirectory.ucr.edu, sets the cookie then sends you back. In PHP if I call curl on this site, instead of grabbing the contents it physically redirects the browser to http://enterprisedirectory.ucr.edu (thus leaving my script) and then back to the search page (still not in my script) So im thinking the only way to do this is to use CURL, pass a cookie along with the CURL requests and then it will not do the redirect on me. Well the problem with that is when I view my cookies I can see the cookie that was set, but in my cookies.txt (or Cookie folder in IE) there is no record of this cookie!!?? So i tried doing this and creating a cookie file with the contents enterprisedirectory.ucr.edu TRUE/phone/ TRUE1181508361 SearchID5851 Then in PHP use this $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT,120); curl_setopt($ch, CURLOPT_COOKIEFILE, cookie.txt); //curl_setopt($ch, CURLOPT_POST, 1); //curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $results = curl_exec($ch); curl_close($ch); That did not work, but Im assuming I did it wrong. Can someone please help me out with this, I really need to get this working. After about 5 hours of this im pulling my hair out and begging for help. Thank you -Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with CURL please
I'm having a problem getting Curl to work properly...and I know its because of this unique situation, so I'm hoping a CURL expert can help me out. I'm trying to access this URL (public search form) using CURL and grab the HTML contents http://enterprisedirectory.ucr.edu/phone/tel_search.show Now the problem is that in order to access that site, a Cookie must be set. For the web browser if you attempt to access the site, it redirects you to http://enterprisedirectory.ucr.edu, sets the cookie then sends you back. In PHP if I call curl on this site, instead of grabbing the contents it physically redirects the browser to http://enterprisedirectory.ucr.edu (thus leaving my script) and then back to the search page (still not in my script) So im thinking the only way to do this is to use CURL, pass a cookie along with the CURL requests and then it will not do the redirect on me. Well the problem with that is when I view my cookies I can see the cookie that was set, but in my cookies.txt (or Cookie folder in IE) there is no record of this cookie!!?? So i tried doing this and creating a cookie file with the contents enterprisedirectory.ucr.edu TRUE/phone/ TRUE1181508361 SearchID5851 Then in PHP use this $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT,120); curl_setopt($ch, CURLOPT_COOKIEFILE, cookie.txt); //curl_setopt($ch, CURLOPT_POST, 1); //curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $results = curl_exec($ch); curl_close($ch); That did not work, but Im assuming I did it wrong. Can someone please help me out with this, I really need to get this working. After about 5 hours of this im pulling my hair out and begging for help. Thank you -Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mime type over http post?
Hello, I'm trying to write a web-based aplication that talks to a third party server. I'm having a hard time getting support from from them. the method of comunication (direct quote from their docs is: Data will be transferred to [server] via an HTTP POST operation using the MIME type, text/xml can anybody tell me what this means or how I do it using php? Thanks, Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mime type over http post?
On Wednesday 16 May 2007 11:12 am, Stephen wrote: I'm having a hard time getting support from from them. the method of comunication (direct quote from their docs is: Data will be transferred to [server] via an HTTP POST operation using the MIME type, text/xml They want you to mimic what a browser would send to a web site when the user clicks a send button in a form. Hi, They have supplied very detailed docs for the XML, but the part that really throws me Is the mime type. Is this just another header? Thanks, Ray You use PHP to create the header for the page request, but you need to study HTTP documentation to understand what you need to send. It seems very unreasonable of them to have not supplied sample code. Good luck. Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mime type over http post?
Thanks for your help everybody. I think I'll give the other company a link to this thread for the next person who asks for help. Ray On Wednesday 16 May 2007 6:57 pm, Oliver Block wrote: Hello Ray, 1. create the xml markup (dom) 2. open a connection to the 3rd party server (fsockopen) 3. send the header (fputs) 4. send the body (fputs) 5. close the connection Additional Questions? Best Regards, Oliver P.S: I just know better where to look for information:-) - original Nachricht Betreff: [PHP] mime type over http post? Gesendet: Mi, 16. Mai 2007 Von: Ray[EMAIL PROTECTED] Hello, I'm trying to write a web-based aplication that talks to a third party server. I'm having a hard time getting support from from them. the method of comunication (direct quote from their docs is: Data will be transferred to [server] via an HTTP POST operation using the MIME type, text/xml can anybody tell me what this means or how I do it using php? Thanks, Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- original Nachricht Ende -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script execution
On Monday 09 March 2009 15:38:37 Michael A. Peters wrote: George Larson wrote: Thanks everybody! I guess I was a little vague. I'm working on an OpenSUSE setup with Apache, MySQL and PHP. I just knew that my confusion was because of my Windows up-bringing. The writing I referred to was to a file. One example is I had a script that was pulling data from a database and using it to generate PDF files. This would work fine from the command line but not if I pointed a browser at it. It wasn't an important difference because that script is a cronjob anyway. I just wanted to understand what was going on and how I could change it -- if I find later that I need to. Give the user apache runs as permission to write to the directory where the PDF files are generated. I don't know what use apache run as on SuSE but if it was, say, www - as root: chown www /path/to/directory/where/you/want/the/output I only scanned the thread, So apologies if someone else already said this. Another problem I've come across is that the path variable is not the same when run under the browser as on the command line, so instead of issuing command you need /path/to/command Ray -- 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] What is wrong with this code
On Friday 03 April 2009 13:08:45 Gary wrote: This is driving me nuts. I am getting blank emails and the only information that is being passed to MySQL is the IP address. Can someone tell me what is wrong with this? form method=post action=?php echo $_SERVER['PHP_SELF']; ? div id=important style=visibility:hidden; pIf you can see this, it's an anti-spam measure. Please don't fill in the address field./p label for=addressAddress/label input type=text name=address id=address //div label for=nameName:/label input name=name type=text /br / label for=emailEmail Address:/label input name=email type=text / br / label for=nameComments:/label textarea name=comments cols=50 rows=/textarea input name=submit type=button value=submit //form shouldn't this be submit? ?php // Receiving variables $ip= $_SERVER['REMOTE_ADDR']; $name = $_POST['name']; $email = $_POST['email']; $comments = $_POST['comments']; I hope this is simplified code, and you're going to do more filtering above? //spam filter, do not touch if ($_POST['address'] != '' ){ die(Changed field); } //endo fo spam filter $header = From: $email\n . Reply-To: $email\n; $subject = Response from Assessment Lawyer; $email_to = sanitized; $message = name: $name\n . email: $email\n . comments: $comments\n .Visitors IP: $ip\n; mail($email_to, $subject, $message, $header); $dbc= mysqli_connect(sanitized,sanitized,sanitized,sanitized)// I have removed the actual information, but it was connecting! or die('Could not connect to db'); $query = INSERT INTO sanitized VALUES(0,'$name', '$email','$comments','$ip'); $result = mysqli_query($dbc, $query) or die('Error querying database.'); mysqli_close($dbc); echo 'Thank you $name for submitting your inquiry!br /'; echo 'You have supplied the following information:br /'; echo 'Name: $name br /'; echo 'Email Address: $email br /'; echo 'Comments: $comments'; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with gnupg extension.
Hello all, I'm trying to use the gnupg extension and I think everything is properly installed. I'm just using test data. I'm encrypting and then immediately decrypting. But the decryption is failing with a unhelpful error message. error message : Warning: gnupg::decrypt() [gnupg.decrypt]: decrypt failed in /path/to/test2.php on line 18 any help or suggestions would be very much appreciated. details follow. Ray full output: raw data: this is a test encoded data: -BEGIN PGP MESSAGE- Version: GnuPG v2.0.11 (FreeBSD) hQIOA9qOyyMyQ2/bEAgArxLuVw5eShkL+/g9SCGcBm5/J1G78zrh6dWFisPFqWg1 MP3zj/QnWiD9zEtLmGJazP51pV2TpySpEbILze8sz6c/imRBYLrHhbxO6W1LJqXq rALUPDIe4qKtM7mC+K9EdFdkYRzWxi45eTK1DQtQazhqelWIb1NuaVu8vUKk/pIy duE0juP2j+8OHIlx36sUcATkvBO5a7Ak9tGUT5T5lRqjMzKa6TPuCsZukmVh43BG uqpz7H83LinwOCfUnyq3R2e/vIM2cv8t7jz17acOfYslonMxNz54i8jR8COmCmLY NhGORZUSLauyWGxAIDvkDcTFD4Jd5KxaXcMPEE7zwAf9HUWmKtqOqn825AjlBxNj 7gXEOtpsRMiYiYuISzHvitpPWXQPOPsoGnPRZZBvCNJcvAgg6hMx5c4Y7tGXTsma 2hkC9f4959kBwiGAFnQxJqz2pMDW+N3X23f+kwSrU7KoNrhnxUV1ywcUGaebwYM8 emIygCm6mS7T81JtXxhMto0sSqeE/zwHc3/03/KP57V7j2tHib4dN9ZOfB6yiubF PIwog0JYagjOfyNdGh3vRzvcYdDOqyWMgtY6XpZJwPESJlOADHVt5n844oHthRD3 MJVjwqjEz5qQiPq+kOmd4AdkpkEkRcCweYNEXVXPxpmlrduuu8kc4wsA5v3YXZ/C x9JNAVKW9tdPSxDoxbEKyAhVdurQAxmYe7FaCLl74lACQaUg/Otwb86pjUBesgx6 mXhQv+epG71sKY+LSDxGi8dSgbOOmfI2L09zy9XTEQ4= =85vG -END PGP MESSAGE- [if this line is blank, the decrypt key should have been added correctly]] Warning: gnupg::decrypt() [gnupg.decrypt]: decrypt failed in /path/to/test2.php on line 18 decoded data: Code: ?php $raw_data=this is a test; $passphrase=test; $recipient=m...@example.com; putenv('GNUPGHOME=/www/ohfinder/keys'); $gpg = new gnupg(); $gpg - seterrormode(gnupg::ERROR_WARNING); echo raw data: $raw_databr; $gpg-addencryptkey($recipient); $encrypted = $gpg-encrypt($raw_data); echo brbrencoded data: pre $encrypted/prebr; $gpg-adddecryptkey($recipient, $passphrase); echo $gpg - geterror(); echo [if this line is blank, the decrypt key should have been added correctly]]; echo 'br'; $plaintext = $gpg-decrypt($encrypted); echo $gpg - geterror(); echo brbrdecoded data: pre $plaintext /pre; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problems with gnupg extension.
On Monday 13 April 2009 10:17:28 Ray wrote: Hello all, I'm trying to use the gnupg extension and I think everything is properly installed. I'm just using test data. I'm encrypting and then immediately decrypting. But the decryption is failing with a unhelpful error message. error message : Warning: gnupg::decrypt() [gnupg.decrypt]: decrypt failed in /path/to/test2.php on line 18 any help or suggestions would be very much appreciated. details follow. Ray full output: raw data: this is a test encoded data: -BEGIN PGP MESSAGE- Version: GnuPG v2.0.11 (FreeBSD) hQIOA9qOyyMyQ2/bEAgArxLuVw5eShkL+/g9SCGcBm5/J1G78zrh6dWFisPFqWg1 MP3zj/QnWiD9zEtLmGJazP51pV2TpySpEbILze8sz6c/imRBYLrHhbxO6W1LJqXq rALUPDIe4qKtM7mC+K9EdFdkYRzWxi45eTK1DQtQazhqelWIb1NuaVu8vUKk/pIy duE0juP2j+8OHIlx36sUcATkvBO5a7Ak9tGUT5T5lRqjMzKa6TPuCsZukmVh43BG uqpz7H83LinwOCfUnyq3R2e/vIM2cv8t7jz17acOfYslonMxNz54i8jR8COmCmLY NhGORZUSLauyWGxAIDvkDcTFD4Jd5KxaXcMPEE7zwAf9HUWmKtqOqn825AjlBxNj 7gXEOtpsRMiYiYuISzHvitpPWXQPOPsoGnPRZZBvCNJcvAgg6hMx5c4Y7tGXTsma 2hkC9f4959kBwiGAFnQxJqz2pMDW+N3X23f+kwSrU7KoNrhnxUV1ywcUGaebwYM8 emIygCm6mS7T81JtXxhMto0sSqeE/zwHc3/03/KP57V7j2tHib4dN9ZOfB6yiubF PIwog0JYagjOfyNdGh3vRzvcYdDOqyWMgtY6XpZJwPESJlOADHVt5n844oHthRD3 MJVjwqjEz5qQiPq+kOmd4AdkpkEkRcCweYNEXVXPxpmlrduuu8kc4wsA5v3YXZ/C x9JNAVKW9tdPSxDoxbEKyAhVdurQAxmYe7FaCLl74lACQaUg/Otwb86pjUBesgx6 mXhQv+epG71sKY+LSDxGi8dSgbOOmfI2L09zy9XTEQ4= =85vG -END PGP MESSAGE- [if this line is blank, the decrypt key should have been added correctly]] Warning: gnupg::decrypt() [gnupg.decrypt]: decrypt failed in /path/to/test2.php on line 18 decoded data: Code: ?php $raw_data=this is a test; $passphrase=test; $recipient=m...@example.com; putenv('GNUPGHOME=/www/ohfinder/keys'); $gpg = new gnupg(); $gpg - seterrormode(gnupg::ERROR_WARNING); echo raw data: $raw_databr; $gpg-addencryptkey($recipient); $encrypted = $gpg-encrypt($raw_data); echo brbrencoded data: pre $encrypted/prebr; $gpg-adddecryptkey($recipient, $passphrase); echo $gpg - geterror(); echo [if this line is blank, the decrypt key should have been added correctly]]; echo 'br'; $plaintext = $gpg-decrypt($encrypted); echo $gpg - geterror(); echo brbrdecoded data: pre $plaintext /pre; ? Any suggestions, Anyone? Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Back from the dead with a racing question!
I strongly believe you have nothing to worry about and I think you are over-thinking an issue that will never happen to you. Even if you have 2000 users, you will have nothing to worry about. I manage db's on large scales and have run into every problem I never imaginged and always figured out how to fix it. Throughout the years I have heard this particular issue come up among novices and the heard vaugue suggestions given from people with little experience. There is no way you are going to run across a race condition because queries that are waiting to be processes have the status of wait while a table is locked. Its basically put into a queue. You can use INSERT DELAYED to better manage this if you are using MYISAM if you experience a much higher volume of inserts. For apps that have a very high INSERT frequency, I suggest using INNODB so you won't experience table locking. For your case, you have only 10 users and that is absolutely nothing to worry about. If you are concerned about multiple users accessing a row of data at the same time, you will need to use INNODB and implement transactional queries. This assumes you are using mysql of course. If you are using mssql, then I cannot provide a good answer because I do not use that db. -Ray Solomon - Original Message - From: Jason Pruim ja...@jasonpruim.com To: PHP-General List php-general@lists.php.net Sent: Friday, July 17, 2009 8:12 AM Subject: [PHP] Back from the dead with a racing question! Hi everyone! So some of you may have noticed that I have been away for quite awhile... Been trying to get settled (Moved across the country) and getting a job. And now that that is done I have a question about a project that I might be doing for my current employer and want to do it properly. If all goes through, I'll be writing an online database that upwards of 10 people will be using at various times through out the day. Basically, in a form they fill out a model number, customer name, phone number etc. etc.. And then submit the form. After submitting they need to write the log number on some paperwork. If I have 2 people submit the form at the same time, I'm thinking I could end up with a race condition and they might get the wrong log number (The log number is simply a consecutive record number) Do I need to be reading up on locking tables/rows? Or in my situation as I've briefly described it do I not have to worry about it? Or is there a third door with the magic bullet that will solve all my problems? :) Any advice is greatly appreciated as always, RTFMing is good as well, as long as M is defined :) I'm not afraid of google either, just need the right terms to hit it with so I don't go into search overload as the commercials for a rival search engine claim :) Thanks Everyone! -- 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] Please don't kick me!
- Original Message - From: Philip Thompson philthath...@gmail.com To: PHP General list php-general@lists.php.net Sent: Monday, October 19, 2009 1:47 PM Subject: [PHP] Please don't kick me! Hi all. I know this question has been asked a thousand times on the list, but my searches in the archives are not being nice to me. So... please don't kick me. Currently, we use DOMPDF to generate PDFs from HTML. However, it's no longer maintained and it has a few bugs that we just can no longer live with. What PDF generating software do you use? It does not have to be free, but it must run on linux and may be command line or run through code. Some of the ones I have researched are... html2pdf html2ps html2fpdf xhtml2pdf fpdf tcpdf You're thoughts would be appreciated. Oh, my preference would be to send HTML/CSS to a script and it just automagically convert to PS/PDF. Thanks, ~Philip I've been using ezpdf for many years and I think it is still the best option available. Ihttp://www.ros.co.nz/pdf/ Best Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] seg fault with pecl ps extension
Hello, I'm not positive if this is the right list, or if other info is required. If this is the wrong list, please recomend a better one. If other info is desired, just ask. I am having some problems with the PECL PS (postscript) extension. For some commands, everything works properly, but when the code tries to deal with fonts, it seg faults and core dumps. In my code, the problem appears to be caused by the ps_setfont command. I have some code that uses it that used to work, but no longer does. I have confirmed the same behaviour with the example code that ships with the extension, glyphlist.php for a specific example. I have un-installed and reinstalled the php5-ps (64 bit) package through the package manager to no effect. sample code and system info follows sig. any assistance appreciated, Ray system is Kubuntu 12.10 64bit, kernel version 3.5.0-18, php 5.4.6-1ubuntu1.1 according to php -v my sample code: if two marked lines are left in, seg faults, otherwise works ?php $file=pstest.ps; $fonts_dir='./fonts/'; $font_size=30; $dr2=50; $psdoc = ps_new(); ps_set_parameter($psdoc, 'SearchPath', $fonts_dir); if (!ps_open_file($psdoc, $file)) { print Cannot open PostScript file $file \n; exit; } ps_set_info ($psdoc, 'Orientation' , 'Portrait'); ps_begin_page ($psdoc, 596, 842); $psfont = ps_findfont($psdoc, ArialMT, ); echo br$psfontbr; ps_setfont($psdoc, $psfont, $font_size);//works if these two lines ps_show_xy($psdoc, 'Hello World', 30, 400);//are commented out, ps_setcolor ($psdoc , 'both' , 'rgb', 1, 0, 0, 0); ps_arc ($psdoc, 30, 230, $dr2, 0, 360); ps_stroke($psdoc); ps_end_page($psdoc); ps_delete($psdoc); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] seg fault with pecl ps extension
On November 29, 2012 12:00:44 AM Adam Richardson wrote: On Wed, Nov 28, 2012 at 10:50 PM, Ray r...@stilltech.net wrote: Hello, I'm not positive if this is the right list, or if other info is required. If this is the wrong list, please recomend a better one. If other info is desired, just ask. I am having some problems with the PECL PS (postscript) extension. For some commands, everything works properly, but when the code tries to deal with fonts, it seg faults and core dumps. In my code, the problem appears to be caused by the ps_setfont command. I have some code that uses it that used to work, but no longer does. I have confirmed the same behaviour with the example code that ships with the extension, glyphlist.php for a specific example. I have un-installed and reinstalled the php5-ps (64 bit) package through the package manager to no effect. Hi Ray, Does this issue coincide with an upgrade to PHP 5.4, and if so, which version of PHP were you running before? You could try to email the maintainer listed, Uwe Steinmann u...@steinmann.cx or ste...@php.net, but it looks like it's been a while since anyone has touched that code. If this is because of backwards incompatible changes in PHP (e.g., http://www.php.net/manual/en/migration54.incompatible.php, http://php.net/manual/en/migration53.incompatible.php), you could try to avoid the PHP bindings Uwe developed and merely use PHP to call a C program that directly deals with his project pslib: http://pslib.sourceforge.net/ Sorry for the trouble, Adam -- Nephtali: A simple, flexible, fast, and security-focused PHP framework http://nephtaliproject.com Adam, Don't apologize. Thanks for the reply. It certainly could be due to an upgrade. I wrote my code a while ago, then let it sit. A few days ago I tried to use it again. I first had to deal with a change in the way call by reference worked in php. (I had to delete the '' from some function calls.) Did that correspond to the 5.3 - 5.4 upgrade? I will look at the links you provided. Thanks again. Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't connect to MySQL via PHP
On January 12, 2013 11:25:58 AM Rick Dwyer wrote: Hello all. I used the code below successfully to connect to a MySQL db on one hosting provider. I've moved the code to a new hosting provider with new values and it returns: Access denied for user 'user'@'db.hostprovider.net' (using password: YES) Even though I can copy and paste these three values (host, user and pass) and paste into Navicat to make a connection. So the credentials are correct, but they are not authenticating when used in PHP. I've tried making host localhost and 127.0.0.1… both with the same result. Can someone tell me what I am doing wrong here? Appreciate it. Thanks, --Rick are navcat and php on the same machine? mysql user accounts can and often do take into account which machine the connection is comming from? $db_name = mydb; $vc_host= db.hostprovider.net; $vc_user= user; $vc_pass= pass; $connection = @mysql_connect($vc_host, $vc_user, $vc_pass); $db = mysql_select_db($db_name, $connection); echo mysql_error(); -- 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] Open form in new window
snip No - you meant to say per the form's TARGET attribute No, I meant to say exactly what I said, namely ACTION. The Target attribute deals with frames -- I have not done frames since 1995. For a more in-depth Target explanation, please review: http://www.htmlcodetutorial.com/forms/_FORM_TARGET.html If you read your own link you will see a reference to target=_blank this opens the document in a new tab/window. If there is a way to open a new window/tab with the action attribute I would love to be educated. sibling page of your link http://www.htmlcodetutorial.com/forms/_FORM_ACTION.html However, I do not think that is what is being discussed here -- at least it is not what I was talking about. agreed Cheers, tedd snip Ray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] - printing 2 dim. array
Hello, I have a file...its contents are as follows: Name of person1, string1 Name of person, string Name of person, string Name of person, string Name of person, string -- 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] [php] - alphabetizing
Hello, I was just typing a msg and accidentally hit send before I could finish.. sorry.. I have a file, its contents are as follows: Name of person1, string1 Name of person2, string2 Name of person3, string3 Name of person4, string4 Name of person5, string5 I want to alphabetize the list from A-Z (using the first column as the primer key). I was planng on using an array, but I would have to use a 2 dimensional array and I am not too swift on those.. Thanx, Ray.. -- 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] PHP and MySQL query
I have a simpe query that I can not seem to get to work. Here is the HTML side: td width="27%" align="center"form action="luquery.php?DB=csjoaamp;TA=associatesamp;SortField=company" method="post"input type="text" name="search"brinput type="submit"/form/td Here is the PHP side: The fields are being past, but I get 0 in the results? $result=mysql_query("select * from $TA where $SortField='$search%' order by $SortField"); Am I missing something here? Thanks for the help. Jim -- 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] Opinions, please
Well, One way is to log that the user is online into a database...or a flat file. I have done this before using a database (very easy), however I have not used a file yet..but it is possible. Use fopen() routines and fclose() for the low level file access. Another method is to use cookies..the user can turn this off..and it can still be compromised. In the end if you can't use sessions, then use a flat file, or a database. If you don't have either of these, then I would like to hear what you solution is. As I'm interested in how you would overcome this problem... PS: You could also use URL rewriting?..but then, thats not to secure...(or pass the variable(s) to each page via a GET submission..just tag on the variable to the end of your next page link) -Ray Ray Gaylog [EMAIL PROTECTED] - Original Message - From: Gaylen Fraley [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, December 15, 2001 11:49 PM Subject: [PHP] Opinions, please A security question, concerning PHP and overall best practice. I have an application that is used by users that have no control over what version of PHP is on their server. Some versions do not support sessions. So, I am attempting to modify the code to accommodate this and minimize, if not eliminate, the risk of a break-in. Basically, index.php (pageA) can call admin.php (pageB). pageB accepts a userid and password ($user/$pass). At this point, these are form variables that will be passed, via $HTTP_POST_VARS. pageB calls pageC, which verifies the user/pass against a security file. If validated, then pageC is accessed. If not, user is kicked out. No problem so far and no variables have been exposed. But, from pageC, you can go down several paths. Now to the question/opinion. How do I validate, w/o sessions, that pageD or pageE has been entered from pageC and not forged? I can pass the user/pass via a hidden field on the form of pageC, but that exposes it. Philosophically, this may not be a problem, since the user has to go through pageC to get to the other ones anyway. Use referer? That seems like that could easily be forged. Your thoughts? -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v2.6 Guest Book http://www.gaylenandmargie.com/phpwebsite/ -- 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] problem finding out original filename while using php to upload.
Well..to determine the format the file file..you may find some sort of routine to check..but why not create one? I mean, in windows, the extension determines the file format right? So do a loop that starts from the last character, and goes back one until you reach the . (dot). Based on that you can determine the format type.. Of course, if the user renamed a .bmp to a .jpeg then you won't be able to tell that this was originally a .bmp file... Ray Gaylog [EMAIL PROTECTED] - Original Message - From: Neil M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 16, 2001 3:22 PM Subject: [PHP] problem finding out original filename while using php to upload. I am using php to upload image files. heres my code .. ? if (is_uploaded_file($photo_file)) { clearstatcache (); $size = filesize ( $photo_file ) ; if ( $size 1024000 ) { print (BR ERROR - File is too big ! File uploads should be below 1024 k ( 1mb ) BR); exit ; } move_uploaded_file($photo_file, $upload_path$check_nick-nickname); } else { echo BR ERROR : File upload was not successfull , please try again !BR; } ? -- the problem is that when i look for the original filename ( e.g. myphoto.gif ) , $photo_file contains a random file name like 383hr93php As i mentioned , its image files i am uploading , how do i know what type of image the file was ? like .jpg , .png etc. Any help appreciatted , i am really stuck on this ;0) Thanks Neil M -- 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] printf()?
Hi.. I've been using PHP for just a little while, however I have noticed somthing. In the doc's I've noticed you can do this: printf(line1 \n line2 \n); Now..this should (like C) print two seperate lines..however It doesn't. To print this on seperate lines I must put a BR in there. Any ideas? I'm using PHP 4.06 Ray Gaylog [EMAIL PROTECTED]
[PHP] PHP binary file
Has anyone compiled php on linux and found the binary executable file? Ray Hunter Firmware Engineer ENTERASYS NETWORKS Phone: 801 887-9888 Fax:801 972-5789 Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www:www.enterasys.com http://www.enterasys.com
RE: [PHP] Dynamic file creation in Win NT4.
You need to make sure that php has the correct permissions to access the directory and write the file that you want it to write too... Check out the manual for this... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Sridhar Moparthy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 10:44 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Dynamic file creation in Win NT4. Hi All, Could you please help me on how to create a file dynamically on the server in PHP. I wanted to open a new file for each day to save all the errors generated by different web pages on that day. I am using PHP 4.1.6 on, Win NT4 and IIS . Thank you in advance! Sridhar Moparthy
RE: [PHP] argv and argc
Here are all the predefined variables that are in PHP. You will notice that there is an argc and argv here. http://www.php.net/manual/en/language.variables.predefined.php Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 19, 2002 3:00 PM To: PHP General Subject: [PHP] argv and argc The other day, I was reading the docs and I just happened across something that emulated argc and argv. However, I just spent 2 hours in the docs and can't find it. Is there something in PHP that you can use to get this info? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to Config PHP to run snmp in php script?
Raymond, Here is the break down: 1. Download ucd-snmp tar.gz file. 2. Download openssl tar.gz file. You will need openssl for snmp v3 for the security stuff. Uninstall ucd-snmp if it is installed on your system. Uninstall openssl on your system. 3. Untar the files... 4. In the ucd-snmp directory find the file config.h and locate the NO_ZEROLENGTH_COMMUNITY and uncomment the line if commented and set to 1. 5. Configure, make, make install the ucd-snmp 6. Configure, make, make install the openssl ***NOTE: Do a make clean in the php directory. Then remove the config.cache file from the php directory.*** 7. Configure php with snmp Example: ./configure --prefix=/usr/local/php --with-snmp=/usr/local/snmp --with-openssl=/usr/local/openssl --with-apxs=/usr/bin/apxs make make install This should work for you. ***NOTE: THINGS I HAVE TRIED*** 1. I have tried to compile php with the openssl and snmp rpms. However, php chokes on the openssl rpm. 2. If you want to try it with your already installed rpms, here is the configuration that I have tried. ./configure --prefix=/usr/local/php --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --oldincludedir=/usr/include --with-config-file-path=/etc --with-apxs=/usr/sbin/apxs --with-pear --enable-sigchild --enable-magic-qoutes --enable-libgcc --enable-bcmath --enable-calendar --enable-ctype --enable-dbx --enable-ftp --enable-gd-native-ttf --enable-trans-sid --enable-shmop --enable-ucd-snmp-hack --enable-sockets --enable-wddx --enable-yp --enable-inline-optimization --with-xml --disable-debug --enable-pic --enable-shared --with-regex=system --with-gettext --with-gd --with-jpeg-dir=/usr --with-zlib --enable-safe-mode --enable-sysvsem --enable-sysvshm --enable-debugger --with-gdbm --with-db2 --with-db3 --with-png --with-openssl=/usr/include/openssl The problem that I faced here is that php chokes on finding the evp.h header file in the openssl direcory. I look in the directory and it is there. Let me know if I can help you further. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Raymond Mak [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 3:24 AM To: [EMAIL PROTECTED] Subject: [PHP] How to Config PHP to run snmp in php script? Dear All, I am using RedHat Linux 7.2, PHP4.1 and its buitd-in apache, I had tested that the php run correctly with apache. According to the documentation of www.php.net, As shown below: # XCIII. SNMP functions In order to use the SNMP functions on Unix you need to install the UCD SNMP package. On Windows these functions are only available on NT and not on Win95/98. Important: In order to use the UCD SNMP package, you need to define NO_ZEROLENGTH_COMMUNITY to 1 before compiling it. After configuring UCD SNMP, edit config.h and search for NO_ZEROLENGTH_COMMUNITY. Uncomment the #define line. It should look like this afterwards: #define NO_ZEROLENGTH_COMMUNITY 1 If you see strange segmentation faults in combination with SNMP commands, you did not follow the above instructions. If you do not want to recompile UCD SNMP, you can compile PHP with the --enable-ucd-snmp-hack switch which will work around the misfeature. I had successfully complie PHP with the --enable-ucd-snmp-hack switch but I can not find the file called config.h to edit. Finally, My question is WHERE is the file?? and IS THERE any points/steps need to look at in order to configure PHP to run snmp in PHP script?? Thx All.
RE: [PHP] fdisk?
It depends on who you are talking too... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Brian V Bonini [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 9:12 AM To: PHP Lists Subject: [PHP] fdisk? Anyone know what fdisk stands for? I've heard both fixed disk and format disk, I always thought the later Sorry for for the OT post. -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] question
A work around is using the one of the system commands and print that way. Check here for the program execution functions: http://www.php.net/manual/en/ref.exec.php Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Matthew Berwald [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:48 PM To: [EMAIL PROTECTED] Subject: [PHP] question In php for windows, you can use the printer_open() function found in the php_printer.dll. Unfortuantly, I run a Red hat/Apache web server and this won't work. Do you know of any method/package out there that I could install on my linux machine that will all me to print data to a printer? Thanks for the help. Matthew Berwald __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Class question
The whole idea with object-oriented programming is polymorphism and encapsulation. You do not want your classes to access global variables but access that information through objects and messaging between objects. If you are referring to the use of non-member as being outside of the class, then again you want to use objects. As for practice, it is up to you. For me, no... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 1:58 PM To: PHP General Subject: [PHP] Class question I'm still kind of new when it comes to dealing with classes. I'm curious, is it accepted practice for member functions of your class to: * access global variables * use non member, user defined functions Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] unable to load dynamic library etc. etc.
Place all the dlls in the same directory as the php.exe file and in your php.ini file have the extension_dir = .\ (windows). This works for me great... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Jeremy Reed [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 9:30 AM To: [EMAIL PROTECTED] Subject: [PHP] unable to load dynamic library etc. etc. I keep getting this error message and cannot figure out why. The extension_dir is set correctly in the php.ini, I have put the .dlls into every conceivable directory I can think of and nothing seems to work. Anybody else had and fixed this problem? Thanks, Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php-gtk
I do not know of any editors for php-gtk. Here is the general list: [EMAIL PROTECTED] website: http://gtk.php.net Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Dasmeet Singh Arora [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 8:59 PM To: [EMAIL PROTECTED] Subject: [PHP] php-gtk Hello! Can anyone tell me about sites where I can find some help and resources on PHP GTK. Is their any visual editor available for PHP GTK? Thanks in advance. -- 'The rose is sweetest washed with morning dew And love is loveliest when embalmed in tears' - Walter Scott __ http://www.pluginJokes.com - Add Free Dynamic Jokes To Your Site. http://nitro.fedoxpress.com - Earn Money While You Surf The Net. http://www.fedoXpress.com - Free, Fast Easy Email. http://freeads.fedoXpress.com - Advertise Your Site For Free. __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: phpmyadmin
You might want to try phpbuilder, they have some great articles. phpMyAdmin is housed on sourceforge.net. You can check them out there... Jtjohnston [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I know this is a bit off the wall for most, but for what purpose do you use phpmyadmin mysql? What are your projects? Does anyone know of any good articles that discuss databasing, PHP, MySQL and or PHPMyAdmin for academic purposes? I'm a university researcher and want to collect some data. John Taylor-Johnston -- --- ' ' ' Université de Sherbrooke: ô¿ô http://compcanlit.ca/ - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] imagecreate with Windows .exe installer
You need to have that dll installed on your system. You need to download php-version.zip file that contains all of the dlls in it to run with. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Mike Brackenridge [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 10:01 AM To: [EMAIL PROTECTED] Subject: [PHP] imagecreate with Windows .exe installer php4 installed with Apache on Windows ME, using as localhost. I am trying to use imagecreate with a version of php4 that was installed with the binary .exe installer, php seems to be installed OK. I have changed the .ini file line: ;extension=php_gd.dll To extension=php_gd.dll But I get an error of: Fatal error: call to undefined function: imagecreate() in c:directory Has anyone any idea what the problem is here? Thanks Mike
RE: [PHP] Freeing up locked table?
This is mysql doing the locking, you will need to look into your mysql configuration. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Jeff Lewis [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 2:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Freeing up locked table? Sometimes when using PHP/mySQL I have encountered a locked table. I have no idea why it occurs, I am not explicitly locking the tables but sometimes in phpmyadmin it says in use. Is there a way to unlock this table using PHP? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Numbered Arrays
Put it in a for loop and add data to the array. Example: for( $i = 0; $i 24; $i++) { $arr[$i] = Data here.; } This is one of the fastests; however, there are other ways as well. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Phillip S. Baker [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 2:56 PM To: PHP Email List Subject: [PHP] Numbered Arrays What is the quick way to generate numbered arrays? I cannot seem to find it in my documentation. Looking to generate and populate an array with the numbers 0-23. Thanks Phillip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Numbered Arrays
That is probably faster than going through the for loop... Helps if I read the documentation on Arrays. Thanks for info Lars, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 3:05 PM To: Phillip S. Baker Cc: PHP Email List Subject: Re: [PHP] Numbered Arrays On Mon, 2002-02-25 at 13:56, Phillip S. Baker wrote: What is the quick way to generate numbered arrays? I cannot seem to find it in my documentation. Looking to generate and populate an array with the numbers 0-23. Thanks Phillip http://www.php.net/range ?php error_reporting(E_ALL); $array = range(0, 23); print_r($array); ? Cheers, Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Php-gtk
Try the php-gtk list. [EMAIL PROTECTED] I use this list all the time and they are great at answering questions... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 7:38 PM To: [EMAIL PROTECTED] Subject: [PHP] Php-gtk I read the tutorial for it on the php-gtk site, but I didn't see a thing about how to run it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] SQL and PHP (socket vs TCP)
What exactly are your trying to do. TCP connections use sockets to connect. Sockets are how you connect... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Uros Gruber [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 1:08 AM To: [EMAIL PROTECTED] Subject: [PHP] SQL and PHP (socket vs TCP) Hi! Yesterday i noticed some strange thing with connection PHP to postgreSQL. I have some script to tell me how long does it take to generate some page. And i noticed that this time is longer if i connect to socket. Isn't this a little strange. I know that connection to socket must be quicker that on IP. Is there something that i don't know. -- TIA, Uros -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] hmm.. more trouble with telnet.
It did not find it with your classpath... Try using locate or slocate, this should find it... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Sean Kennedy [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 10:28 AM To: [EMAIL PROTECTED] Subject: [PHP] hmm.. more trouble with telnet. Hello, When I type in 'whereis mysql' it says 'mysql:' so what does that mean? -Sean
RE: [PHP] PHP and Java
Is the libphp_java.so located in your apache libexec directory? Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP and Java I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7 I did compile php with-java 1) Java section in php.ini [Java] java.home = /usr/java1.2 java.class.path = /usr/local/lib/php/php_java.jar java.library=/usr/java1.2/jre/lib/sparc/libjvm.so java.library.path = /usr/local/lib/php 2) prueba.php html body ? $system = new Java(); print Java version=.$system-getProperty(java.version). br\n; print Java vendor=.$system-getProperty(java.vendor). p\n\n; print OS=.$system-getProperty(os.name). . $system-getProperty(os.version). on . $system-getProperty(os.arch). br\n; $formatter = new Java(java.text.SimpleDateFormat, , dd, 'at' h:mm:ss a ); print $formatter-format(new Java(java.util.Date)).\n; ? html the error in browser is: Fatal error: Cannot instantiate non-existent class: java in /usr/local/apache/htdocs/remotemanager/users/java.php on line 4 3) when I run apache in error.log PHP Warning: Unable to load dynamic library './libphp_java.so' - ld.so.1: /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No such file or directory in Unknown on line 0 [Fri Mar 1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1 configured -- resuming normal operations [Fri Mar 1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: fcntl) : -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP and Java
If you are running this on apache then it needs to be in the libexec directory of apache where it looks for the *.so modules that are to be loaded. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 10:56 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] PHP and Java no, it isn't. it is in usr/local/lib/php/modules Is the libphp_java.so located in your apache libexec directory? Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP and Java I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7 I did compile php with-java 1) Java section in php.ini [Java] java.home = /usr/java1.2 java.class.path = /usr/local/lib/php/php_java.jar java.library=/usr/java1.2/jre/lib/sparc/libjvm.so java.library.path = /usr/local/lib/php 2) prueba.php html body ? $system = new Java(); print Java version=.$system-getProperty(java.version). br\n; print Java vendor=.$system-getProperty(java.vendor). p\n\n; print OS=.$system-getProperty(os.name). . $system-getProperty(os.version). on . $system-getProperty(os.arch). br\n; $formatter = new Java(java.text.SimpleDateFormat, , dd, 'at' h:mm:ss a ); print $formatter-format(new Java(java.util.Date)).\n; ? html the error in browser is: Fatal error: Cannot instantiate non-existent class: java in /usr/local/apache/htdocs/remotemanager/users/java.php on line 4 3) when I run apache in error.log PHP Warning: Unable to load dynamic library './libphp_java.so' - ld.so.1: /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No such file or directory in Unknown on line 0 [Fri Mar 1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1 configured -- resuming normal operations [Fri Mar 1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: fcntl) : -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP and Java
What needs to be done here: You need to have the libphp_java.so in the libexec directory of apache so that it can load the module. Your error 2 is because the module is not loaded. Fix the 1 problem and the second will go away. Plus, I would run Tomcat and have that handle of all your java and access php through java...This is faster and reliable. Java in php is not as faster or reliable. Check the php documentation on this... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 11:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP and Java I used LD_LIBRARYPATH=/usr/local/lib:/usr/java1.2/jre/lib/sparc:/usr/local/lib/php/ modules but the problems 1) PHP Warning: Unable to load dynamic library './libphp_java.so' - ld.so.1: /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No such file or directory in Unknown on line 0 [Fri Mar 1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1 configured --resuming normal operations [Fri Mar 1 12:06:01 2002] [notice] Accept mutex continued. 2) Fatal error: Cannot instantiate non-existent class: java in /usr/local/apache/htdocs/remotemanager/users/java.php on line 4 follow. -Original Message- From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] mailto:[EMAIL PROTECTED]%5D mailto:[EMAIL PROTECTED]%5D Sent: Friday, March 01, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP and Java From my experience getting Java to run w/ PHP and Apache on RedHat 7.0, you can try setting the LD_LIBRARY_PATH environment variable ( without which my Java would not run) set to the location of libjava.so, libjvm.so, and php_java.jar, in my case (without line feeds) LD_LIBRARY_PATH=/usr/java/j2sdk1.4.0/jre/lib/i386: /usr/java/j2sdk1.4.0/jre/lib/i386/server:/usr/local/lib/php Rich -Original Message- From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] mailto:[EMAIL PROTECTED]%5D mailto:[EMAIL PROTECTED]%5D Sent: Friday, March 01, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP and Java no, it isn't. it is in usr/local/lib/php/modules Is the libphp_java.so located in your apache libexec directory? Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Proyecto de Grado [mailto:[EMAIL PROTECTED]] mailto:[EMAIL PROTECTED]%5D mailto:[EMAIL PROTECTED]%5D Sent: Friday, March 01, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP and Java I have Java1.2 , php4.1.1 and apache 1.3.22, sun solaris7 I did compile php with-java 1) Java section in php.ini [Java] java.home = /usr/java1.2 java.class.path = /usr/local/lib/php/php_java.jar java.library=/usr/java1.2/jre/lib/sparc/libjvm.so java.library.path = /usr/local/lib/php 2) prueba.php html body ? $system = new Java(); print Java version=.$system-getProperty(java.version). br\n; print Java vendor=.$system-getProperty(java.vendor). p\n\n; print OS=.$system-getProperty(os.name). . $system-getProperty(os.version). on . $system-getProperty(os.arch). br\n; $formatter = new Java(java.text.SimpleDateFormat, , dd, 'at' h:mm:ss a ); print $formatter-format(new Java(java.util.Date)).\n; ? html the error in browser is: Fatal error: Cannot instantiate non-existent class: java in /usr/local/apache/htdocs/remotemanager/users/java.php on line 4 3) when I run apache in error.log PHP Warning: Unable to load dynamic library './libphp_java.so' - ld.so.1: /usr/ local/apache/bin/httpd: fatal: ./libphp_java.so: open failed: No such file or directory in Unknown on line 0 [Fri Mar 1 12:06:01 2002] [notice] Apache/1.3.22 (Unix) PHP/4.1.1 configured -- resuming normal operations [Fri Mar 1 12:06:01 2002] [notice] Accept mutex: fcntl (Default: fcntl) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can I authenicate user with the accounts in passwd and shadow??
You might want to try setting up an LDAP, kerberos, or NIS system before using the passwd and shadow file. There are some security issues that you might not be aware of... Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 8:21 AM To: Zenith Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Can I authenicate user with the accounts in passwd and shadow?? On Monday, March 4, 2002, at 07:51 PM, Zenith wrote: But I wonder if I can check the user account against with the /etc/passwd, i.e. use the system accounts. You can do this I think. I just saw an Oreillynet article about it, I think. If this link doesn't tell you how, then I don't know. http://www.onlamp.com/pub/a/php/2001/07/26/encrypt.html HTH, Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Script Debug.
Also you can set up php to show you all warnings and display them for you. In the php.ini file you can change some values so that you can do some debugging. Here are the values you can change: display_errors = On display_startup_errors = On or error_log = syslog or error_log = filename Having display_errors on will display errors to you when you run them. Display_startup_errors will show startup errors that php has if any. Or you can have all errors go to syslog or have error_log = filename go to a specific file for you. This has helped me debug many scripts that did not display errors for me. Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: DARCY,MATTHEW (Non-HP-UnitedKingdom,ex2) [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 07, 2002 7:52 AM To: [EMAIL PROTECTED] Subject: [PHP] Script Debug. Hi, someone was helping me with this last night at home, but now I am in work I am still struggling. I have a user_auth script what works fine, it registers the username and password as session variables then matches them to the rows entered in the database - if they don't match it unregisters the session vars, if it does i would like to ti register a new sesson var called user_auth_level (ie how much authorisation this user has) this is the part of the script that does that. When I print the $user_auth_level I get null ? can any one help. thanks, Matt. else { session_register(user_auth_level); $auth_select = select account_admin_level from account_details where username='$login_username'; $run_auth_select = mysql_query($auth_select); $run_auth_select_results = mysql_fetch_row($run_auth_select); $user_auth_level = $run_auth_select_results[0]; ? HTML HEAD/HEAD BODY BGCOLOR=black FONT FACE=arial COLOR=white SIZE=3 H1 Access Granted /H1 Welcome you are fully logged into testsite.com your access level is ? print $user_auth_level ? /BODY /HTML ?php exit; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php CLI
What type of system are you running this on? Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: matthew clay shultz [mailto:[EMAIL PROTECTED]] Sent: Friday, March 08, 2002 12:38 PM To: [EMAIL PROTECTED] Subject: [PHP] php CLI hi, when i run script from the CLI, it doens't recognize the oracle library functions. why is tthis and what can i do aobut it? thanks everyone! matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Novata Como inicio??
Que es su problema? Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Jenny Fox [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002 9:41 AM To: [EMAIL PROTECTED] Subject: [PHP] Novata Como inicio?? Primeramente alguien sabe español???, estoy iniciandome en PHP entre a dicha página, pero me quede truncada en la instalación, alguien me puede dar una mano Saludos de Jenny León
RE: [PHP] php.ini ...
Before you installed did you make a copy of the php.ini file...? If you did not then it might have been overwritten with the new installation. Sounds like you did the basic installer installation. You might need to download the zip file and do a manual installation to get the required data. Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Marcel Besancon [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002 10:18 AM To: [EMAIL PROTECTED] Subject: [PHP] php.ini ... Hi, it's me again, when I used the PHP 4.0.6 I had a php.ini with a lot of entries. Now, at Version 4.1.1, there's a php.ini with this content: - ; php.ini for PEAR tests include_path=.. [mail function] SMTP= localhost ; for Win32 only sendmail_from= [EMAIL PROTECTED] ; for Win32 only upload_tmp_dir = C:\PHP\uploadtemp ; temporary directory for HTTP uploaded files (will use system default if not specified) [Session] session.save_path= C:\PHP\sessiondata; argument passed to save_handler [PHP] error_reporting= E_ALL ~(E_NOTICE | E_USER_NOTICE | E_WARNING | E_COMPILE_WARNING | E_CORE_WARNING | E_USER_WARNING) ; display all errors - Now, where can I find the entries for the extensions that you should be used? I want to use the gd-library. I copied the DLL to the include-path (I don't know if that's the correct way !!!), but now I can't tell PHP to use the DLL!!! Please help me !!! Marcel -- registered Fli4l-User #0388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Execute php script inside an HTML page???
Yes, However, you need to add the .html file extension to the php parser so that it parses the .html file. Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Lic. Carlos A. Triana Torres [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 1:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Execute php script inside an HTML page??? Hello all, Can I execute a php script from an HTML document? I mean, with the file named with html extension? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] passing values
Are you using the post form method to post this variable to the next page. The value $_POST['inp'] is not present or set...there is a null value there. You will need to set the value with a post inorder to access it with the predefined variable $_POST... Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: John Gurley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 6:43 AM To: [EMAIL PROTECTED] Subject: [PHP] passing values this is still not working for passing a value from one page to another: ?php echo ' input name=inp type=hidden value='. $_POST['inp']. ' '; ? When I look at the source this appears: input name = inp type = hidden value = which I take to mean that it does not know what $inp is. could it be something with my browser, or am I still doing something wrong (I wouldn't be a bit surprised) Thanks John _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie Question
What type of OS are you running this application on and how was php compiled? Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Greg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 6:47 AM To: [EMAIL PROTECTED] Subject: [PHP] Newbie Question I have an app that worked with mySQL, but now I'm trying to make it use SQL Server. The function that connected to to the mySQL was: mysql_pconnect($db_host, $db_user, $db_pass) or die(Unable to connect to SQL server); I tried to change it to sql_pconnect($db_host, $db_user, $db_pass) or die(Unable to connect to SQL server); but I get an error that the function doesn't exist. I'm sure it's something simple, but what's the php function that will let me connect to the SQL Server?
RE: [PHP] How to access arrays from $GLOBAL?
Where is some good documentation on how $GLOBALS works and what is really going on in the background? Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 9:53 AM To: Richard Davey Cc: [EMAIL PROTECTED] Subject: Re: [PHP] How to access arrays from $GLOBAL? I don't understand why you think it is illogical. How else would you dereference a multi-dimensional array? On Wed, 13 Mar 2002, Richard Davey wrote: Mike Ford [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]. .. $GLOBALS['mtxt'][1] Fantastic :) That's totally illogical but it works a treat. PHP has some weird syntax rules sometimes! Cheers, Rich -- Fatal Design http://www.fatal-design.com Atari / DarkBASIC / Coding / Since 1995 -- 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] SERVER INFO
Check out the Linux howto's at http://www.linuxdoc.org/docs.html#howto This will help you set up a server and get online... Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Dani [mailto:[EMAIL PROTECTED]] Sent: Friday, March 15, 2002 11:42 AM To: [EMAIL PROTECTED] Subject: [PHP] SERVER INFO Importance: High Hi all, I appologise if this is off topic but I don't know who to ask. I hope you guys don't mind. Does any body know where I can find information about the steps of setting up a server(LINUX) so that people can find a certain URL address? I want to sent up a small server for myself from home with my machine but I don't know how to make it so that the web pages that I put in my server accessable by other people around the world. do I have to connect my modem into my phone line (online) all the time or...??? Does my question make any sense? any help is welcome. regards, Dani -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: where is http_cookie ?
Try using the predefined variable $_COOKIE instead and see if that works for you... Bas Jobsen [EMAIL PROTECTED] wrote in message 02031617361309.10531@bjobsen">news:02031617361309.10531@bjobsen... Hello, I have installed php 4.1.2. as a cgi module. But http_cookie isn't set. I don' know whats wrong. You can find the output of phpinfo() at http://www.tgp2stats.com/test.php Tnx, Bas Jobsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Document not found
You should try moving to the current version of php and then try it... Ray Hunter Jan Weidhaase [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi If I try to open a non-existing PHP document by my Apache server I got an internal server error massage. All other documents that were not found bring me to a error 404 document. 4 days ago I updated from PHP3 to PHP4.0.3pl1 and with the former version i got a error massage like: no php file input spicified on line 0 or something like that. Does anybody no about this problem? Thank you Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Two easy HTML/CSS questions
Answers: 1. Yes you can do it with css. http://www.w3schools.com/css/default.asp 2. The text field area is defined by the browse...You cannot change the size of the actual box that is the text field... Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 11:18 AM To: [EMAIL PROTECTED] Subject: [PHP] Two easy HTML/CSS questions I know I shouldn't be asking these questions on this mailing list but you guys are ALWAYS EXTREMELY helpful... 1) I want a a text link to change color when the mouse is hovering over top of it. How do I do this? Im sure it's some CSS thingy. 2) Is it possible to make a text field smaller when using forms. Let's say I'm using font size 1, I want the text field to be just as small as the rest of text. Thanks again
RE: [PHP] Two easy HTML/CSS questions
Actually, If I understand correctly, you want the actual text field box to be the same size as the text (as in height)...You can only change the width of the text field which is done by size= and this is based on characters... Example: input type=text name=stuff size=25 Then the width of the text field will be 25 characters...This is for the text and password fields... Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 11:32 AM To: 'Hunter, Ray'; 'Phil Schwarzmann'; [EMAIL PROTECTED] Subject: RE: [PHP] Two easy HTML/CSS questions Good day, Just to clarify, yes, you can set the size of a text field, as well as its color, text font, border, and so on. This is also done with css and is outside the scope of this mailing list. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Hunter, Ray [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 11:31 AM To: 'Phil Schwarzmann'; [EMAIL PROTECTED] Subject: RE: [PHP] Two easy HTML/CSS questions Answers: 1. Yes you can do it with css. http://www.w3schools.com/css/default.asp 2. The text field area is defined by the browse...You cannot change the size of the actual box that is the text field... Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002 11:18 AM To: [EMAIL PROTECTED] Subject: [PHP] Two easy HTML/CSS questions I know I shouldn't be asking these questions on this mailing list but you guys are ALWAYS EXTREMELY helpful... 1) I want a a text link to change color when the mouse is hovering over top of it. How do I do this? Im sure it's some CSS thingy. 2) Is it possible to make a text field smaller when using forms. Let's say I'm using font size 1, I want the text field to be just as small as the rest of text. Thanks again
[PHP] Sockets and Telnet
Has anyone created a telnet session in php with sockets and can give me some help on setting one up? Thank you, Ray Hunter Firmware Engineer I ENTERASYS NETWORKS Phone: 801.887.9888 Fax:801.972.5789 Email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] www:www.enterasys.com http://www.enterasys.com
RE: [PHP] A Newbie needs help with his first Class
The way that Warwick has it set up is fine as long as you create the new in the script that is being called by the browsers so that you can access the class variables...I do not see the need to change the function name unless it conflicts with any predefined variables. Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 6:57 AM To: 'Stampe, Lars'; 'Don'; php Subject: RE: [PHP] A Newbie needs help with his first Class Don's original declaration is correct. It refers to a constructor. Without a parameter, the new() will fail. -Original Message- From: Stampe, Lars [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 7:53 AM To: 'Don'; php Subject: RE: [PHP] A Newbie needs help with his first Class And then replace $global = new Globals(/staging_area/phase-2/); with $global = new Globals; $global-someting else(/staging_area/phase-2/); Lars -Original Message- From: Stampe, Lars [mailto:[EMAIL PROTECTED]] Sent: 22 March 2002 13:46 To: 'Don'; php Subject: RE: [PHP] A Newbie needs help with his first Class Hi, Try and rename the function in your class to something else that the class name, and let me know what happens! Lars -Original Message- From: Don [mailto:[EMAIL PROTECTED]] Sent: 22 March 2002 13:01 To: php Subject: [PHP] A Newbie needs help with his first Class Hi, I'm trying to write my first class. Here is the code contained in a file called globals.php: ?PHP class Globals { var $gDISPLAY = 1;/* Display graphic - no rollover */ var $gROLLOVER = 2; /* Display graphic with rollover */ var $root_path;/* Path to document root directory */ var $relative_path;/* Path from document root to relative root directory */ function Globals($start_dir) { if ( strlen($DOCUMENT_ROOT) == 0) { $this-$root_path = /; } else { $this-$root_path = $DOCUMENT_ROOT; } $this-$relative_path = $this-$root_path . $start_dir; } } $global = new Globals(/staging_area/phase-2/); ? Within my html page, I am tesing the class by trying the following: ?php require(globals.php); echo $global-root_path . br; echo $global-relative_path . br; ? However, nothing is being written to my browser. Is there a problem with the code? Thanks,. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strange problem passing variables
Try using $_GET['varnamehere'] Ray Hunter -Original Message- From: Jean-Arthur Silve [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 8:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strange problem passing variables Hi, A friend of me use PHP4.1.2 on Linux+Apache Here is the problem : He pass a parameter using GET method : http://www.domain.com/test.php?TESTV=1234 test.php is : ?php echo $TESTV.BR; echo $HTTP_GET_VARS[TESTV].BR; phpinfos(); ? But in the script all variables are empty ($TESTV and $HTTP_GET_VARS[TESTV]). phpinfos() shows QUERY_STRING environment variable is empty... any idea ?? Thank you ! EuroVox 4, place Félix Eboue 75583 Paris Cedex 12 Tel : 01 44 67 05 05 Fax : 01 44 67 05 19 Web : http://www.eurovox.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cron with php as apache module
Yeah, Compile php first as CLI, move the contents of the bin directory to where you want them, and then compile php again for the apache module. In the bin directory you will have a php executable file which you can use for your cli apps. In your php files that you want to run as crons then add this before the ?php #!/path to php/php Example on my system #!/usr/bin/php ?php Stuff here ? /* EOF */ Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Paul Roberts [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 12:00 PM To: [EMAIL PROTECTED] Subject: [PHP] cron with php as apache module I want to run a php script via a crontab, (i can set up the crontab etc). this is a Linux server and php is installed as an apache module, is there any way to run the php script via cron. the build details are Configure Command './configure' '--with-apxs=/usr/sbin/apxs' '--with-mysql' '--enable-track-vars' '--enable-versioning' '--enable-bcmath' Paul Roberts [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RADIUS - supported in PHP?
What are you trying to do with radius and php? Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Benji Spencer [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 6:35 AM To: [EMAIL PROTECTED] Subject: [PHP] RADIUS - supported in PHP? From the initial documentation I have found, the answer to my question is No, however I am just seeking confirmation of it. Does PHP support RADIUS? If not, does anyone know of any scripts/classes for PHP which deal with RADIUS? thanks benji --- Ben Spencer Web Support [EMAIL PROTECTED] x 2288 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RADIUS - supported in PHP?
Actually, that is more of a Kerberos system that you are thinking of. Here is some info on radius: Taken from rfc 2865 Remote Authentication Dial In User Service (RADIUS). Key features of RADIUS are: Client/Server Model A Network Access Server (NAS) operates as a client of RADIUS. The client is responsible for passing user information to designated RADIUS servers, and then acting on the response which is returned. RADIUS servers are responsible for receiving user connection requests, authenticating the user, and then returning all configuration information necessary for the client to deliver service to the user. A RADIUS server can act as a proxy client to other RADIUS servers or other kinds of authentication servers. Network Security Transactions between the client and RADIUS server are authenticated through the use of a shared secret, which is never sent over the network. In addition, any user passwords are sent encrypted between the client and RADIUS server, to eliminate the possibility that someone snooping on an unsecure network could determine a user's password. Basically there is a encryption by using the shared secret, however that secret is never passed across the network. The only tough problem here is that you really need to know what is coming in each packet. There is encryption is each packet that must be dealt with. To do authentication with radius you need to create sockets and communication back and forth with the NAS server. This can be some what more complex and you need a more powerful language than php. I use c and sometimes c++. I like to use php for the snmp functionality that allows me to query the radius mibs on network devices. This gives me authentication and accounting information. I suggest you read up on these rfcs: 2618, 2619, 2620, 2621, 2865, 2866, 2867, 2869, and 3162. You could also try writing a radius extension for php? Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Benji Spencer [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 7:07 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] RADIUS - supported in PHP? What are you trying to do with radius and php? I really don't know yet. We are looking at implementing RADIUS as a authentication scheme. I only roughly understand RADIUS, which doesn't help much. I looked at the RADUIS Apache module, which is where I am gaining most of my knowledge. It appears to function much like any other authentication scheme (at least to some extent) like LDAP or using a database (or NT Domain...or...or). As Apache can authentication against RADIUS, I assumed that such a thing could also be achieved via PHP. Currently we have an Intranet Portal which authenticates against LDAP. We would want to change this over to RADIUS if we implemented RADIUS. How this is done, If it can be done, and what does it take are all questions which are up in the air at this point. From my understanding, RADIUS is more or less a ticketing mechanism. It is configured on the back end to check various sources (files, SQL, LDAP), and then provides a ticket if authentication is passed. It is this ticked which is passed around by the client and used to authenticate to the same resource, as well as other resources (if you have a valid ticket, you are not asked for username/password info?). How close am I in understanding this, as well as making this all work in PHP? thanks.. benji --- Ben Spencer Web Support [EMAIL PROTECTED] x 2288 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Program Looping ?
You need to also make sure that you change the script execution time allowed in the php.ini file to 5 minutes or more or else you will get a time out error. Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 11:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Program Looping ? I've written a script that checks my email. However, when I run the script (from the command line) -- I want it to loop with a 5 minute delay and the ability to stop the program anytime by pressing a key on the keyboard (say) the ~ key. Anyone know how to do this? ? function check_mail() { // my email code is here } check_mail(); ? thanks. jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: PHP/MySQL/XML
One thing you need to thing about is if you are going to us DTDs. If you are and they specify that you need the ext/ext elements then it is best to add a space when nothing is contained in $ext... Thank you, Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Monday, April 01, 2002 4:12 PM To: Jay Fitzgerald Cc: [EMAIL PROTECTED] Subject: Re: [PHP] RE: PHP/MySQL/XML On Monday, April 1, 2002, at 05:09 PM, Jay Fitzgerald wrote: OkThanks to all those who are helping me (sorry for cross-posting)... That's okay. This script looks a lot better -- because you can actually -do- something with the output! :) My scripts are working great except for one thingwhen it queries the db there are some fields that have a NULL value, thus when it writes the XML file it does this: null_field/null_field Yep. What I would like to do is either place an nbsp; in the XML tags for all of these NULL fields - can I do an if / else statement in the code I am using below?? Yep. But look at the point where you have placed your pseudo-if/else statement. Read through this script as though you were the PHP processor -- what would happen? Well, you'd open the file for appending, you'd write your XML declaration and stylesheet PI, you'd write a few element names, and then you'd write a name pulled from your database. Fine, everything looks good up to this point... (continued below) $phone_list = fopen(/usr/local/apache2/htdocs/test/phone_list.xml, w+); fwrite($phone_list, ?xml version=\1.0\ encoding=\ISO-8859-1\?\n); fwrite($phone_list, ?xml-stylesheet type=\text/xsl\ href=\phone_list.xsl\?\n\n); fwrite($phone_list, test\n); fwrite($phone_list, \tphone_list\n); while ($row = mysql_fetch_array($sql_result)) { $name = $row[name]; $ext = $row[ext]; $title = $row[title]; $home = $row[home]; $pager = $row[pager]; $cell = $row[cell]; $email = $row[email]; fwrite($phone_list, \t\temployee\n); fwrite($phone_list, \t\t\tname); fwrite($phone_list, $name); fwrite($phone_list, /name\n); Here is where you're going to run into a problem. Take a close look at what would happen if there is an $ext, and what would happen if there is no $ext (in other words, simulate the if/else statement in your mind): fwrite($phone_list, \t\t\text); // would need an if / else statement here fwrite($phone_list, $ext); // end if / else statement here fwrite($phone_list, /ext\n); See what's wrong? Regardless of whether or not there is an if/else statement, you are still going to do the following two lines of code: fwrite($phone_list, \t\t\text); fwrite($phone_list, /ext\n); Because your if/else statement does not encompass these lines. What will the effect of this be? I'll show you: if there is an $ext ext123/ext if there is no $ext ext/ext So, even if you use the pseudo if/else statement, you will still end up with a possibly empty ext element. If you changed your if/else statement to encompass this entire section of the code, however, then you can write ext123/ext if there is an $ext variable or you can have nothing happen if there is no $ext. Here is what it would look like in pseudocode: // would need an if / else statement here fwrite($phone_list, \t\t\text); fwrite($phone_list, $ext); fwrite($phone_list, /ext\n); // end if / else statement here Does that make sense? This way, if there's no $ext variable, you don't end up writing the ext and /ext element tags. So how do you construct the actual statement? Well, to be honest with you, I don't think you want to use an if/else statement at all -- a simple if statement will do the trick. It works just like this: if (!empty($ext)) { fwrite($phone_list, \t\t\text); fwrite($phone_list, $ext); fwrite($phone_list, /ext\n); } The empty() function (actually a language construct, but the difference isn't important) tests to see if there is actually any value attached to the $ext variable. And the exclamation point inverts the boolean value of the expression, meaning if this is NOT true. So the if statement above simply says if the value held by $ext is not empty, write three tabs + ext + $ext + /ext to the file pointed to by $phone_list. The rest of your code looks good