[PHP] flock
I'm using flock to manage the access of a file. I've noticed that php seems to wait for the file to be freed up. Is there a ordered que that each request goes into? And a timeout period, or does it just wait? David -- 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 Security Alert for Apache/Win32
Folks running Apache/Win32 should read this: http://www.securiteam.com/windowsntfocus/5ZP030U60U.html If you run in CGI mode you likely have a line similar to the following in your httpd.conf: ScriptAlias /php/ C:\php\ Also, if you run SAPI mode (apache plugin mode) and used to run CGI, make sure that that line is commented out. Has someone else got an idea for a workaround, without having to go into safe-mode? Would safe-mode be able to prevent this? -GED Northern.CA ===-- http://www.northern.ca Canada's Search Engine -- 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] To you know-it-all's out there...
La page XML ne peut pas être affichée Impossible d'afficher l'entrée XML en utilisant la feuille de style . Corrigez l'erreur, puis cliquez sur le bouton Actualiser ou réessayez ultérieurement. Aucun espace blanc n'est autorisé à cet emplacement. Ligne 1, Position 3 ? Well, something's wrong (the style sheet ???), i think the integrated debbugger is a good idea... - Original Message - From: Torkil Johnsen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 06, 2002 4:39 AM Subject: [PHP] To you know-it-all's out there... Yeah this is a BIT of topic... I have this code: ? header(Content-type: image/svg+xml); print('?xml version=1.0 encoding=iso-8859-1?'); ? ?php $text=This page uses PHP and SVG; ? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 2303 Stylable//EN http://www.w3.org/TR/2000/03/WD-SVG-2303/DTD/svg-2303-stylable.dtd; svg xml:space=preserve width=100% height=20 descUsing styles/desc rect style=fill:#33 x=0 y=0 width=100% height=145/ text x=50 y=70 style=text-anchor:left; fill:#cc; font-size:26; font-weight:15; font-family:Tahoma, Verdana; font-style:regular?php echo $text; ?/text /svg See for yourself at: http://www.torkiljohnsen.com/xperiment/index.psvg This produces an error message (which you can read at the same page). Why is this? I had an xml/svg specialist make this code and it works perfectly on his server... Anyone got ANY clue as to why this is happening? ehhh... does anyone know of any good XML/SVG mailing lists out there ? :S Didn't know where else to ask. - Torkil -- 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] distinct element from array
An array contains various values eg: list of fruits. Now i want to retrieve only unique fruits from the array. The array may contain duplicate names. How can i achieve this? __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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]
SV: SV: [PHP] Re: Still need help with miscount
I don't know if this is actually it, but the line $num_vals[$i] = mysql_fetch_array($result); seems strange to me - doesn't mysql_fetch_array return an array? You should try list($num_vals[$i]) = mysql_fetch_array($result); and see if you get any improvements... No, that was not it. It gave me different results - but still wrong. I have, however, got a little closer by extending the loop to 0-11, for ($i=0; $i11; $i++), and changing the display, starting with: echo $num_vals[1][0];;. I had alla numbers shifted one step to the right before when counting zeroes as well. But - still the same problem. It doesn´t count correctly - and i can´t figure out why... - Daniel -- 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: PHP Security Alert for Apache/Win32
Wow!, i tried it and it really works, this is serious man! is there a fix around it without safe mode like GED suggested? Folks running Apache/Win32 should read this: http://www.securiteam.com/windowsntfocus/5ZP030U60U.html If you run in CGI mode you likely have a line similar to the following in your httpd.conf: ScriptAlias /php/ \C:php\ Also, if you run SAPI mode (apache plugin mode) and used to run CGI, make sure that that line is commented out. Has someone else got an idea for a workaround, without having to go into safe-mode? Would safe-mode be able to prevent this? -GED Northern.CA ===-- http://www.northern.ca Canada\'s Search Engine -- 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] distinct element from array
$distincts=array(); while (list($key,$val)=each($yourarray) { if (!in_array($val,$distincts)) { $distincts[]=$val; } } Kancha . wrote: An array contains various values eg: list of fruits. Now i want to retrieve only unique fruits from the array. The array may contain duplicate names. How can i achieve this? __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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] distinct element from array
Try array_unique() Regards, Andrey Hristov -- 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] What can I use instead?
Hi I am writing a piece of code that uses contstant names that are dynamic. My first solution was to use the constant() function from within PHP. My problem now is that the code needs to be compatible with PHP 3.018 and early versions of PHP 4. Can anyone offer a better way of doing things? My current code is $expected_result = 0; for ($i = 1; $i = $this-total_num; $i ++) { $information = constant('CONS_' . $i); $information_2 = split([,], $information); if ( in_array($expected_result, $information_2) ) { $expected_result = $i; break; } } Thanks in advance for any suggestions. Mark -- 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 Digest 6 Jan 2002 15:32:57 -0000 Issue 1095
php-general Digest 6 Jan 2002 15:32:57 - Issue 1095 Topics (messages 79592 through 79609): To you know-it-all's out there... 79592 by: Torkil Johnsen 79593 by: Manuel Lemos 79603 by: nico_netcourrier Re: regular expressions 79594 by: Michael Sims 79595 by: Michael Sims Re: Checking the season 79596 by: Tom Rogers 79597 by: webapprentice Re: NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!! 79598 by: snyperx Is the 'dl' function a bad idea to use? 79599 by: Joelmon2001.aol.com take links from url 79600 by: Alawi flock 79601 by: David Robinson PHP Security Alert for Apache/Win32 79602 by: Garth Dahlstrom 79606 by: David distinct element from array 79604 by: Kancha . 79607 by: Bogdan Stancescu 79608 by: Andrey Hristov Re: Still need help with miscount 79605 by: Daniel Alsén What can I use instead? 79609 by: Mark Evans Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Yeah this is a BIT of topic... I have this code: ? header(Content-type: image/svg+xml); print('?xml version=1.0 encoding=iso-8859-1?'); ? ?php $text=This page uses PHP and SVG; ? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 2303 Stylable//EN http://www.w3.org/TR/2000/03/WD-SVG-2303/DTD/svg-2303-stylable.dtd; svg xml:space=preserve width=100% height=20 descUsing styles/desc rect style=fill:#33 x=0 y=0 width=100% height=145/ text x=50 y=70 style=text-anchor:left; fill:#cc; font-size:26; font-weight:15; font-family:Tahoma, Verdana; font-style:regular?php echo $text; ?/text /svg See for yourself at: http://www.torkiljohnsen.com/xperiment/index.psvg This produces an error message (which you can read at the same page). Why is this? I had an xml/svg specialist make this code and it works perfectly on his server... Anyone got ANY clue as to why this is happening? ehhh... does anyone know of any good XML/SVG mailing lists out there ? :S Didn't know where else to ask. - Torkil ---End Message--- ---BeginMessage--- Torkil Johnsen wrote: Yeah this is a BIT of topic... I have this code: ? header(Content-type: image/svg+xml); print('?xml version=1.0 encoding=iso-8859-1?'); ? ?php $text=This page uses PHP and SVG; ? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 2303 Stylable//EN http://www.w3.org/TR/2000/03/WD-SVG-2303/DTD/svg-2303-stylable.dtd; svg xml:space=preserve width=100% height=20 descUsing styles/desc rect style=fill:#33 x=0 y=0 width=100% height=145/ text x=50 y=70 style=text-anchor:left; fill:#cc; font-size:26; font-weight:15; font-family:Tahoma, Verdana; font-style:regular?php echo $text; ?/text /svg See for yourself at: http://www.torkiljohnsen.com/xperiment/index.psvg This produces an error message (which you can read at the same page). Why is this? I had an xml/svg specialist make this code and it works perfectly on his server... Anyone got ANY clue as to why this is happening? It is not an error. The server just returns the script contents in plain text, so it is not executed as a PHP script. You need to configure your server to either process this script as a PHP script (it could be as simple as rename its extension to .php) or configure it to process all files with extension .psvg as PHP scripts. Regards, Manuel Lemos ---End Message--- ---BeginMessage--- La page XML ne peut pas être affichée Impossible d'afficher l'entrée XML en utilisant la feuille de style . Corrigez l'erreur, puis cliquez sur le bouton Actualiser ou réessayez ultérieurement. Aucun espace blanc n'est autorisé à cet emplacement. Ligne 1, Position 3 ? Well, something's wrong (the style sheet ???), i think the integrated debbugger is a good idea... - Original Message - From: Torkil Johnsen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 06, 2002 4:39 AM Subject: [PHP] To you know-it-all's out there... Yeah this is a BIT of topic... I have this code: ? header(Content-type: image/svg+xml); print('?xml version=1.0 encoding=iso-8859-1?'); ? ?php $text=This page uses PHP and SVG; ? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 2303 Stylable//EN http://www.w3.org/TR/2000/03/WD-SVG-2303/DTD/svg-2303-stylable.dtd; svg xml:space=preserve width=100% height=20 descUsing styles/desc rect style=fill:#33 x=0 y=0 width=100% height=145/ text x=50 y=70 style=text-anchor:left; fill:#cc; font-size:26; font-weight:15; font-family:Tahoma, Verdana;
[PHP] Re: What can I use instead?
On 1/6/02 10:15 AM, Mark Evans [EMAIL PROTECTED] wrote: I am writing a piece of code that uses contstant names that are dynamic. Is this an oximoron? Just a thought... -- 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] Internal Server Error?
Hello, Does anybody have any ideas why the code below is giving me internal server errors? if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm=XYZ Company Admin Area'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != admin) || ($PHP_AUTH_PW != password)) { header('WWW-Authenticate: Basic realm=XYZ Company Admin Area'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; Do I need to set or change anything in my PHP set-up? Thanks in advance, GF.
[PHP] ... [PHP] Stupid question alert
Thanks for everyone's comments. If I understand what you are saying it should be possible to fill the content of a layer by issuing some sort of server include command.. (?) So, for example, rather than have a something that looks like this: div id=haiti style=position:absolute; left:752px; top:321px; width:166px; height:162px; z-index:14; visibility: hidden table width=166 border=0 cellpadding=0 cellspacing=0 tr td img src=Atlas/images/photolayer_11.gif width=81 height=55/td td img src=Atlas/images/photolayer_12.gif width=85 height=55/td /tr tr td img src=Atlas/images/photolayer_14.gif width=81 height=53/td td img src=Atlas/images/photolayer_15.gif width=85 height=53/td /tr tr td img src=Atlas/haiti_17.gif width=81 height=55/td td img src=Atlas/haiti_18.gif width=85 height=55/td /tr /table /div It should be possible to have some code that gives the layer position but rather than then having all the other code describing the layer contents, have some sort of php command that says 'get the contents from file xxx.php'. If this is the case what should I be learning about to make this happen? Thanks again, Tim (standing on the shoulders of giants) Your question is not stupid - it's just uninformed, and that's easily understandable if you never used PHP. The concept is dynamically creating the page SERVER-SIDE. That is, use some databases or some nifty code to dynamically build a page using specific parameters. Unforunately for you, this means that all the fun ends on the server side. Once PHP ends its job, Apache takes over and serves the content generated by PHP as it would serve any regular file. What you actually pass to the client is dead information - it's not dynamic unless you echo some JavaScript code or something similar from PHP (which is the same as writing the respective code in a regular file, unless you create some custom parameters in JavaScript based on some other parameters you pass to PHP). Hope my explanation makes sense... ;-) Bogdan tim at 10Kv wrote: Hi, first of all apologise to the list this is a very basic question for you I¹m sure. I have tried to find an answer on the web but the problem is knowing HOW to ask the question and I hoping you can provide me with a starting point. Anyway.. I design a lot of graphic intensive pages which rely heavily on layers that contain images, mouseovers and image swaps. The trouble is, when there are more than a couple of these layers on a page the code gets long and over complicated. For example, if I have a page which on one side contains an image map with 5 clickable points that shows one of 5 possible layers on the other side of the page (each with different content) this is automatically a page with lots of code which is slow to load especially if the page already has a layer based navigation bar! My question is: is there a way to use a language like php to make this process easier? For example populate the layers from a different file rather than have all the code on the same page and perhaps slim the page down a little or is this missing the point of what a language like php is about. Thanks for your help and my apologies if this is the worst question of the week. Tim Rogers -- 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: [PHP-DB] PHP/MySql - address book
The answer to your question is the relational model of databases. So instead of one big table, you have to use 2. Say first table is employee and the second - companies. in the employee we have some fields and one of them is company_id, this id corresponds to a single row in the companies table. companies table contains several fields nut one of them is company_id. company_id is a foreign key (the link you ask). How to get all employees from single company: select employee.* from employee,companies where employee.company_id=companies.company_id and companies.company_name='Some Ltd. Inc.'; or better select employee.* from employee left join companies using(company_id) where company_name='Some Ltd Inc.'; I do not have links to literature about relational model but I remember that on www.phpbuilder.com there is/are some info on it.I think from y.2000. Regards, Andrey Hristov Andrey Hristov Web Developer - Original Message - From: sg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 06, 2002 7:26 PM Subject: [PHP-DB] PHP/MySql - address book Hi, I'm trying to do a sort of address book where I'd put all information about anybody or any company from which I receive informtation (friend, people from work, hotels, places...) An entry starts with a name, then I can have any type of information. The table I'm using has a lot of fields, but I display via PHP only those that are not empty. I'm now facing a problem many must have already faced. A lot of people work for the same company, and I'd like to have a separate table or storage area to put that data, so that I don't have to write the same company addresse twice, and if that information changes, I won't have to go through ten or twenty people's entries to modify it. So how would I link a company's information to a person's entry? I know it may sound easy or ridiculous a question, but though I know HTML very well I'm still a beginner (learning on my own) et PHP and MySql. So far I have a neat rendering of the database I've created, but I feel I should look further into DB use. Software I'm using: EasyPHP (latest version) PHP 4 MySql PhpMyAdmin on Windows Me Main question, I repeat is : how would I link a company's information to a person's entry? Cheers Sébastien -- PHP Database 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] Re: distinct element from array
array_keys(array_count_values($foo)); -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com Kancha . [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... An array contains various values eg: list of fruits. Now i want to retrieve only unique fruits from the array. The array may contain duplicate names. How can i achieve this? __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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] Internal Server Error?
This only works if PHP is installed as an Apache module on the Linux/UNIX platforms. From the docs: One additional note about PHP: if PHP is installed as an Apache module on the Linux/UNIX platforms, there are additional global variables available to your PHP script: $PHP_AUTH_USER -- Authenticated User name $PHP_AUTH_PW -- Authenticated Password $PHP_AUTH_TYPE -- Authentication Type Additionally, your PHP program can force Apache to prompt the user for a username and password with the following PHP commands: header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; From then on, your application logic can decide how to respond to the user. Note that on the Windows platform, PHP is installed as a CGI, and these features are therefore not available. -Original Message- From: GoodFella [mailto:[EMAIL PROTECTED]] Sent: zondag 6 januari 2002 17:31 To: php Mail Subject: [PHP] Internal Server Error? Hello, Does anybody have any ideas why the code below is giving me internal server errors? if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm=XYZ Company Admin Area'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != admin) || ($PHP_AUTH_PW != password)) { header('WWW-Authenticate: Basic realm=XYZ Company Admin Area'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; Do I need to set or change anything in my PHP set-up? Thanks in advance, GF. -- 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] setcookie()
Hello, I need to set a cookie to store a username, password, and passcode forever (never expires). I don't really know how to use the setcookie() function. Could someone show me the proper way to use the setcookie() function to do this? Thanks, Tyler -- 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 Parsing Efficiency
Newbie question: Is there any performance hit on a page with muliple PHP tags inserted throughout HTML, compared with trying to concatenate all of the PHP scripting into one set of tags? Thanks for any advice! Marvin -- 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: [PHP-DB] mysql_num_rows
That means the sql is not correct and the mysql_query()(mysql at all) didn't succeded to execute it Check you sql statement. Regards, Andrey Hristov - Original Message - From: Gurhan Ozen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 06, 2002 9:52 PM Subject: [PHP-DB] mysql_num_rows Hi everyone, I have a problem with mysql connectivety which is making me nuts. If the query is select blah, blah from table (i.e. without where clause) mysql_num_rows returns the right number, but when i put in a query with where clause, although there are rows returned, PHP is giving: Warning: Supplied argument is not a valid MySQL result resource error.. Can anyone point me to any direction about this? Thanks. Gurhan -- PHP Database 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] Re: setcookie()
man first of all look in the manual. there it is very clear... http://www.php.net/manual/en/function.setcookie.php -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com Tyler Longren [EMAIL PROTECTED] wrote in message 000901c196e7$71df35b0$0101a8c0@nightengale">news:000901c196e7$71df35b0$0101a8c0@nightengale... Hello, I need to set a cookie to store a username, password, and passcode forever (never expires). I don't really know how to use the setcookie() function. Could someone show me the proper way to use the setcookie() function to do this? Thanks, Tyler -- 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] take links from url
You could use the following preg statement: preg_match_all( /table(.*(?=\/table))/, $string, $output, PREG_SET_ORDER ); This would put all matches of tablesome code, text, whatever/table into the $output array. however you would start to have problems when you come across nested tables. You'd need something to count how deep your nested if you have nested table containers. Regards Matt. - Original Message - From: Alawi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 06, 2002 7:47 AM Subject: [PHP] take links from url I want to take string between table/table tags in put it in variable How can I do that ? -- 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: PHP Security Alert for Apache/Win32
Can you not just delete the ScriptAlias line? What does that line actually do apart from create an Alias? LJ David [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Wow!, i tried it and it really works, this is serious man! is there a fix around it without safe mode like GED suggested? Folks running Apache/Win32 should read this: http://www.securiteam.com/windowsntfocus/5ZP030U60U.html If you run in CGI mode you likely have a line similar to the following in your httpd.conf: ScriptAlias /php/ \C:php\ Also, if you run SAPI mode (apache plugin mode) and used to run CGI, make sure that that line is commented out. Has someone else got an idea for a workaround, without having to go into safe-mode? Would safe-mode be able to prevent this? -GED Northern.CA ===-- http://www.northern.ca Canada\'s Search Engine -- 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] setcookie()
Here's a compilation of some recent conclusions I've gotten from the same discussion: This is how I chose to set the variables: // $username and $password are passed from a previous page's form. $time = mktime()+1800; $date = gmdate(D, d-M-Y H:i:s, ($time)); $password = md5 ($password); header ('Set-Cookie: username='.$username.'; expires='.$date.' GMT; path=/; domain='.$SERVER_ADDR); header ('Set-Cookie: password='.$password.'; expires='.$date.' GMT; path=/; domain='.$SERVER_ADDR); Produces: Set-Cookie: username=Rasmus; expires=Wed, 12-Dec-2001 21:58:55 GMT; path=/; domain=www.php.net Set-Cookie: password=d41d8cd98f00b204e9800998ecf8427e; expires=Wed, 12-Dec-2001 21:58:55 GMT; path=/; domain=www.php.net Whereas these two calls (per Rasmus Lerdorf): SetCookie('username',$username,time()+1800,'/',$SERVER_ADDR); SetCookie('password',$password,time()+1800,'/',$SERVER_ADDR); Produce: Set-Cookie: username=Rasmus; expires=Wed, 12-Dec-01 21:58:55 GMT; path=/; domain=www.php.net Set-Cookie: password=d41d8cd98f00b204e9800998ecf8427e; expires=Wed, 12-Dec-01 21:58:55 GMT; path=/; domain=www.php.net Putting them side by side to make it easier to compare: Set-Cookie: username=Rasmus; expires=Wed, 12-Dec-2001 21:58:55 GMT; path=/; domain=www.php.net Set-Cookie: username=Rasmus; expires=Wed, 12-Dec-01 21:58:55 GMT; path=/; domain=www.php.net Ramsus wrote: They are identical except for the PHP SetCookie() version using a 2-digit year (which can be changed in your php.ini file with the y2k directive). -- Casey Allen Shobe [EMAIL PROTECTED] 'Why do people with closed minds always open their mouths?' -- 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] Can't get accurate day of year
Austin, Thanks for your input regarding the date(z) question. I did try ceil(date(z)) but the output using 'z' is an integer. I just used date(z)+1 and moved on. Thanks again, Hugh - Original Message - From: Austin Gonyou [EMAIL PROTECTED] To: Hugh Danaher [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 11:43 PM Subject: Re: [PHP] Can't get accurate day of year -- 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] PHP4 and POP Email ?
Is there a way I can * download * emails and save them to disk (as individual emails) with PHP? I know I can send (SMTP) -- but has anyone written a PHP program that receives emails? Thanks. Jason -- 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: PHP software tool
Yoep wrote: I use this one too... its just 20$ or so though, and is a very great and convient editor. I do all my PHP coding in it. ACK. phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP4 and POP Email ?
You may check out IMP for a program. The functions you're looking for are listed in the documentation under IMAP mail (it's a generic set of functions for both IMAP and POP). Bogdan Jason Caldwell wrote: Is there a way I can * download * emails and save them to disk (as individual emails) with PHP? I know I can send (SMTP) -- but has anyone written a PHP program that receives emails? Thanks. Jason -- 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 Parsing Efficiency
There may be a difference but even if it is, it's so small you shouldn't consider it. Imagine how much it takes for a (generally) cached document to be checked for ? or ?php or whatever you're using... Don't bother with this one! Bogdan Marvin Sanders wrote: Newbie question: Is there any performance hit on a page with muliple PHP tags inserted throughout HTML, compared with trying to concatenate all of the PHP scripting into one set of tags? Thanks for any advice! Marvin -- 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] Re: Re: PHP Security Alert for Apache/Win32
I tried playing with ScriptAlias settings, but i given up. I now use the the Apache module instead of cgi. To change over to the Apache module: copy php4ts.dll to the windows/system(win9x/Me) or winnt/system32(winNT/2000/XP) directory. then inside httpd.conf: LoadModule php4_module c:/php/sapi/php4apache.dll AddType application/x-httpd-php .php .phtml remember to comment out the most important part after converting: # ScriptAlias /php4/ \C:/php/\ # Action application/x-httpd-php4 \/php4/php.exe\ # AddType application/x-httpd-php4 .php folks who are using PHP as a CGI under apache for win32, please read this: http://www.securiteam.com/windowsntfocus/5ZP030U60U.html http://www.hackers.com/new/currentnews.php?nid=5 -- 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] POSTing HTML into a database
Hi I need a user to be able to enter submit HTML code (also perhaps containing PHP code) via a web form, which will then be entered into a database. The data is typed in to a textarea, which is then posted to my script. I notice that some special characters come out of this process escaped, but the escaping sequence does not appear to be entirely compatible with the SQL query I'm using to insert it into a table. Can anyone tell me the correct way to convert the output from the form into a format that PostgreSQL will accept, and then how to convert it back so that it's identical to what the user entered before being escaped by post (so that I can just use print to print it out)? Thanks. --jaa -- 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] How to read/write form/into certain place in a text file
hi, A text file has been formatted ,how to read/write form/into certain place in a text file. For example,read form letter 5 to 10 in line 4 ,and after some procedure ,write into the same place. Another question is that if a user has opened the file to read and write ,what will happen if another one will open and write the same file? Thank you in advance. Leon -- 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] POSTing HTML into a database
I've used a combination of addslashes() and stripslashes() along with htmlspecialchars() to perform just that sort of thing, though I used MySQL instead of PostreSQL. Does anyone know, by the way, if there's a port of PostreSQL to Windows 2000? Or can I run it in Cygwin? At 03:45 PM 1/6/2002, James Arthur wrote: Hi I need a user to be able to enter submit HTML code (also perhaps containing PHP code) via a web form, which will then be entered into a database. The data is typed in to a textarea, which is then posted to my script. I notice that some special characters come out of this process escaped, but the escaping sequence does not appear to be entirely compatible with the SQL query I'm using to insert it into a table. Can anyone tell me the correct way to convert the output from the form into a format that PostgreSQL will accept, and then how to convert it back so that it's identical to what the user entered before being escaped by post (so that I can just use print to print it out)? Thanks. --jaa -- 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] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- 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: POSTing HTML into a database
Hello, James Arthur wrote: Hi I need a user to be able to enter submit HTML code (also perhaps containing PHP code) via a web form, which will then be entered into a database. The data is typed in to a textarea, which is then posted to my script. I notice that some special characters come out of this process escaped, but the escaping sequence does not appear to be entirely compatible with the SQL query I'm using to insert it into a table. Can anyone tell me the correct way to convert the output from the form into a format that PostgreSQL will accept, and then how to convert it back so that it's identical to what the user entered before being escaped by post (so that I can just use print to print it out)? If you really need to store and retrive amounts of data of arbitrary size, you need to use large object fields (LOBs). The usage of this type of fields varies a lot with the type of database that you are using. You may want to try Metabase which is a database abstraction package that provides a database independent API to let you access to information stored in SQL databases. One of the aspects that Metabase handles for you with a single set of functions that does not depend on the database is creating, storing and retrieving data from tables with large object fields (LOBs). Take a look here, where you will find Metabase classes and also comprehensive reference documentation and a tutorial that not only tells you how to use Metabase capabilities, but also provides a good introduction to Large Object fields among other not so trivial to use database features, like transactions, prepared queries, etc... http://phpclasses.UpperDesign.com/browse.html/package/20 Regards, Manuel Lemos -- 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] POSTing HTML into a database
Does anyone know, by the way, if there's a port of PostreSQL to Windows 2000? Or can I run it in Cygwin? I've seen it in the package list for Cygwin, there may be a full port as well, check Postgres' web site. -Adam -- 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-mysql connectivity problem
Hi all, I'm a newbie to PHP and mySQL and I'm currently running PHP+mySQL on my Linux 2.2.16 kernel. Every time I try to connect to mySQL from a php page, I get this error message: ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mys ql.sock' (111) FYI: mysqld was running, and I use the following function in the php script to access mysql database $db = mysql_connect(localhost,username,password); What does that mean and how do I go about solving it? Thanks in advance for your directions and have a great new year. Best regards, -- 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] Re: setcookie()
I have checked the manual. A few times actually. I have setcookie(usename, $username); Will that cookie never expire? Or will it expire at the end of the browsing session? I couldn't find any details on that in the manual. Tyler - Original Message - From: George Nicolae [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 06, 2002 2:03 PM Subject: [PHP] Re: setcookie() man first of all look in the manual. there it is very clear... http://www.php.net/manual/en/function.setcookie.php -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com Tyler Longren [EMAIL PROTECTED] wrote in message 000901c196e7$71df35b0$0101a8c0@nightengale">news:000901c196e7$71df35b0$0101a8c0@nightengale... Hello, I need to set a cookie to store a username, password, and passcode forever (never expires). I don't really know how to use the setcookie() function. Could someone show me the proper way to use the setcookie() function to do this? Thanks, Tyler -- 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] Re: setcookie()
On Sun, 2002-01-06 at 16:01, Tyler Longren wrote: I have checked the manual. A few times actually. I have setcookie(usename, $username); Will that cookie never expire? Or will it expire at the end of the browsing session? I couldn't find any details on that in the manual. Tyler Tyler, the manual pages appear to have changed sometime recently. They used to state that the cookie would expire if no time was passed to it when the browser was closed. I do not see that statement there any longer. However, note the remarks about older versions of some browsers not setting cookies properly unless the time is specified. I have not concerned myself with that on my sites, but it may be a factor to you. Billy -- 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] Remote Cookie ID and Web Statistics
Hello, - for something a little different... Does anyone have experience using Javascript on remote server html delivered pages to capture data in a PHP MySQL database resident at my domain. I would like to build a customer profile database for a customer using a permanent cookie on a visitor's browser client to ID them and track their visits by page over time. This is similar to a live or remote web statistics process for a session but posting to a mysql database by some mapped category by page in addition to the web stats. I'd like to track both the session and by posting to a visitor database, long term trends as well. Any suggestions would be appreciated. Thanks, Rick [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] bcc
Greetings ! Is Bcc supported in PHP? Looking forward to hearing from you. Warm Regards, DT -- 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] Remote Javascript call to PHP MySQL Database
Does anyone have experience using Javascript on remote pages to capture data in a PHP MySQL database. I would like to build a customer profile database for a customer using a permanent cookie on a site visitor's machine to ID them and track their usage. Any suggestions would be appreciated. Moderator: I don't seem to be able to get the automated system to accept my email address, please enroll me in this group. Thanks,... Rick [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] Re: Remote Javascript call to PHP MySQL Database
Note: Please disregard this message as it was restated and resent recently. Richard Spangenberg [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anyone have experience using Javascript on remote pages to capture data in a PHP MySQL database. I would like to build a customer profile database for a customer using a permanent cookie on a site visitor's machine to ID them and track their usage. Any suggestions would be appreciated. Moderator: I don't seem to be able to get the automated system to accept my email address, please enroll me in this group. Thanks,... Rick [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 Digest 7 Jan 2002 03:33:33 -0000 Issue 1096
php-general Digest 7 Jan 2002 03:33:33 - Issue 1096 Topics (messages 79610 through 79642): Re: What can I use instead? 79610 by: Gerald Artman Internal Server Error? 79611 by: GoodFella 79615 by: Kraa de Simon ... [PHP] Stupid question alert 79612 by: tim at 10Kv Re: [PHP-DB] PHP/MySql - address book 79613 by: Andrey Hristov Re: distinct element from array 79614 by: George Nicolae setcookie() 79616 by: Tyler Longren 79619 by: George Nicolae 79623 by: Casey Allen Shobe 79637 by: Tyler Longren 79638 by: Billy Harvey PHP Parsing Efficiency 79617 by: Marvin Sanders 79629 by: Bogdan Stancescu Re: [PHP-DB] mysql_num_rows 79618 by: Andrey Hristov Re: take links from url 79620 by: Matt Moreton Re: PHP Security Alert for Apache/Win32 79621 by: LaserJetter 79630 by: David Re: Connect to IBM DB2 79622 by: Maciej Uhlig 79624 by: Casey Allen Shobe Re: Can't get accurate day of year 79625 by: Hugh Danaher PHP4 and POP Email ? 79626 by: Jason Caldwell 79628 by: Bogdan Stancescu Re: PHP software tool 79627 by: Phillip Oertel POSTing HTML into a database 79631 by: James Arthur 79633 by: Richard S. Crawford 79634 by: Manuel Lemos 79635 by: Adam Baratz How to read/write form/into certain place in a text file 79632 by: Zhang, Leon (STHK/Zh) php-mysql connectivity problem 79636 by: Vu Hoang Huynh Remote Cookie ID and Web Statistics 79639 by: Richard Spangenberg bcc 79640 by: Deependra B. Tandukar Remote Javascript call to PHP MySQL Database 79641 by: Richard Spangenberg 79642 by: Richard Spangenberg Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On 1/6/02 10:15 AM, Mark Evans [EMAIL PROTECTED] wrote: I am writing a piece of code that uses contstant names that are dynamic. Is this an oximoron? Just a thought... ---End Message--- ---BeginMessage--- Hello, Does anybody have any ideas why the code below is giving me internal server errors? if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm=XYZ Company Admin Area'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != admin) || ($PHP_AUTH_PW != password)) { header('WWW-Authenticate: Basic realm=XYZ Company Admin Area'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; Do I need to set or change anything in my PHP set-up? Thanks in advance, GF. ---End Message--- ---BeginMessage--- This only works if PHP is installed as an Apache module on the Linux/UNIX platforms. From the docs: One additional note about PHP: if PHP is installed as an Apache module on the Linux/UNIX platforms, there are additional global variables available to your PHP script: $PHP_AUTH_USER -- Authenticated User name $PHP_AUTH_PW -- Authenticated Password $PHP_AUTH_TYPE -- Authentication Type Additionally, your PHP program can force Apache to prompt the user for a username and password with the following PHP commands: header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; From then on, your application logic can decide how to respond to the user. Note that on the Windows platform, PHP is installed as a CGI, and these features are therefore not available. -Original Message- From: GoodFella [mailto:[EMAIL PROTECTED]] Sent: zondag 6 januari 2002 17:31 To: php Mail Subject: [PHP] Internal Server Error? Hello, Does anybody have any ideas why the code below is giving me internal server errors? if (!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm=XYZ Company Admin Area'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != admin) || ($PHP_AUTH_PW != password)) { header('WWW-Authenticate: Basic realm=XYZ Company Admin Area'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; Do I need to set or change anything in my PHP set-up? Thanks in advance, GF. ---End Message--- ---BeginMessage--- Thanks for everyone's comments. If I understand what you are saying it should be possible to fill the content of a layer by issuing some sort of server include command.. (?) So, for example, rather than have a something that looks like this: div id=haiti style=position:absolute; left:752px; top:321px; width:166px; height:162px; z-index:14; visibility: hidden table width=166
Re: [PHP] bcc
What do you mean? Supported in what way? (I take it you're referring to the e-mail blind carbon copy feature). Bogdan Deependra B. Tandukar wrote: Greetings ! Is Bcc supported in PHP? Looking forward to hearing from 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]
re: [PHP] How to read/write form/into certain place in a text file
Does anybody know this? Please give me some advice,any help will be appreciated. -ÔʼÓʼþ-·¢¼þÈË: Zhang, Leon (STHK/Zh) [mailto:[EMAIL PROTECTED]]·¢ËÍʱ¼ä: 07 January, 2002 9:56ÊÕ¼þÈË: [EMAIL PROTECTED]Ö÷Ìâ: [PHP] How to read/write form/into certain place in a text file hi, A text file has been formatted ,how to read/write form/into certain place in a text file. For example,read form letter 5 to 10 in line 4 ,and after some procedure ,write into the same place. Another question is that if a user has opened the file to read and write ,what will happen if another one will open and write the same file? Thank you in advance. Leon -- 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]
[Fwd: Re: [PHP] bcc]
Inadvertedly only sent to me... Original Message Subject: Re: [PHP] bcc Date: Mon, 7 Jan 2002 11:46:07 +0800 From: Jimmy [EMAIL PROTECTED] To: Bogdan Stancescu [EMAIL PROTECTED] References: [EMAIL PROTECTED]00b701c1972b$68cae5c0$[EMAIL PROTECTED] [EMAIL PROTECTED] Is Bcc supported in PHP? I havent try it, but i think it should work. Just add the bcc header in the additional header parameter (the 4th param of mail() function) -- Jimmy When you lose, don't lose the lesson. -- 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] bcc
Dear List, I is always a good idea to check out the manual before asking questions. The answer to Leon's question about files is in the manual as well as the answer to this questions. I hope the following links help. File Operations: http://www.php.net/manual/en/ref.filesystem.php Bcc can be found in this section: http://www.php.net/manual/en/ref.mail.php Copying from the manual: /* recipients */$to = Mary [EMAIL PROTECTED] . , ; //note the comma$to .= Kelly [EMAIL PROTECTED];/* subject */$subject = Birthday Reminders for August;/* message */$message = 'htmlhead titleBirthday Reminders for August/title/headbodypHere are the birthdays upcoming in August!/ptable tr thPerson/ththDay/ththMonth/ththYear/th /tr tr tdJoe/tdtd3rd/tdtdAugust/tdtd1970/td tdSally/tdtd17th/tdtdAugust/tdtd1973/td /tr/table/body/html';/* To send HTML mail, you can set the Content-type header. */$headers = MIME-Version: 1.0\r\n;$headers .= Content-type: text/html; charset=iso-8859-1\r\n;/* additional headers */$headers .= From: Birthday Reminder [EMAIL PROTECTED]\r\n;$headers .= Cc: [EMAIL PROTECTED]\r\n;$headers .= Bcc: [EMAIL PROTECTED]\r\n;/* and now mail it */mail($to, $subject, $message, $headers); Bogdan Stancescu [EMAIL PROTECTED] wrote: What do you mean? Supported in what way? (I take it you're referring to the e-mail blind carbon copy feature). Bogdan Deependra B. Tandukar wrote: Greetings ! Is Bcc supported in PHP? Looking forward to hearing from 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] Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Send FREE video emails in Yahoo! Mail.
Re: [PHP] Remote Cookie ID and Web Statistics
Why would you want to use Javascript? Just have some code at the top of each page which -checks for the cookie -if it doesn't exist -identify customer, login page or however you choose -set cookie -update database -if it does exist -update the database with some information pertinent to that page Or are these straight HTML pages, thus the need for Javascript to do something? I don't konw a lot of Javascript, but you could have it pop open a PHP page in a child browser window, back in the Z-order so that it would be behind your main page (only for Internet Explorer), and use it to do the above steps. For every page transition you would have to pass the appropriate parameters to the child window and force it to refresh. You will have some trouble with people who have Javascript and cookies turned off. As I said, I don't know Javascript, so this is just off the top of my head. A straight PHP solution would be preferable and I assume it's not possible either because the ISP doesn't host it or for some political reason. Miles Thompson At 10:28 PM 1/6/2002 -0500, Richard Spangenberg wrote: Hello, - for something a little different... Does anyone have experience using Javascript on remote server html delivered pages to capture data in a PHP MySQL database resident at my domain. I would like to build a customer profile database for a customer using a permanent cookie on a visitor's browser client to ID them and track their visits by page over time. This is similar to a live or remote web statistics process for a session but posting to a mysql database by some mapped category by page in addition to the web stats. I'd like to track both the session and by posting to a visitor database, long term trends as well. Any suggestions would be appreciated. Thanks, Rick [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] phpinfo() question
When you run phpinfo(), the first line of detail has the OS version. What variable produces this? -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v3.02 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]
RE: [PHP] phpinfo() question
When you run phpinfo(), the first line of detail has the OS version. What variable produces this? Thats the output from uname -a on the command line... at least, under *nix it is... Jason -- 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] phpinfo() question
Thanks. That was it! Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v3.02 Guest Book http://www.gaylenandmargie.com/phpwebsite/ - Original Message - From: Jason Murray [EMAIL PROTECTED] To: 'Gaylen Fraley' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, January 06, 2002 10:06 PM Subject: RE: [PHP] phpinfo() question When you run phpinfo(), the first line of detail has the OS version. What variable produces this? Thats the output from uname -a on the command line... at least, under *nix it is... Jason -- 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 read/write form/into certain place in a text file
Hi Leon, For example,read form letter 5 to 10 in line 4 ,and after some procedure ,write into the same place. if the file is not too big, you can use file() function which will return an array containing the content of the file per line. combine this with substr() to read from specific column. to write use substr_replace(). if the file is big, then doing file() is not advised, you should read the file as stream. read the following functions: fopen(), fclose(), fseek(), fread(), fwrite(). Another question is that if a user has opened the file to read and write , what will happen if another one will open and write the same file? php doesnt handle file locking automatically, so i think it would depend on the OS. if you want to handle file locking, read about flock(). -- Jimmy God is greater than your greatest problem -- 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 read/write form/into certain place in a text file
Thank you ,Jimmy . -ÔʼÓʼþ- ·¢¼þÈË: Jimmy [mailto:[EMAIL PROTECTED]] ·¢ËÍʱ¼ä: 07 January, 2002 12:13 ÊÕ¼þÈË: [EMAIL PROTECTED] Ö÷Ìâ: Re: [PHP] How to read/write form/into certain place in a text file Hi Leon, For example,read form letter 5 to 10 in line 4 ,and after some procedure ,write into the same place. if the file is not too big, you can use file() function which will return an array containing the content of the file per line. combine this with substr() to read from specific column. to write use substr_replace(). if the file is big, then doing file() is not advised, you should read the file as stream. read the following functions: fopen(), fclose(), fseek(), fread(), fwrite(). Another question is that if a user has opened the file to read and write , what will happen if another one will open and write the same file? php doesnt handle file locking automatically, so i think it would depend on the OS. if you want to handle file locking, read about flock(). -- Jimmy God is greater than your greatest problem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] no reply-to header?
Hi All, I just realize there's no reply-to header in this mailing list. No wonder I never receive my own email when I reply to any mail here. Does it purposely set this way? Or is this a glitch? -- Jimmy Mistakes show us what we need to learn. -- 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] no reply-to header?
I thought that if there's no reply-to, then email clients will use the from as the reply to ?? -Original Message- From: Jimmy [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 3:22 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] no reply-to header? Hi All, I just realize there's no reply-to header in this mailing list. No wonder I never receive my own email when I reply to any mail here. Does it purposely set this way? Or is this a glitch? -- Jimmy Mistakes show us what we need to learn. -- 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] Another php data gathering question
Is there any way, through PHP, to get the: server uptime processor type number of cpu's I'm trying to find a compatable solution for both win32 and *nix. Thanks! -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com/ PHP KISGB v3.02 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] Scripting events with php
My problem is that I want to use events in my forms but I do not know how to use php as a script for an event. Say I wanted to do something as simple as (within a form): input type=button value=Test onclick= ?php print 'testing, testin 123';? Essentially, when a click this button in a form it prints out testing. A more sophicisticated problem i had, was i wanted to print out multiple repeats of a form based upon user input. I have a user database, where during the initial profile setup, they can specificy potentially large amount of interests that they have. I would like for them to be able to say: I have 5 interests, click a button then 5 textboxes popup. dmp -- 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] Scripting events with php
My problem is that I want to use events in my forms but I do not know how to use php as a script for an event. Say I wanted to do something as simple as (within a form): input type=button value=Test onclick= ?php print 'testing, testin 123';? Essentially, when a click this button in a form it prints out testing. PHP is a server-side script language. It does not get sent to the browser, and browsers don't understand how to execute PHP code (for that precise reason). You want to do this with JavaScript, not PHP. Jason -- 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] IF in mysql query results problem
I am working on a program that allows users to bookmark a particular item that they view. The bookmarks are stored in the database. I would like to use an IF statement in the mysql query so when the user logs in and views the items, the option to bookmark the record has been removed if they have already bookmarked it. Here's an example query: SELECT p.id AS player_id, p.name, p.hs, c.id AS coach_id, co.cid AS college, IF(co.pid=31,1,0) AS is_bookmarked FROM player p, coach c, co_bookmarks co WHERE p.id=31 AND p.hs=c.id AND co.cid=2 When I use the above query in a search, it comes up with 3 results, 1 of which is correct. If I GROUP BY p.id, there is only 1 result but its incorrect. The search should only come up with 1 correct result in this case. +---+-++--+-+---+ | player_id | name | hs | coach_id | college | is_bookmarked | +---+-++--+-+---+ | 31 | Paul Mantle | 24 | 24 | 2 | 0 | | 31 | Paul Mantle | 24 | 24 | 2 | 1 | | 31 | Paul Mantle | 24 | 24 | 2 | 0 | +---+-++--+-+---+ +---+-++--+-+---+ | player_id | name | hs | coach_id | college | is_bookmarked | +---+-++--+-+---+ | 31 | Paul Mantle | 24 | 24 | 2 | 0 | +---+-++--+-+---+ The row with is_bookmarked = 1 is the only correct one. I am assuming that for some reason, its displaying 3 results because there are 3 id's associated with cid=2. But if I group them by the id, it takes the wrong row: If anyone has any suggestions as to what I'm doing wrong, please let me know as I'm tapped out on ideas. Thanks a TON!! __ Jason Dulberg Extreme MTB http://extreme.nas.net -- 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: To you know-it-all's out there...
Your code works perfectly as a .php file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP Security Alert for Apache/Win32
AFAIK, you need the ScriptAlias line in your httpd.conf if you are running PHP as a CGI... Safer to run it as an SAPI module if you can and remove that ScriptAlias line. -GED LaserJetter - Re: PHP Security Alert for Apache/Win32 - Sun, 6 Jan 2002 20:16:39 - Can you not just delete the ScriptAlias line? What does that line actually do apart from create an Alias? LJ -- 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 in mysql query results problem
Hi Jason, I am not too familiar with IF statements in SQL, but one thing may be the reason you see the incorrect results: You have three tables, player, coach and co_bookmarks, but you only join player and coach. Shouldn't you join coach with co_bookmarks. I hope this helps. erisen SELECT p.id AS player_id, p.name, p.hs, c.id AS coach_id, co.cid AS college, IF(co.pid=31,1,0) AS is_bookmarked FROM player p, coach c, co_bookmarks co WHERE p.id=31 AND p.hs=c.id AND co.cid=2 Jason Dulberg [EMAIL PROTECTED] wrote: I am working on a program that allows users to bookmark a particular item that they view. The bookmarks are stored in the database. I would like to use an IF statement in the mysql query so when the user logs in and views the items, the option to bookmark the record has been removed if they have already bookmarked it. Here's an example query: SELECT p.id AS player_id, p.name, p.hs, c.id AS coach_id, co.cid AS college, IF(co.pid=31,1,0) AS is_bookmarked FROM player p, coach c, co_bookmarks co WHERE p.id=31 AND p.hs=c.id AND co.cid=2 When I use the above query in a search, it comes up with 3 results, 1 of which is correct. If I GROUP BY p.id, there is only 1 result but its incorrect. The search should only come up with 1 correct result in this case. +---+-++--+-+---+ | player_id | name | hs | coach_id | college | is_bookmarked | +---+-++--+-+---+ | 31 | Paul Mantle | 24 | 24 | 2 | 0 | | 31 | Paul Mantle | 24 | 24 | 2 | 1 | | 31 | Paul Mantle | 24 | 24 | 2 | 0 | +---+-++--+-+---+ +---+-++--+-+---+ | player_id | name | hs | coach_id | college | is_bookmarked | +---+-++--+-+---+ | 31 | Paul Mantle | 24 | 24 | 2 | 0 | +---+-++--+-+---+ The row with is_bookmarked = 1 is the only correct one. I am assuming that for some reason, its displaying 3 results because there are 3 id's associated with cid=2. But if I group them by the id, it takes the wrong row: If anyone has any suggestions as to what I'm doing wrong, please let me know as I'm tapped out on ideas. Thanks a TON!! __ Jason Dulberg Extreme MTB http://extreme.nas.net -- 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] Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Send FREE video emails in Yahoo! Mail.
RE: [PHP] IF in mysql query results problem
Thanks for your reply... I thought about making that join however in this case, the coach data is only needed for the player info. Jason. -Original Message- From: Mehmet Kamil ERISEN [mailto:[EMAIL PROTECTED]] Sent: January 7, 2002 1:41 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] IF in mysql query results problem Hi Jason, I am not too familiar with IF statements in SQL, but one thing may be the reason you see the incorrect results: You have three tables, player, coach and co_bookmarks, but you only join player and coach. Shouldn't you join coach with co_bookmarks. I hope this helps. erisen SELECT p.id AS player_id, p.name, p.hs, c.id AS coach_id, co.cid AS college, IF(co.pid=31,1,0) AS is_bookmarked FROM player p, coach c, co_bookmarks co WHERE p.id=31 AND p.hs=c.id AND co.cid=2 Jason Dulberg [EMAIL PROTECTED] wrote: I am working on a program that allows users to bookmark a particular item that they view. The bookmarks are stored in the database. I would like to use an IF statement in the mysql query so when the user logs in and views the items, the option to bookmark the record has been removed if they have already bookmarked it. Here's an example query: SELECT p.id AS player_id, p.name, p.hs, c.id AS coach_id, co.cid AS college, IF(co.pid=31,1,0) AS is_bookmarked FROM player p, coach c, co_bookmarks co WHERE p.id=31 AND p.hs=c.id AND co.cid=2 When I use the above query in a search, it comes up with 3 results, 1 of which is correct. If I GROUP BY p.id, there is only 1 result but its incorrect. The search should only come up with 1 correct result in this case. +---+-++--+-+---+ | player_id | name | hs | coach_id | college | is_bookmarked | +---+-++--+-+---+ | 31 | Paul Mantle | 24 | 24 | 2 | 0 | | 31 | Paul Mantle | 24 | 24 | 2 | 1 | | 31 | Paul Mantle | 24 | 24 | 2 | 0 | +---+-++--+-+---+ +---+-++--+-+---+ | player_id | name | hs | coach_id | college | is_bookmarked | +---+-++--+-+---+ | 31 | Paul Mantle | 24 | 24 | 2 | 0 | +---+-++--+-+---+ The row with is_bookmarked = 1 is the only correct one. I am assuming that for some reason, its displaying 3 results because there are 3 id's associated with cid=2. But if I group them by the id, it takes the wrong row: If anyone has any suggestions as to what I'm doing wrong, please let me know as I'm tapped out on ideas. Thanks a TON!! __ Jason Dulberg Extreme MTB http://extreme.nas.net -- 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] Mehmet Erisen http://www.erisen.com -- Do You Yahoo!? Send FREE video emails in Yahoo! Mail.
[PHP] 2 images, merge, make one transparent
Hi, I've looked here: http://download.php.net/manual/en/function.imagecolortransparent.p hp I've read this: http://www.wdvl.com/Authoring/Languages/PHP/BeginningPHP4/tra nsparent.html But they lose me when they suddenly jump to PNG. I got their code but it doesn't work for me. I have all the libraries, can do just about any image manipulation but this transparency thing has escaped me. Does anyone have a good tutorial on this that doesn't start with jpeg and images they shouldn't use. Peter --- Reality is that which, when you stop believing in it, doesn't go away. -- Philip K. Dick -- 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] distinct element from array
doesn't seem to work for multidimensional array. $yourarray looks like this in my case $yourarray[0] = array() $yourarray[1] = array() //i'm looking for distinct elemtns in the inner array --- Bogdan Stancescu [EMAIL PROTECTED] wrote: $distincts=array(); while (list($key,$val)=each($yourarray) { if (!in_array($val,$distincts)) { $distincts[]=$val; } } Kancha . wrote: An array contains various values eg: list of fruits. Now i want to retrieve only unique fruits from the array. The array may contain duplicate names. How can i achieve this? __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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] __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- 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] no reply-to header?
Hi Martin, I thought that if there's no reply-to, then email clients will use the from as the reply to ?? yes, correct, but the from is the address of the original sender, so when someone hit reply, the email will goes to the original sender only, not to this mailing list. -- Jimmy Be engaged at least six months before you get married -- 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]