RE: [PHP] Why doesn't this simple query work?
True, that's because mySQl doesn't understand it without the signle quotes, or any descent database for that matter. BC -Original Message- From: Jon Yaggie [mailto:[EMAIL PROTECTED]] Sent: woensdag 25 juli 2001 22:12 To: [EMAIL PROTECTED] Subject: Re: [PHP] Why doesn't this simple query work? hmmm i think you need to always have quotes around string regardless of if they are variables . . . $result = mysql_query(SELECT shootID FROM shoots WHERE (location='$location')); - Original Message - From: Seb Frost [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Thursday, July 26, 2001 3:10 AM Subject: [PHP] Why doesn't this simple query work? Driving me mad. Works if I put a string in quote marks instead of the variable $location. $result = mysql_query(SELECT shootID FROM shoots WHERE (location=$location)); This should work shouldn't it? If it's a problem with the variable being embedded in the query what's the easiest way to overcome this? cheers, seb -Original Message- From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]] Sent: 19 July 2001 14:50 To: php-general Subject: Re: [PHP] REGEXP I am not sure if I am understanding you... but if you just want to return the boundary try preg_match(|boundary=\([^\].+)\|Uis, $text, $regs ); $boundary = $regs[1]; I am guessing that you want the boundary from the lines to avoid regexp (too lazy) but now I want to use it. The final result I would need is: B42DA66C4EC07C9B572A58FC so that I can search If you are looking for something else let me know Sheridan -Original Message- From: Adrian D'Costa [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 14, 2001 2:54 AM To: php general list Subject: [PHP] REGEXP Hi, I am trying to capture the Header from a mail for my webmail using php and pop3. The header is something like this: Content-Type: multipart/mixed; boundary=B42DA66C4EC07C9B572A58FC When I use preg_split(/[\d;]*/, $buffer), I get Content-Type: multipart/mixed; What I want is to return the whole line split by the ;. I usually try to avoid regexp (too lazy) but now I want to use it. The final result I would need is: B42DA66C4EC07C9B572A58FC so that I can search in the body of the message for the rest of the parts. Any pointers would be helpful. Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- 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] PWS setup with PHP
Don't even try to get it working on PWS. Download the Apache Win 32 version instead (http://www.apache.org )or if that is too complicated for you, try Xitami (http://www.imatix.com). The latter is a great http server that is very easy to configure (only for Win32). The setup of PHP Win32 can configure your Xitami webserver to run PHP. No extra configuration necessary. Brave Cobra - Original Message - From: Minardi boy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 20, 2001 11:23 AM Subject: [PHP] PWS setup with PHP I'm desperate! I have tried hard to set up PHP4 on my computer in order to go on with the book I bought (Beginning Php4 from wrox press) And it doesn't work. I can't get into the php test screen I got some failure messages when I installed the pws (failure with the transaction server) Can anybody help? Robert-Jan -- 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] php3 and php-4.0.5
Depends of course of which server you use. Which one is it? Brave Cobra - Original Message - From: Ramón Alvarez Rayo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 04, 2001 8:01 PM Subject: [PHP] php3 and php-4.0.5 I had some sites that uses php3 but i did a upgrade to php-4.0.5, after that my web server doesn´t works with files .php3, how can i make to recognize .php3 please i need your help. thanks. Saludos fraternos, *** Ramón Alvarez Rayo Contacto Tecnico - Telematix Telefono: (505) 2785523 Fax: (505) 2784012 -- 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] PHP crashing IIS 5 on Wnidows 2K
Remember that the cgi version does not support PHP authentication. the DLL version does! Brave Cobra -Original Message- From: Bernie Kruger [mailto:[EMAIL PROTECTED]] Sent: donderdag 28 juni 2001 15:08 To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP crashing IIS 5 on Wnidows 2K I had PHP 4.0.5 ISAPI running in Win2K IIS5. It also crashed every few minutes. I switched over to CGI and now its running like a dream. Bernie Kruger Phil Driscoll [EMAIL PROTECTED] wrote in message 01062709242201.02176@linux">news:01062709242201.02176@linux... On Tuesday 26 June 2001 21:35, Jason Lustig wrote: I have PHP 4.04pl1 set up on a IIS 5 server on Windows 2k. However, it keeps on crashing the server -- not all the time, but sometimes it does, sometimes it doesn't. And I have no idea whatsoever what is causing it. I *think* that it has to do with my include()s. I end up including all my function and nav libraries into each and every page, which turns out to maybe 10 includes. Theoretically, yes, it would put a hit on the server because PHP uses the file system so much, but it shouldn't crash it. Is this possibly the reason it is crashing? Assuming that you are using the ISAPI version of PHP, it is probably crashing because that version of PHP is not very stable. You should upgrade to 4.0.6 which contains improvements in that area, but it is still not perfect. If you find 4.0.6 unstable either change from ISAPI to CGI or if you can, change from IIS to Apache and use the Apache module version of PHP. Cheers -- Phil Driscoll -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] $REMOTE_ADDR error
Have a look in phpinfo. You'll find the desired value there. The reason is indeed proxying. or try something like this : if ($HTTP_SERVER_VARS[HTTP_X_FORWARDED_FOR] != ) $ip = $HTTP_SERVER_VARS[HTTP_X_FORWARDED_FOR]; $proxy = $HTTP_SERVER_VARS[REMOTE_ADDR]; $host = @gethostbyaddr($HTTP_SERVER_VARS[HTTP_X_FORWARDED_FOR]); } else $ip = $HTTP_SERVER_VARS[REMOTE_ADDR]; $host = @gethostbyaddr($HTTP_SERVER_VARS[REMOTE_ADDR]); } Brave Cobra - Original Message - From: Colin May [EMAIL PROTECTED] To: Christian Dechery [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 10:42 AM Subject: Re: [PHP] $REMOTE_ADDR error Almost as if the request was proxied or redirected from the local machine (127.0.0.1 is the local loop back ip) Quoting Christian Dechery (Tue, Jun 26, 2001 at 10:31:54PM -0300) why do $REMOTE_ADDR always returns 127.0.0.1 no matter the user's IP who is seeing the page? this doesn't look 'remote' to me... . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer -- 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] -- Colin May - mailto:[EMAIL PROTECTED] - http://www.wibble.org.uk I've got a sand storm blowing in my head seeing many colours but the only one coming through is red - Sandstorm, All Change, Cast -- 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] Authentication
Tnx, I've been trying out some stuff last night and found out some interesting facts! the ISAPI dll is full of access violations. Being a Delphi programmer, I know that ain't good. Stable is indeed the word. Sometimes IIS could find a page, most of the time not. And I got the header to show :) However the authentication part (in my script) was never triggered, due to the fact that IIS couldn't find the page anymore, if the ISAPI dll was used. Though luck! So, people, when using PHP authentication, please use a Linux box!!! The windows version doesn't really work (at all). Brave Cobra - Original Message - From: Phil Driscoll [EMAIL PROTECTED] To: Brave Cobra [EMAIL PROTECTED]; Php-General [EMAIL PROTECTED] Sent: Tuesday, June 26, 2001 9:52 AM Subject: Re: [PHP] Authentication If you run PHP as a CGI, or as an ISAPI module *without* installing the ISAPI filter, then IIS will have already dealt with everything to do with headers before PHP gets a look in. Installing PHP in the ISAPI filters list allows it to get at the headers and do authentication, however you may have serious problems with the stability of the ISAPI module version of PHP. Cheers -- Phil Driscoll -- 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] Authentication
Hi, I know it doesn't have a lot to do with PHP, and then again... I'm trying to get PHP authentication to work on an IIS 5.0 server. The thing is, the server is not sending my desired headers. The script, I'm using, works perfectly. I've tested that, on an Apache server online. Works brilliantly. ;) What do I need to do to get it working, apart from adding the entry for the ISAPI filters, using the php4isapi.dll? Do I need a registry entry somewhere? I've read about that somewhere. Can it work when using the php.exe(or CGI-version)?(using the ISAPI dll version is not working either, although I've read the install file over and over again...) I can get PHP to work, using the cgi(or exe) version of PHP, although I don't think, I can get PHP authentication to work this way. Correct me if I'm wrong here. In other words, how do I configure my IIS to get PHP working with PHP authentication? tnx Brave Cobra -- 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] security
With the Safe Mode on, no files outside the document root(defined in the php.ini) are being handled. - Original Message - From: Ker Ruben Ramos [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 22, 2001 2:01 AM Subject: [PHP] security ey guys, what are the functions that's disabled if safe_mode is On? also, what I just did now is disabling the functions exec() and system() just to prevent shell commands. but, how do i disable something like `ls -l /` ? the backticks. Thanks guys -- 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] Image Upload??
Done that, doesn't work! Brave Cobra - Original Message - From: Toby Dacre [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 3:29 AM Subject: Re: [PHP] Image Upload?? chmod the file or directory so that php can access it it doesn't run as you! -- 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] Image Upload??
Maybe I ought to mention that I don't have direct access to this server. It's a F2S account, I'm trying to upload to. BC - Original Message - From: Brave Cobra [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 10:01 AM Subject: Re: [PHP] Image Upload?? Done that, doesn't work! Brave Cobra - Original Message - From: Toby Dacre [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 3:29 AM Subject: Re: [PHP] Image Upload?? chmod the file or directory so that php can access it it doesn't run as you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Image Upload??
And then I found the answer. The PHP module of the Apache server at F2S is running in Safe mode(like the error said), meaning that you can't do uploads in PHP. This safe mode prohibits that. The only alternative is uploading in CGI or Perl. Another challange to let PHP and CGI work together! BC - Original Message - From: Brave Cobra [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 12:52 PM Subject: Re: [PHP] Image Upload?? Maybe I ought to mention that I don't have direct access to this server. It's a F2S account, I'm trying to upload to. BC - Original Message - From: Brave Cobra [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 10:01 AM Subject: Re: [PHP] Image Upload?? Done that, doesn't work! Brave Cobra - Original Message - From: Toby Dacre [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 3:29 AM Subject: Re: [PHP] Image Upload?? chmod the file or directory so that php can access it it doesn't run as you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- 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] Image Upload??
But as you can see too : upload_tmp_dir has no value, so I'm guessing this won't work. I'm still getting errors with PHP, no problem in CGI though. BC - Original Message - From: James Holloway [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 2:47 PM Subject: Re: [PHP] Image Upload?? From phpinfo() on f2s.com upload_max_filesize 2M So, something like, @copy($file, /path/to . $file_name) or die (Blam, something's up!); should work - haven't got time to try it at the moment. James. What am I doing wrong here? Is there a way to get around the temporary folder? Tnx Brave Cobra -- 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] Image Upload??
Hi, I'm having a problem with a file upload. My code looks as follows : ? include(config.ini); include(funcs.php3); if(empty($Image1)) { ? center table cellpadding=2 cellspacing=0 border=1 trtd bgcolor=? echo $main_color ? width=100Select the file you wish to upload. brIt must be less than 300KB./td tdform action=? echo $PHP_SELF ? enctype=multipart/form-data method=post input type=hidden name=pid value=? echo $pid ? input type=file name=? $Image1 ? size=20br ? $userid=get_userid($store_user_cookie); ? input type=submit value=Upload /form/td/tr/table ? die(); } function checkImgType($image_type,$image_name){ if((strcmp($image_type,image/jpeg)==0)||(strcmp($image_type,image/gif)== 0)||(strcmp($image_type,image/pjpeg)==0)||(strcmp($image_type,image/jpg) ==0)) { switch($image_type){ case image/jpg: $imageExt=.jpg; break; case image/jpeg: $imageExt=.jpg; break; case image/pjpeg: $imageExt=.jpg; break; case image/gif: $imageExt=.gif; break; } return $imageExt; } else { print bfont color=red$image_name is not a valid file to upload.br Please upload JPEG (.jpg) or GIF (.gif) type images only./font/bbrnbsp;br; return 0; } } $ABS_IMAGES_DIR=$path_to_fullsize; if($Image1!=none) { $Image1Ext=checkImgType($Image1_type,$Image1_name); } if($Image1Ext=='0') { echo 'brdiv align=centerbblinkPlease press back on your browser to correct the image(s)./blink/b/div'; exit(); } if($Image1!=none) { $i = substr($Image1_name,0,strlen($Image1_name)-4); $Image1Final=$ABS_IMAGES_DIR.$i.$Image1Ext; copy($Image1, $Image1Final); } include(conn.php3); // generate the proper web directory path $image_loc = /auction/fullsize.$Image1_name; $result = mysql_query(update products set picture = '$image_loc' where(pid = '$pid')) or die(Image update failed.); print The your image $Image1_name, was copied to $Image1_name. We have adjusted your auction for a href=\buy.php3?pid=$pid\item #$pid./a; ? Whenever I execute this code, I'm getting an error the looks like this : Warning: SAFE MODE Restriction in effect. The script whose uid is 177909 is not allowed to access /tmp/php9ex7F1 owned by uid 0 in /auction/upload.php3 on line 68 What am I doing wrong here? Is there a way to get around the temporary folder? Tnx Brave Cobra