[PHP] Re: regexp (?:
Andrew Perevodchik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Why doesn't this simple example work? ereg (aaa(?:bbb|ccc)aaa, $string); It causes an error. However ?: command is documented in a manual of my version of PHP4. It would probably be useful if you would also tell us WHAT you want to accomplish, so we won't have to guess about your intentions... / Franklin -- 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] Re: Suggesting a file name.
Theodore Brinkman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I wrote a small script to generate an image file containing a version number for use in some web apps we are coding at work. The problem is, that with an up-to-date version of IE, the image shows up and can only be saved as a BMP. Older versions don't display it, but prompt for download and save it correctly. No problems in Mozilla (or presumably in Netscape 4.7x either). Try: header(Content-Disposition: filename=$filename); / Franklin -- 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] Re: how to pass authentication info to SMTP server
Balaji Ankem [EMAIL PROTECTED] wrote in message 01bc01c137e0$280b0f60$[EMAIL PROTECTED]">news:01bc01c137e0$280b0f60$[EMAIL PROTECTED]... Hi friends, I would like to implement sending an e-mail through SMTP server. Here my SMTP server needs authentication. How to pass the username and password to SMTP server?? Do something similar: $username = foo; $password = bar; $fp = fsockopen ($hostname, 110, $errno, $errstr, 30) or die(could not connect); fwrite($fp, USER .$username.\r\n); fwrite($fp, PASS .$password.\r\n); For more info about the protocol, take a look here: http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc1939.html / franklin -- 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] Re: clear contents?
Jeremy Morano [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi everone... I'm having a little problem. The code below pops up a password dialog box where the user types in a username and a password to be able to proceed. However, if the user does not close the browser and goes back to the link, which they pops up the diolog box again and they don't have to type in there username and password again. They are remembered. I would like it so that the user has to type in there username and password any and every time that the diolog box is called on. Doe anyone know how to do this? I tried to clear the contents of PHP_AUTH_USER and PHP_AUTH_PW at the top of the page but that just messed things up. Can someone please help me? [some code] header( 'WWW-Authenticate: Basic realm=Private' ); header( 'HTTP/1.0 401 Unauthorized' ); echo 'Authorization Required.'; exit; Wouldn't it be enough to randomly create a name for the realm? / Franklin -- 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] Recursivly Updating Files
Skater wrote: what does that entail? Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Why not just configure your server to use an auto_prepend_file ? Reading the manual every now and then wouldn't hurt... really, it wouldn't :). snip 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. /snip -- Franklin van Velthuizen [EMAIL PROTECTED] +46-(0)70-6786613 Ebiris Applications AB http://www.ebiris.se/ +46-(0)19-109910 -- 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] Quick TXT document stuff
Kyle Smith wrote: ok i have this code to do whats below, but its not working Try to use file(), which will return an array. So that would be: $lines = file(filename); for($i=0; $i2; $i++) { print($lines[$i]); } /franklin -- 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] [PHP406]:No HTTP_POST_FILES on WinNT?
[EMAIL PROTECTED] wrote: Whatever I do (phpinfo(), echo $HTTP_POST_FILES['userfile']['type']) to display the array $HTTP_POST_FILES , I get nothing. Did you include enctype=multipart/form-data in your form tag? /franklin -- 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] If statement within a variable?
Brandon Orther wrote: Hello, Is there a way to put an if statement in a variable? For example: $var = Hello.IF($var2 = 1) { .Mr. Bean. } else { .New Comer. }. To The Coffee House.; $var = Hello .($var2==1 ? Mr. Bean : New Comer); /franklin -- 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] headers...
Nic Skitt wrote: Hi all, I am constantly getting Headers already sent errors. What I dont understand is why when I read something that could have come from a cookie or session does that right out to headers. eg: if (!$HTTP_COOKIE_VARS[TrackID]){ } The header error refers to this line as having first sent output. Is that the case?? if so how do I deal with that? Perhaps you have some whitespace lingering over there? / Franklin -- 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] How to Return a Real Filename?
Henrik Hudson wrote: Morning List- I have a script which gets passed a fileID and using that fileID it queries a SQL database and grabs an actual filename and then does a fopen, fpassthru, etc I added the header info (application/octet-stream) so it actually downloads the file right away, instead of just displaying the binary content :) Anways, the filename that shows up in the Save As box is the script name from the calling HREF. Is there anyway to get around this and have it display the actual filename? header(Content-Disposition: filename=$filename); / franklin -- Franklin van Velthuizen [EMAIL PROTECTED]+46-(0)70-6786613 Ebiris Applications AB http://www.ebiris.se/ +46-(0)19-109917 -- 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] File read Parser error
Gary wrote: Can someone tell me why I am getting an error for the second line below. It works locally but not live. ?php $filename = www/name/test/free.txt $toread = fopen($filename, 'r'); $contents = fread($toread, filesize($filename)); fclose($toread); echo $contents; ? It would be useful if you would point out which error it is you are encountering. / franklin -- Franklin van Velthuizen [EMAIL PROTECTED]+46-(0)70-6786613 Ebiris Applications AB http://www.ebiris.se/ +46-(0)19-109917 -- 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] passing parameters in the url using forward slashes
Good morning/afternoon/evening.. whatever timezone you live in :) Small question: we all know how to pass parameter using question marks in an URL ofcourse.. but I was wondering whether it was also possible to pass parameters in the URL using forward slashes instead of those question marks, so like: http://blabla/file.php/value and use value as a parameter, obviously. I just tried it, but all I got was an internal server error :(. Anyone who knows *anything* about this? Take care, /franklin -- Franklin van Velthuizen [EMAIL PROTECTED]+46-(0)19-10 99 17 Ebiris AB www.ebiris.se +46-(0)19-10 99 10
Re: [PHP] passing parameters in the url using forward slashes
[cut away some explanation] But I think it is pretty cool to make the program name look like just another directory in the tree, so I usually use Location. I suppose it *is* possible then. Anyway, I've already putten ForceType application/x-httpd-php in an .htaccess in the appropriate directory, and I have a php file called download .. Whenever I go to http://servername/download the file gets parsed and prints some output.. just as you would expect, but as soon as I put slashes after that url, I get an Internal Server Error. I have absolutely *no* idea what causes it though... :( Any ideas, anyone? /Franklin -- Franklin van Velthuizen [EMAIL PROTECTED]+46-(0)19-10 99 17 Ebiris AB www.ebiris.se +46-(0)19-10 99 10