[PHP] SQL in Function
Hello, im a newbie in writing functions but right now im trying to. I have made the following function // FUNCTION TO DECIDE WHETHER A PROJECT IS IN BETWEEN PROJECTBEGIN AND PROJECTEND , YES OR NO function Activeyesno($month,$day,$year,$Project_id){ $dayactief = mktime(0, 0, 0, $month, $day, $year); $daytemp = date(Y-m-d, $dayactief); $resultactive = mysql_query(SELECT * FROM EIAProjecten WHERE ((Project_begindatum = '$daytemp' AND Project_id = '$Project_id') OR (Project_einddatum = '$daytemp' AND Project_id = '$Project_id')),$db); $num_rows = mysql_num_rows($resultactive); if ($num_rows == '1'){ return red; } } AND i'm calling this function in an while loop ? echo Activeyesno($month,$day,$year,$Project_id); ? (I translated it into english so maybe some mistakes!) When i try to call the function i get a mysql error every time, even when i make $resultactive (SELECT * FROM EIAProjecten) // NO DATE 1. Is it possible to make a sql connection in my function 2. did i do something wrong? Can somebody help me? Sjoerd Sjoerd van Oosten Digitaal vormgever [EMAIL PROTECTED] Datamex E-sites B.V. http://www.esites.nl Minervum 7368 Telefoon: (076) 5 730 730 4817 ZH BREDA Telefax: (076) 5 877 757 ___ -- 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: header(Location:...) much faster then http-equiv=refresh? too fast?
When I use header(Location: ...) to redirect the user back to the record Send a Header(pragma no-cache) before Header(Location) and it will work. Roko -- 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 code organization...
Ok, this is very important to me, but I'm not sure how to explain it well. I am working on a project using PHP that supports about 6 different browsers and browser versions. All the code is in one single file for now, but I will eventually split the code up and call them using several include files. The problem is that when I start writing the code and it doesn't support a specific browser version, I customize the code with some browser sniffing...for example: table tr td width='100' first column /td ?php if ($browser == ns4) { ? td bgcolor=ff second column /td ?php } elseif ($browser == ns6) { ? // using different field-color for this browser version... td bgcolor='ff' second column /td ?php } else { ? // using different field-color for this browser version... td bgcolor='00ff00' second column /td ?php } ? /tr /table This is not a real-world example, but it works for trying to explain my problem. The code is messy. The sniffing is done earlier and is set by $browser, which holds a value depending on which browser the user is using at the moment they access the page. I want this code to look as normal as html can possibly look, with a less ambiguous tree-like flow, in the following format for example: table tr td width='100' first column /td td bgcolor=some_color second column /td /tr /table How would you guys organize the code to where it makes the best use of whichever browser is being used, but with less messy code? I probably haven't explained it well, but if you have any questions please let me know and I'll be more than happy to answer them. By the way, I'm a newbie at PHP, and so far I think it's the best thing that has ever happened to the web. Thanks in advance. :) Navid -- 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: Need regular match help - possibly
Hello Gaylen, try this: $string = preg_replace(/\n{3,}/, \n\n\n, $string); James Gaylen Fraley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I need a routine that will allow me to trap multiple br and/or line feed characters and convert them to a constant number. As an example, let's say that you have text that has 10 carriage returns and/or line feeds. I want to limit this to 3. So, I need to be able to parse the line to detect the multiple control characters and convert the string to 3. So if the string looked something like: This is \n\n\n\n\n\n\n\n\n\n a test. I would want it converted to This is \n\n\n a test. Conceivably, it could be This is brbrbrbrbr a test. I would want it converted to This is brbrbr a test. I know I could write a do/while loop, but I was wondering if there is a way using eregi_replace or something along that line? Thanks! -- 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] Flash programming
I was under the impression you could only edit flash within proprietary products like flash itself, livemotion especially if the file has already been exported to swf -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 02:32 To: [EMAIL PROTECTED] Subject: [PHP] Flash programming Anyone know how one can import a flash file into PHP for use with ming or something similar? It's an easy to make a flash animation with ming, but I'd like to be able to modify an existing flash file. thnx Martin -- 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] parent:: constructor
Hi, Can anyone point me to a good explanation of how the parent:: constructor works? I've tried searching the php site for it with no success. I've been given a set of code to work on, but am getting the error: Fatal error: Undefined class name 'parent' for one section of it. cheers. James. -- James Stewart http://www.britlinks.co.uk -- 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: parent:: constructor
$parent::constructor()? Just guessing, I wasn't even aware of this functionality till now :) Roko -- 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] GD, PNG
Hi there I try to setup GD and PNG and Zlib to work with my PHP 4.06 but still no sucess can anyone point me out how to do that, or a website that contain step by step instruction in the configure line i used this options --with-gd=/usr/local --with-png-dir=/usr/local/png --with-zlib=/usr/local installing those three items i just used make and make install so everthing must go to /usr/local thanks for the help -- 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] begineer + coolsite
I found this site http://www.Banners4i.com while surfing the net, may be it could be useful to you. It has Free Banner / Link Exchange Server, Counter Server and a WAP Counter Server developed using PHP (may be PHP4, MySQL, WML) If you know of any cool sites developed using PHP pl. let me know. -- Get real solutions to all your problems. http://www.salahkarindia.com - India's first advisory Portal Your friend, advisor, healer,companion!!! Register now to get free advice on all your problems. -- -- 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] Flash programming
Ming comes with a utility called swf2php or something like that, which MAY be able to convert a SWF file to PHP script that you can then work with. I say MAY, because the results are sometimes a bit unpredictable, and certain Flash constructs can cause it to fail miserably. But you might be lucky.. Richy -Original Message- From: Martin Towell [SMTP:[EMAIL PROTECTED]] Sent: 22 November 2001 02:32 To: [EMAIL PROTECTED] Subject:[PHP] Flash programming Anyone know how one can import a flash file into PHP for use with ming or something similar? It's an easy to make a flash animation with ming, but I'd like to be able to modify an existing flash file. thnx Martin -- 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] begineer + coolsite
I found this site http://www.Banners4i.com while surfing the net, may be it could be useful to you. It has Free Banner / Link Exchange Server, Counter Server and a WAP Counter Server developed using PHP (may be PHP4, MySQL, WML) If you know of any cool sites developed using PHP pl. let me know. -- Get real solutions to all your problems. http://www.salahkarindia.com - India's first advisory Portal Your friend, advisor, healer,companion!!! Register now to get free advice on all your problems. -- -- 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: Need regular match help - possibly
Thinking about it, this would probably be even better: $string = preg_replace(/(\n|br){3,}/i, \\1\\1\\1, $string); This: $string = This is a \n\n\n\n\n\n\n\n\n\n\ntest\nTesting\nTesting\n\n123brbrbrbrbrbr brbrbrbrbrSome more testingbrbrbrbrbrbrbrbrbrAnd a little morebrbrbrbrbrbrbrbrbrbrbrbrbrbrbrbrbrbr brbrbrbrbrbrbrbrbrbrbrbrbrbrEven more.; Then outputs as this: This is a br / br / br / testbr / Testingbr / Testingbr / br / 123brbrbrSome more testingbrbrbrAnd a little morebrbrbrEven more. when echo'd with nl2br() As a side note, does anyone know what's with the br tag changing to br /? That's the way I've always used the line break tag for wml pages, but hadn't realised that it's being written that way for standard html now. Is this a change in spec? James Liljim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello Gaylen, try this: $string = preg_replace(/\n{3,}/, \n\n\n, $string); James Gaylen Fraley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I need a routine that will allow me to trap multiple br and/or line feed characters and convert them to a constant number. As an example, let's say that you have text that has 10 carriage returns and/or line feeds. I want to limit this to 3. So, I need to be able to parse the line to detect the multiple control characters and convert the string to 3. So if the string looked something like: This is \n\n\n\n\n\n\n\n\n\n a test. I would want it converted to This is \n\n\n a test. Conceivably, it could be This is brbrbrbrbr a test. I would want it converted to This is brbrbr a test. I know I could write a do/while loop, but I was wondering if there is a way using eregi_replace or something along that line? Thanks! -- 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] Cannot add header information...
Need some help here, Im getting this error: Warning: Cannot add header information - headers already sent by (output started at /home/p/pe/perphp/public_html/login.php:4) in /home/p/pe/perphp/public_html/login.php on line 44 ...while trying to run the following .PHP code on my server. Any ideas why this doesnt work? (Im trying to setup user authentication and found this on the Webmonkey site) All tips are appreciated!! HTMLHEADTITLEdummy/TITLE/HEAD BODY ?php // File Name: auth02.php // Check to see if $PHP_AUTH_USER already contains info if (!isset($PHP_AUTH_USER)) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != admin) || ($PHP_AUTH_PW != abc123)) { header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else { echo PYou're authorized!/p ; } } ? /BODY /HTML -- 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: parent:: constructor
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Roko Roic) wrote: $parent::constructor()? Just guessing, I wasn't even aware of this functionality till now :) Is this what you're looking for? http://www.php.net/manual/en/keyword.parent.php -- CC -- 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] Cannot add header information...
Per, Its a hard rule but you cannot sent any HTML content before the header. Try reversing the order and see if that works. George (a newbie, trying to find time to learn more) - Original Message - From: Per Waagen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 10:19 AM Subject: [PHP] Cannot add header information... Need some help here, Im getting this error: Warning: Cannot add header information - headers already sent by (output started at /home/p/pe/perphp/public_html/login.php:4) in /home/p/pe/perphp/public_html/login.php on line 44 ...while trying to run the following .PHP code on my server. Any ideas why this doesnt work? (Im trying to setup user authentication and found this on the Webmonkey site) All tips are appreciated!! HTMLHEADTITLEdummy/TITLE/HEAD BODY ?php // File Name: auth02.php // Check to see if $PHP_AUTH_USER already contains info if (!isset($PHP_AUTH_USER)) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != admin) || ($PHP_AUTH_PW != abc123)) { header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else { echo PYou're authorized!/p ; } } ? /BODY /HTML -- 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!? Get your free @yahoo.com address at http://mail.yahoo.com -- 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 code organization...
Try to break up html into different files for each browser type. Switch ($browser) { case ns4 : include ns4.html; break; case ie5 : include ie5.html; break; . . . default : include ie6.html; } -Original Message- From: Navid Yar [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 10:19 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP code organization... Importance: High Ok, this is very important to me, but I'm not sure how to explain it well. I am working on a project using PHP that supports about 6 different browsers and browser versions. All the code is in one single file for now, but I will eventually split the code up and call them using several include files. The problem is that when I start writing the code and it doesn't support a specific browser version, I customize the code with some browser sniffing...for example: table tr td width='100' first column /td ?php if ($browser == ns4) { ? td bgcolor=ff second column /td ?php } elseif ($browser == ns6) { ? // using different field-color for this browser version... td bgcolor='ff' second column /td ?php } else { ? // using different field-color for this browser version... td bgcolor='00ff00' second column /td ?php } ? /tr /table This is not a real-world example, but it works for trying to explain my problem. The code is messy. The sniffing is done earlier and is set by $browser, which holds a value depending on which browser the user is using at the moment they access the page. I want this code to look as normal as html can possibly look, with a less ambiguous tree-like flow, in the following format for example: table tr td width='100' first column /td td bgcolor=some_color second column /td /tr /table How would you guys organize the code to where it makes the best use of whichever browser is being used, but with less messy code? I probably haven't explained it well, but if you have any questions please let me know and I'll be more than happy to answer them. By the way, I'm a newbie at PHP, and so far I think it's the best thing that has ever happened to the web. Thanks in advance. :) Navid -- 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] Cannot add header information...
You've already sent something to the browser... the line that starts with HTMLHEAD... Move that below the authentication code and all should be well. HTH Jon -Original Message- From: Per Waagen [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 10:20 To: [EMAIL PROTECTED] Subject: [PHP] Cannot add header information... Need some help here, Im getting this error: Warning: Cannot add header information - headers already sent by (output started at /home/p/pe/perphp/public_html/login.php:4) in /home/p/pe/perphp/public_html/login.php on line 44 ...while trying to run the following .PHP code on my server. Any ideas why this doesnt work? (Im trying to setup user authentication and found this on the Webmonkey site) All tips are appreciated!! ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- 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] Cannot add header information...
output started at /home/p/pe/perphp/public_html/login.php:4 try to look into this line 'cause is where the output started. The HTTP Header comes before every HTML code because it's where the browser will know what kind of file it is (for example... it is a image, open it! it is HTML, show it! it is a zip file, download it!), sends also the file size, date, etc etc.. so, every header() call must be before any ' echo ' , 'print' etc .. hope u understood ... i am taking english classes to improve my speech :P - Original Message - From: Jon Haworth [EMAIL PROTECTED] To: 'Per Waagen' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 8:26 AM Subject: RE: [PHP] Cannot add header information... You've already sent something to the browser... the line that starts with HTMLHEAD... Move that below the authentication code and all should be well. HTH Jon -Original Message- From: Per Waagen [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 10:20 To: [EMAIL PROTECTED] Subject: [PHP] Cannot add header information... Need some help here, Im getting this error: Warning: Cannot add header information - headers already sent by (output started at /home/p/pe/perphp/public_html/login.php:4) in /home/p/pe/perphp/public_html/login.php on line 44 ...while trying to run the following .PHP code on my server. Any ideas why this doesnt work? (Im trying to setup user authentication and found this on the Webmonkey site) All tips are appreciated!! ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- 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 Digest 22 Nov 2001 11:16:44 -0000 Issue 1009
php-general Digest 22 Nov 2001 11:16:44 - Issue 1009 Topics (messages 75456 through 75496): Re: Deleting from MySQL with more than one 'where' variable? 75456 by: Mike Eheler Re: Different syntax = different performance (concatenating assignment) 75457 by: Martin Towell Re: array_merge(); 75458 by: Edgardo Rossetto Re: AddType x-httpd-php to Root Dir ...Solution 75459 by: Jeff Hill 75460 by: Fred How to run php files on windows millenium? 75461 by: Joelmon2001.aol.com 75463 by: T B PHP Arrays conflicting with Javascript, PLease advise?!? 75462 by: Steve Maroney 75466 by: Martin Towell Flash programming 75464 by: Martin Towell 75474 by: John Monfort 75483 by: Caspar Kennerdale 75488 by: Richard Black Need a job done 75465 by: Marts mail smtp class file 75467 by: Michael P. Carel 75473 by: Michael P. Carel Need regular match help - possibly 75468 by: Gaylen Fraley 75469 by: Martin Towell 75482 by: liljim 75490 by: liljim reseting cookie_lifetime 75470 by: Justin England Re: php- cgi 75471 by: Michael Sims Re: Authentication Options: Was AddType x-httpd-php ... 75472 by: Jeff Hill 75477 by: Fred header(Location:...) much faster then http-equiv=refresh? too fast? 75475 by: Avi Schwartz 75478 by: Fred 75480 by: Roko Roic Re: Installing PHP with windows 75476 by: Nicolas Guilhot SQL in Function 75479 by: Oosten, Sjoerd van PHP code organization... 75481 by: Navid Yar 75494 by: Dimitris Kossikidis parent:: constructor 75484 by: James Stewart 75485 by: Roko Roic 75492 by: CC Zona GD, PNG 75486 by: Yamin Prabudy begineer + coolsite 75487 by: Carry Ian 75489 by: Carry Ian Cannot add header information... 75491 by: Per Waagen 75493 by: George Pitcher 75495 by: Jon Haworth 75496 by: Daniel Roperto - Ação Direta 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--- Are you getting an error, or is it simply not deleting the fields that should match that criteria? Mike cosmin laslau wrote: Ok, there's a table with 4 fields, I want to delete from it when two of the variables passed (through the function below) match up with the table's contents. However, I have only been able to get it to work with one 'where' clause, not two. Here's my code for one: function delete_one_sub($sel, $field, $update) { $query = delete from usr_stats where sel='$sel'; $result = mysql_db_query(f6, $query); } This was code for two variables: function delete_one_sub($sel, $field, $update) { $query = delete from usr_stats where sel='$sel' and spec='$field'; $result = mysql_db_query(f6, $query); } However, that doesn't work. Help? Thanks. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp ---End Message--- ---BeginMessage--- I don't know if this happens in PHP, but this is similar to C's add one to variable. ie. You have three ways of adding one to a variable 1) a = a + 1 2) a += 1 3) a++ or ++a from what I was told, 1) is slower than 2) which is slower than 3). So it would seem that this is the same sort of thing for strings in PHP. Martin -Original Message- From: George Whiffen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 21, 2001 11:39 PM To: [EMAIL PROTECTED] Subject: [PHP] Different syntax = different performance (concatenating assignment) Dear All, I had always thought of concatenating assignment and concatenation + assignment to the same variable as really just syntatical variations i.e. I thought that $data = $data . some strings; and $data .= some strings; were just alternate syntaxes for the same operation. I've always tended to use the long format on the grounds that it was more readable and maintainable. How wrong I was! It seems the performance on big strings can be hugely different. I think I know why but I'd appreciate confirmation. I came across this when investigating a performance issue with writing out a gz-encoded csv file from an SQL table. The code is something like: $data = ''; while ($row_product = mysql_fetch_array($cur_product)) { $data = $data . ''.str_pad(strip_tags(strtr($row_product[product_code],'\',',' ')),40) .','.str_pad(strip_tags(strtr($row_product[product_name],'\',',' ')),60) .','.str_pad(strip_tags(strtr($row_product[product_desc],'\',',' ')),120) .''.\r\n; } $Size = strlen($data); $Crc = crc32($data);
[PHP] about the replacing HTML code by another codes in a Forum ?
hi, can anyone help me this ? 1) I made a simple forum, and it will allow the users to send their messages in HTML format. But I worried about the security of my website, so I removed all of the SCRIPT tags in their messages by placing /SCRIPT instead. (Because the users maybe use SCRIPT language=JavaScript, so I cannot replace SCRIPT exactly) Is it the best solution to protect my pages from malicious code ? (is it secure for my pages ?) Are there other ways that someone can use malicious codes in their messages without SCRIPT ? 2) In the case I do not allow the users send messages in HTML codes, I replaced (similar with phpBB code) : [a]=a href= [/a]= [//a]=/a example the content of message is : [a]www.microsoft.com[/a]Click here...[//a] ...will place a link to Microsoft.com, but the problems will happen when the users use only [a], or [/a], not use [//a] to close the link. Can anyone help me to fix this problem ? (is there another way to do this more simple ?) thanks very much... -- 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] Cool?
Well, my site about Talking Heads is kinda cool, and I'm using PHP in it, more and more everyday. Soon it'll let visitors add their own comments to the pages, just like the anotated PHP manual: http://thismustbetheplace.net Jaime From: Carry Ian [EMAIL PROTECTED] To: [EMAIL PROTECTED] Mime-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Subject: begineer + coolsite I found this site http://www.Banners4i.com while surfing the net, may be it could be useful to you. It has Free Banner / Link Exchange Server, Counter Server and a WAP Counter Server developed using PHP (may be PHP4, MySQL, WML) If you know of any cool sites developed using PHP pl. let me know. -- Get real solutions to all your problems. http://www.salahkarindia.com - India's first advisory Portal Your friend, advisor, healer,companion!!! Register now to get free advice on all your problems. -- -- 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: about the replacing HTML code by another codes in a Forum ?
Hiya, well, you could replace all script tags with this regex: $string = preg_replace(/\/?SCRIPT.*?/is, , $string); But, if you're converting all and to their html equivelants (which you should be) using something like htmlspecialchars or your own regex, you shouldn't even need to do that. You might also want to think about strip_tags(), though again, I prefer just to convert the characters and not worry about it. as for your links, I'd rethink the user input and use something like [a=www.microsoft.com]Click[/a] ; // quick and dirty regex $string = preg_replace(/\[a=(.+?)\](.*?)\[\/a\]/is, a href=\\\1\ target=\_blank\\\2/a, $string); James Trongduc [EMAIL PROTECTED] wrote in message 001101c17341$b6de6060$1d0b10ac@d">news:001101c17341$b6de6060$1d0b10ac@d... hi, can anyone help me this ? 1) I made a simple forum, and it will allow the users to send their messages in HTML format. But I worried about the security of my website, so I removed all of the SCRIPT tags in their messages by placing /SCRIPT instead. (Because the users maybe use SCRIPT language=JavaScript, so I cannot replace SCRIPT exactly) Is it the best solution to protect my pages from malicious code ? (is it secure for my pages ?) Are there other ways that someone can use malicious codes in their messages without SCRIPT ? 2) In the case I do not allow the users send messages in HTML codes, I replaced (similar with phpBB code) : [a]=a href= [/a]= [//a]=/a example the content of message is : [a]www.microsoft.com[/a]Click here...[//a] ...will place a link to Microsoft.com, but the problems will happen when the users use only [a], or [/a], not use [//a] to close the link. Can anyone help me to fix this problem ? (is there another way to do this more simple ?) thanks very much... -- 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] Send an e-mail witdh php
Hello, I want to send an e-mail to one address(To) and many carbon copies to many e-mailadresses(BCC). Is there a class to do this?? Henk -- 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] Send an e-mail witdh php
Hello, I want to send an e-mail to one address(To) and many carbon copies to many e-mailadresses(BCC). Is there a class to do this?? Henk Hi Henk, You don't need a special class, just use: $to = [EMAIL PROTECTED]; $subject = Your Subject; $messages = some text you want to send...; $headers = CC: firstname[EMAIL PROTECTED], [EMAIL PROTECTED],; $headers .= [EMAIL PROTECTED]\n; $headers .= From: Your name[EMAIL PROTECTED]\n; mail ($to, $subject, $message , $headers); Best, Sebastian -- 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: Need regular match help - possibly
Thanks. According to the manual, the br / is for XHTML compliance. This changed in 4.0.5. -- Gaylen [EMAIL PROTECTED] Home http://www.gaylenandmargie.com PHP KISGB v2.3 Guestbook http://www.gaylenandmargie.com/phpwebsite Liljim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Thinking about it, this would probably be even better: $string = preg_replace(/(\n|br){3,}/i, \\1\\1\\1, $string); This: $string = This is a \n\n\n\n\n\n\n\n\n\n\ntest\nTesting\nTesting\n\n123brbrbrbrbrbr brbrbrbrbrSome more testingbrbrbrbrbrbrbrbrbrAnd a little morebrbrbrbrbrbrbrbrbrbrbrbrbrbrbrbrbrbr brbrbrbrbrbrbrbrbrbrbrbrbrbrEven more.; Then outputs as this: This is a br / br / br / testbr / Testingbr / Testingbr / br / 123brbrbrSome more testingbrbrbrAnd a little morebrbrbrEven more. when echo'd with nl2br() As a side note, does anyone know what's with the br tag changing to br /? That's the way I've always used the line break tag for wml pages, but hadn't realised that it's being written that way for standard html now. Is this a change in spec? James Liljim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello Gaylen, try this: $string = preg_replace(/\n{3,}/, \n\n\n, $string); James Gaylen Fraley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I need a routine that will allow me to trap multiple br and/or line feed characters and convert them to a constant number. As an example, let's say that you have text that has 10 carriage returns and/or line feeds. I want to limit this to 3. So, I need to be able to parse the line to detect the multiple control characters and convert the string to 3. So if the string looked something like: This is \n\n\n\n\n\n\n\n\n\n a test. I would want it converted to This is \n\n\n a test. Conceivably, it could be This is brbrbrbrbr a test. I would want it converted to This is brbrbr a test. I know I could write a do/while loop, but I was wondering if there is a way using eregi_replace or something along that line? Thanks! -- 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] Send an e-mail witdh php
That doesn't work. He is gives the error: Failed to Connect Henk Sebastian Wenleder [EMAIL PROTECTED] wrote in message news:p0510030ab822a385d74e@[192.168.100.2]... Hello, I want to send an e-mail to one address(To) and many carbon copies to many e-mailadresses(BCC). Is there a class to do this?? Henk Hi Henk, You don't need a special class, just use: $to = [EMAIL PROTECTED]; $subject = Your Subject; $messages = some text you want to send...; $headers = CC: firstname[EMAIL PROTECTED], [EMAIL PROTECTED],; $headers .= [EMAIL PROTECTED]\n; $headers .= From: Your name[EMAIL PROTECTED]\n; mail ($to, $subject, $message , $headers); Best, Sebastian -- 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] Send an e-mail witdh php
-Original Message- From: Henk [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 22, 2001 3:21 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Send an e-mail witdh php That doesn't work. He is gives the error: Failed to Connect Henk check your /etc/php.ini conf 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]
Re: [PHP] Cannot add header information... SOLUTION
Thank you Jon folks, now its OK! ;) Per You've already sent something to the browser... the line that starts with HTMLHEAD... Move that below the authentication code and all should be well. HTH Jon -Original Message- From: Per Waagen [mailto:[EMAIL PROTECTED]] Sent: 22 November 2001 10:20 To: [EMAIL PROTECTED] Subject: [PHP] Cannot add header information... Need some help here, Im getting this error: Warning: Cannot add header information - headers already sent by (output started at /home/p/pe/perphp/public_html/login.php:4) in /home/p/pe/perphp/public_html/login.php on line 44 ...while trying to run the following .PHP code on my server. Any ideas why this doesnt work? (Im trying to setup user authentication and found this on the Webmonkey site) All tips are appreciated!! ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- 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] Memory upload question..
do you have a tip to upload big files without the hassle of having php crunch so much memory? If I upload, say, 20 MB of data, my script process will end up using 20 MB of memory. I think it stores all received data in memory and then flushes it in the temp file at the end. 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] Send an e-mail witdh php
Also, If you have an array of addresses, use the implode() function. $sAddressList = implode(',', $aAddressArray); and then use that with the Bcc: header in the mail function. -Jason Garber IonZoft.com Hi Henk, You don't need a special class, just use: $to = [EMAIL PROTECTED]; $subject = Your Subject; $messages = some text you want to send...; $headers = CC: firstname[EMAIL PROTECTED], [EMAIL PROTECTED],; $headers .= [EMAIL PROTECTED]\n; $headers .= From: Your name[EMAIL PROTECTED]\n; mail ($to, $subject, $message , $headers); Best, Sebastian At 01:50 PM 11/22/2001 +0100, Sebastian Wenleder wrote: Hello, I want to send an e-mail to one address(To) and many carbon copies to many e-mailadresses(BCC). Is there a class to do this?? Henk -- 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] redirect
hi I 'm newbie with php and i have a small problem. I have a script that uploads 4 pictures But when that is done there has to be a redirect to an other page. My script is as follows: ?php header(Location: http://www.x.com/x.html;); $num=$nummer; if(count($FILE) == 0 || $FILE[1] == none) { #print(File(s) not uploaded.); }else{ #print(span class=\tekst\); # Loop through the uploaded files foreach($FILE as $key = $value) { if($value != none) { if($saveto == disk) { $mtest = $test; $destpath = sprintf(/home/users/A000456/x.be/upload/%s%s,$num,$FILE_name[$key]); copy($value,$destpath); $conn = mysql_connect(213.239.56.153:3306,U045601D,kvch97); #echo Fout : .mysql_errno(). : .mysql_error().BR; mysql_select_db(D045601D,$conn); #echo Fout : .mysql_errno(). : .mysql_error().BR; $msql = sprintf(insert into upload (filename, filesize, contenttype, indexnr, nummer) values('%s%s','%s','%s','%s','%s'),$num,$FILE_name[$key],$FILE_size[$key],$FILE_type[$key],$num,$test); #printf(%sbr,$msql); $rs = mysql_query($msql,$conn); #echo Fout : .mysql_errno(). : .mysql_error().BR; $num=$num+1; } } } #print(/span); mysql_close($conn); } ? but i keep getting the folowing error: Warning: Cannot add header information - headers already sent by (output started at /home/users/A000456/x.be/upload.php:1) in /home/users/A000456/x.be/upload.php on line 2 Etienne Colla
[PHP] Re: redirect
Make sure that you have no blank spaces before the ?php tag. It really must be the first line in the script. /Fredrik Etienne Colla [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hi I 'm newbie with php and i have a small problem. I have a script that uploads 4 pictures But when that is done there has to be a redirect to an other page. but i keep getting the folowing error: Warning: Cannot add header information - headers already sent by (output started at /home/users/A000456/x.be/upload.php:1) in /home/users/A000456/x.be/upload.php on line 2 -- 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] possible problems working with sessions
well, if you're using default session handling provided with php, users sessions are stored in /tmp directory (also used by default for temporary caching of uploaded files). assume to have the php.ini file with default settings: session.gc_probability = 1 session.gc_maxlifetime = 1440 this means garbage collector lauched 1 times every 100 started sessions. furthermore, deletable sessions are those ones opened 1440 seconds ago (24 minutes). well, i've doing some tries asking web server the following by wget command, (but i suppose you can use also a sockopen or CURL (!) functions...): HEAD /test_session.php HTTP/1.0 where /test_session.php simply starts a session with session_start() function. every single request create a session file in the /tmp server directory. if someone find out how to do many simultanious requests could create so many files in the /tmp dir (while the garbage clean them only after 24 minutes). we know that linux filesystem is limited to 64K files per directory. this could create problems... obviously there are some kind of solutions... - play with session.gc_* php settings in order to prevent problems (but i can't be sure that's a good idea...) - provide a different session storage than the default one. in this case, you have only two other solutions: mm and database storage. i prefer to store sessions in a database, because with mm this could generate worse problems with memory usage... but i mean... there are so many php developers that uses php with default settings (for example: newbies that uses phpnuke or other php content manager session based)... about sessions i've found: http://www.phpwizard.net/resources/tutorials/session_intro.html seen Tobias around? :-) bye, alberto. ps: well, i work with session since not long time, so can be i made a mistake... -- 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] error handling and __LINE__
Hi, I wonder if there's a way to find the line number of the calling script from a function, like the error messages PHP generates. An example: In an included file I have a function and want to do something similar to: function foo($obj) { if (!is_object($obj)) { echo Error: supplied argument is not an object in ; echo __FILE__ . line . __LINE__; } ... } But __FILE__ and __LINE__ refers to the current file, ie. the file with the function in, and not the file where the function is called from. The first one I can solve by using $SCRIPT_NAME, but what about the line number??? -- 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] POP commands
Hi, does anybogy know pop3 box management commands? I'm making pop client on php. I know some of the commands like USER PASS RETR DELE TOP but don't know how to use them. I have fputs( $socket_open, USER . $username . \r\n ); but how do I use RETR or TOP or DELE in these circumstanses? Youri God is our provider http://www.body-builders.org -- 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] POP commands
Why don't u use a socket view ? u config ur outlook to connect 127.0.0.1 (localhost) and watch the communication .. if someone wants it send mail to [EMAIL PROTECTED] then i cansend one that i designed on delphi 5 (it's ugly and has FEW options and not tested with binary comm., but works with text) well, try this: start - execute - telnet yourpophost.com 110 « +OK connected » USER yourusername « +OK accepted, send password » PASS thecode « +OK xxx messages » LIST « +OK « 1 1233 « 2 5940 « 3 5421 « . where the 1st is the message number, the secont the bytes (size) of the message. The 'DOT ' means END OF LIST » RETR 1 « +OK « [... the message ...] « . the dot means end of message » QUIT « +OK goodbye Hope u understood my english and the basic commands! Daniel Roperto - Original Message - From: Yura [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 1:30 PM Subject: [PHP] POP commands Hi, does anybogy know pop3 box management commands? I'm making pop client on php. I know some of the commands like USER PASS RETR DELE TOP but don't know how to use them. I have fputs( $socket_open, USER . $username . \r\n ); but how do I use RETR or TOP or DELE in these circumstanses? Youri God is our provider http://www.body-builders.org -- 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] What does var mean ?
Hi I've been looking at some classes an have come across this notation for example : function remove($productid) { /* this function will remove a given product from the cart */ if (isset($productid)) { unset($this-items[$productid]); } } What does the (ampersand) before the variable name mean ? Thanks Girish -- 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] mail client
Hi I wrote a kind of web mail client. But I've got a problem. When the function imap_header fetches all of the headers from a mailbox in a loop, it lasts very long time, if a user has big files attached to his mails. I operate at pop3 server. What's the problem? Do you know, how to list all of the messages headers not in 10 minutes? kakol -- 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] What does var mean ?
Thanks, you guys rock! :) Girish - Original Message - From: Roberto Ramírez [EMAIL PROTECTED] To: Girish Nath [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 4:10 PM Subject: RE: [PHP] What does var mean ? The use of the means that its passed by reference. That its equal to the memory address of where the variable is stored $variable its often used to modify the value of a that variable within a function. for example: ?php $variable = 3; echo $variable; #will print 3 function checkit($x){ $x = 5; #this will modify the value of $variable. } checkit($variable); echo $variable; #will print 5 ? PROSSES, Roberto Ramírez. Tel-Fax. 8115 3197 y 99 Puerto No. 3425 Col. Riberas del Río CP. 67160 Guadalupe, Nuevo León. México. Visítanos aquí:http://www.prosses.com http://www.prosses.com Correo electrónico: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -Mensaje original- De: Girish Nath [mailto:[EMAIL PROTECTED]] Enviado el: Jueves, 22 de Noviembre de 2001 09:43 a.m. Para: [EMAIL PROTECTED] Asunto: [PHP] What does var mean ? Hi I've been looking at some classes an have come across this notation for example : function remove($productid) { /* this function will remove a given product from the cart */ if (isset($productid)) { unset($this-items[$productid]); } } What does the (ampersand) before the variable name mean ? Thanks Girish -- 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]
Tr: [PHP] What does var mean ?
- Original Message - From: Nayco_IUT Laroche [EMAIL PROTECTED] To: Girish Nath [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 4:59 PM Subject: Re: [PHP] What does var mean ? This is a reference to the variable, that means that it extends the scope of this variable into the function, ie, you can modify this variable inside the function ... OK, OK, my english is bad so maybe you didn't understand anything Well, I tried ;~) !!! In fact, var is THE ADDRESS of var - Original Message - From: Girish Nath [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 4:43 PM Subject: [PHP] What does var mean ? Hi I've been looking at some classes an have come across this notation for example : function remove($productid) { /* this function will remove a given product from the cart */ if (isset($productid)) { unset($this-items[$productid]); } } What does the (ampersand) before the variable name mean ? Thanks Girish -- 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] Yet Another Mysql Problem
Hi again, I've run into a nice bug using phpmyadmin to import data into a mysql database, and was hoping someone had some experience with doing this. I was wondering if there is any common errors which could be occurring due to characters with in the data? I'm fairly certain that this is the case as I can import about 5 lines of the database in mysql through phpmyadmin, and these don't have many odd characters in them, but anymore and it turns around and gives me an error, any ideas? Steve.
Re: [PHP] Yet Another Mysql Problem
Well telling us what the errors are would be a start :-) Regards Jon -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send email with subject: Send PGP Key - Original Message - From: Stephen Phillips [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 5:16 PM Subject: [PHP] Yet Another Mysql Problem Hi again, I've run into a nice bug using phpmyadmin to import data into a mysql database, and was hoping someone had some experience with doing this. I was wondering if there is any common errors which could be occurring due to characters with in the data? I'm fairly certain that this is the case as I can import about 5 lines of the database in mysql through phpmyadmin, and these don't have many odd characters in them, but anymore and it turns around and gives me an error, any ideas? Steve. -- 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] Yet Another Mysql Problem
lol, ok (sorry I've been staring at a text file looking for bugs for 3 hours) this is the type of error msg phpmyadmin is giving me; Warning: Only 0 bytes were written, expected to write 32516 in - on line 82 sometimes it says line 74, or 130 as well I was kinda hoping someone might know of some common things which might trip up mysql or php in a string, since this is my best guess as to the reason for the error. Steve.
[PHP] Re: POP commands
Read the RFC for POP3. http://www.hio.hen.nl/cgi-bin/show-gz/rfc/pop/rfc1725.txt.gz Fred Yura [EMAIL PROTECTED] wrote in message 3BFD3620.32115.1873696@localhost">news:3BFD3620.32115.1873696@localhost... Hi, does anybogy know pop3 box management commands? I'm making pop client on php. I know some of the commands like USER PASS RETR DELE TOP but don't know how to use them. I have fputs( $socket_open, USER . $username . \r\n ); but how do I use RETR or TOP or DELE in these circumstanses? Youri God is our provider http://www.body-builders.org -- 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: What does var mean ?
It indicates that the variable was passed by reference rather than by value. Fred Girish Nath [EMAIL PROTECTED] wrote in message 000f01c1736c$714abc30$015b10ac@AERIS">news:000f01c1736c$714abc30$015b10ac@AERIS... Hi I've been looking at some classes an have come across this notation for example : function remove($productid) { /* this function will remove a given product from the cart */ if (isset($productid)) { unset($this-items[$productid]); } } What does the (ampersand) before the variable name mean ? Thanks Girish -- 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] Yet Another Mysql Problem
I've been using phpmyadmin 2.2.1 and found that importing data from a script requires you to be at the main page for the database, rather than the table page. Submitting it via the table page says it was executed successfully, but it wasn't. Haven't had time to look at whats causing it. I had a strange one today, where it gave me all sorts of errors about not having a valid db_link. Couldn't reproduce it though. -Original Message- From: Stephen Phillips [SMTP:[EMAIL PROTECTED]] Sent: 22 November 2001 17:16 To: [EMAIL PROTECTED] Subject:[PHP] Yet Another Mysql Problem File: ATT6.txt; charset = Windows-1252 -- 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: Yet Another Mysql Problem
Please post a verbatim copy of the error. We have no way of knowing what is happening with such a generic description of the problem. Fred Stephen Phillips [EMAIL PROTECTED] wrote in message 000e01c17379$643f6d80$21937ad5@stevephillips">news:000e01c17379$643f6d80$21937ad5@stevephillips... Hi again, I've run into a nice bug using phpmyadmin to import data into a mysql database, and was hoping someone had some experience with doing this. I was wondering if there is any common errors which could be occurring due to characters with in the data? I'm fairly certain that this is the case as I can import about 5 lines of the database in mysql through phpmyadmin, and these don't have many odd characters in them, but anymore and it turns around and gives me an error, any ideas? Steve. -- 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 load .php3 pages using PHP4
Hi all, I'm using PHP version 4 (module) with no problems in a Debian box, but today I download PHPlib; I installed as the README file told me, but all the files have the extension php3, and when I try to open with my browser I it tell me to save the file to disc. I uncomment the next line in srm.conf: AddType application/x-httpd-php3 .php3 and restart apache without luck. I don't want to downgrade to PHP3, so is there a way of solve this using PHP4? Thanks for your help. -- Mauricio Téllez Jiménez Seguimiento Técnico EDUMEXICO [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Zamora No. 25, Col. Centro C.P. 91000, Xalapa, Ver. Tel. 52(28)17-86-87, 17-73-80 Fax. 52(28)18-64-13 msg40899/pgp0.pgp Description: PGP signature
Re: [PHP] How to load .php3 pages using PHP4
Comment that line again, and add .php3 to: AddType application/x-httpd-php .php .php3 This will tell apache to use PHP4 for both .php and .php3 files. Justin England [EMAIL PROTECTED] Network Administrator E-Net Information Services http://www.enetis.net Tel: 605-341-3638 Fax: 605-341-8880 On Thu, 22 Nov 2001, EDUMEXICO wrote: Hi all, I'm using PHP version 4 (module) with no problems in a Debian box, but today I download PHPlib; I installed as the README file told me, but all the files have the extension php3, and when I try to open with my browser I it tell me to save the file to disc. I uncomment the next line in srm.conf: AddType application/x-httpd-php3 .php3 and restart apache without luck. I don't want to downgrade to PHP3, so is there a way of solve this using PHP4? Thanks for your help. -- Mauricio Téllez Jiménez Seguimiento Técnico EDUMEXICO [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Zamora No. 25, Col. Centro C.P. 91000, Xalapa, Ver. Tel. 52(28)17-86-87, 17-73-80 Fax. 52(28)18-64-13 -- 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 the best version PHP + APACHE on Solaris8
Dir Justin England, Could you tell me what the version of apache and php do you prefer for Solaris 8 . thanks -- 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] What does var mean ?
Bas Jobsen wrote: What does the (ampersand) before the variable name mean ? a pointer to the address (mem) of the variable PHP doesn't have pointers and memory can't be directly accessed this way like you can in C, or C++ or whatever. The ampersand is for passing values via reference rather than value. PHP has no notion of pointers. J -- 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 do I convert from perl to php? - Reality Check Taxation
Ok, Let's concentrate on acceptable syntaxes for your html programmers to specify the required fields first. Here are some options grouped by technique and roughly put into order of increasing difficulty for an html author: HTML 1. INPUT TYPE=HIDDEN NAME=required VALUE=name address phone PHP FUNCTION 2. required(name,phone,address); 3. required($name,$phone,$address); PHP ASSIGNMENT -- 4. $required = 'name address phone'; 5. $required = 'name,address,phone'; 6. $required = array($name,$address,$phone); COMPLETE INLINE PHP CODE 7. Rasmums solution (slightly modified): if (!(1==1 isset($name) isset($address) isset($phone) )){print 'You left one empty.';} It's really up to you to say which of these is most acceptable to your html guys. The order also roughly corresponds to decreasing amounts of php code and support required. Here's the supporting code for each: 1. INPUT TYPE=HIDDEN NAME=required VALUE=name address phone --- foreach(explode(' ',$required)) as $field) { if (${$field) == '') { print 'You left one empty.'; break; } } 2. required(name,phone,address); function required() { foreach(func_get_args() as $field) { global ${$field}; if (${$field} == '') { print 'You left one empty.'; return; } } } 3. required($name,$phone,$address); --- function required() { foreach(func_get_args() as $field) { if ($field == '') { print 'You left one empty.'; return; } } } 4. $required = 'name address phone'; foreach(explode(' ',$required) as $field) { if (${$field} == '') { print 'You left one empty.'; break; } } 5. $required = 'name,address,phone'; foreach(explode(',',$required) as $field) { if (${$field} == '') { print 'You left one empty.'; break; } } 6. $required = array($name $address $phone); foreach(explode(' ',$required) as $field) { if (${$field} == '') { print 'You left one empty.'; return; } } 7. Rasmus Solution -- Already complete! The closest to your original is 4., and it is pretty close. However, if your html guys are really so allergic to code I would have thought that 1. would suit them best. The great benefit of 7., is that your html guys would learn something useful that they could apply elsewhere rather than a special rule on where to put required fields when they're working with you on a particular kind of job. For the record I typically have a completely different approach to the whole problem i.e. A. I would have field-specific (onChange) and form-wide (onSubmit) Javascript validation on the form page itself as a courtesy to the browser users and to save them unnecessary page loads. B. In the php, the checks would be repeated explicitly for users without Javascript or non-browser users and would include an unique identifier so that the form could be intelligently driven remotely by another application e.g. if ($name == '') { $errormessage .= error:myform:0100 name is a required field.br; } if ($address == '') if ($errormessage != '') { print 'Please correct the following errors -br'.$errormessage; etc. C. The data would almost certainly have ended up in a database even if it is being mailed on or whatever. So the question of non-programming html designers adding required fields would not arise. I can't think of much data that I might trouble a user to enter that isn't worth explicitly storing. But then I guess we work on different kinds of applications. It sounds like you can't afford more than a couple of minutes per form while I have the luxury of half an hour or so. Good luck, George Brandon Lamb wrote: The point of keeping it easier is what if i want to give my script to a friend, do you REALLY want to explain to a non-programmer how to add another if statement or condition when they could simply add the field to the array? And actually you only have to change the name in 2 places. 1. you define the variable as an input from a form 2. in the required fields array - Original Message - From: George Whiffen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 21, 2001 7:28 AM Subject: Re: [PHP] How do I convert from perl to php? - Reality Check Taxation So I would have to write a seperate if condition for each form input field i wanted to require? that doesn't make for a very dynamic script... if(!(isset($name) isset($address) isset($phone)) { echo You left one empty.; } Reality Check:
Re: [PHP] What does var mean ?
Ouupppss!! You're right !!! - Original Message - From: J Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 6:43 PM Subject: Re: [PHP] What does var mean ? Bas Jobsen wrote: What does the (ampersand) before the variable name mean ? a pointer to the address (mem) of the variable PHP doesn't have pointers and memory can't be directly accessed this way like you can in C, or C++ or whatever. The ampersand is for passing values via reference rather than value. PHP has no notion of pointers. J -- 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: Yet Another Mysql Problem
What version of admin are you using? I run version 2.2.0 and have never had such a problem. Without looking at the code I can say that it appears that myadmin estimates the size of the file before uploading it and then something happens to prevent the upload from occuring. It may well be that some odd character sequence is causing the error as you suggest, or it may be some sort of socket error. I would suggest some steps to narrow the problem down. First, make sure that your file is actually formatted the way that you are telling myadmin it is formatted. Check the delimiting character, the field terminators, the escape character and the line terminator. It is possible that one of these settings is causing myadmin to think EOF is reached when it is not. Try using different formats, file sizes and upload paths to determine if the error is triggered by a certain combination of factors. Fred Stephen Phillips [EMAIL PROTECTED] wrote in message 002001c1737b$6b36a700$21937ad5@stevephillips">news:002001c1737b$6b36a700$21937ad5@stevephillips... lol, ok (sorry I've been staring at a text file looking for bugs for 3 hours) this is the type of error msg phpmyadmin is giving me; Warning: Only 0 bytes were written, expected to write 32516 in - on line 82 sometimes it says line 74, or 130 as well I was kinda hoping someone might know of some common things which might trip up mysql or php in a string, since this is my best guess as to the reason for the error. Steve. -- 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: possible problems working with sessions
Sorry if I'm off-topic, but I've always wondered what people use sessions for. I seem to be either dealing with logged-in users who I pick up via http-authentication and maintain any details I need in a user data structure, or casual users, for whom the odd hidden input field or occasional cookie seems quite enough. I guess I'm also nervous of anything state-full, especially if it makes you dependent on cookies/funny urls/IP addresses etc.. So why do people use sessions? Alberto Mucignat wrote: well, if you're using default session handling provided with php, users sessions are stored in /tmp directory (also used by default for temporary caching of uploaded files). assume to have the php.ini file with default settings: session.gc_probability = 1 session.gc_maxlifetime = 1440 this means garbage collector lauched 1 times every 100 started sessions. furthermore, deletable sessions are those ones opened 1440 seconds ago (24 minutes). well, i've doing some tries asking web server the following by wget command, (but i suppose you can use also a sockopen or CURL (!) functions...): HEAD /test_session.php HTTP/1.0 where /test_session.php simply starts a session with session_start() function. every single request create a session file in the /tmp server directory. if someone find out how to do many simultanious requests could create so many files in the /tmp dir (while the garbage clean them only after 24 minutes). we know that linux filesystem is limited to 64K files per directory. this could create problems... obviously there are some kind of solutions... - play with session.gc_* php settings in order to prevent problems (but i can't be sure that's a good idea...) - provide a different session storage than the default one. in this case, you have only two other solutions: mm and database storage. i prefer to store sessions in a database, because with mm this could generate worse problems with memory usage... but i mean... there are so many php developers that uses php with default settings (for example: newbies that uses phpnuke or other php content manager session based)... about sessions i've found: http://www.phpwizard.net/resources/tutorials/session_intro.html seen Tobias around? :-) bye, alberto. ps: well, i work with session since not long time, so can be i made a mistake... -- 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] SAFE_MODE + deleting files
Hi, I have enabled the safe mode in a virtual host that uses php in order to try to prevent the user from uploading (via ftp) a php that could sniff around other's people files. Unfortunately I got stucked in a problem. this site uses php to upload and manage some files remotely. The webserver runs as nobody.nobody but the files are owned by the user's id. Warning: SAFE MODE Restriction in effect. The script whose uid is 1515 is not allowed to access /home/httpd/html/some_site/img/foo.jpg owned by uid 99 in .php on line 43 Any tips ? Best regards. __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 -- 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] What does var mean ?
What does the (ampersand) before the variable name mean ? It's called a reference, check out: http://www.php.net/manual/en/language.references.php regards, Philip Olson -- 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] get_included_files() in php3
Hi all, Is there a way of generating a list of files that have been included, in php3, similar to php4's get_included_files() ?? If so, can you supply code plz? Thnx Martin
Re: [PHP] Re: Cannot add header information...
If you add ob_start(); at the start of your code, then you will be able to set Headers anywhere in your page. Peter Per Waagen wrote: Warning: Cannot add header information - headers already sent by (output started at /home/p/pe/perphp/public_html/login.php:4) in /home/p/pe/perphp/public_html/login.php on line 44 -- Avi Schwartz [EMAIL PROTECTED] I have to share the credit. I invented it, but Bill made it famous. - IBM engineer Dave Bradley describing the control-alt-delete reboot sequence -- 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] usage stats
G'day all, I am putting together a small piece on php and was wondering if anyone knew how to dynamically generate the php usage stats from: http://www.netcraft.com/Survey/ Sort of want something like: http://www.php.net/usage.php Have looked at the source looks like this is manually updated? Thought there may be some way of grabbing the stats and generate my own graph with gd or something? Any ideas? Regards, Joseph -- 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 23 Nov 2001 01:58:12 -0000 Issue 1010
php-general Digest 23 Nov 2001 01:58:12 - Issue 1010 Topics (messages 75497 through 75545): about the replacing HTML code by another codes in a Forum ? 75497 by: trongduc 75499 by: liljim Cool? 75498 by: Jaime Iniesta Aleman Send an e-mail witdh php 75500 by: Henk 75501 by: Sebastian Wenleder 75503 by: Henk 75504 by: Simos Varelakis 75510 by: Jason G. Re: Need regular match help - possibly 75502 by: Gaylen Fraley Re: Cannot add header information... SOLUTION 75505 by: Per Waagen Memory upload question.. 75506 by: Pierre-Yves Lemaire Re: GD, PNG 75507 by: Michael A. Peters Re: header(Location:...) much faster then http-equiv=refresh? too fast? 75508 by: Avi Schwartz Re: Cannot add header information... 75509 by: Avi Schwartz 75544 by: Peter Brown redirect 75511 by: Etienne Colla 75512 by: Fredrik Wahlberg possible problems working with sessions 75513 by: Alberto Mucignat 75539 by: George Whiffen error handling and __LINE__ 75514 by: SafeV POP commands 75515 by: Yura 75516 by: Daniel Roperto - Ação Direta 75528 by: Fred What does var mean ? 75517 by: Girish Nath 75518 by: Bas Jobsen 75521 by: Girish Nath 75522 by: Nayco_IUT Laroche 75529 by: Fred 75535 by: J Smith 75537 by: Nayco_IUT Laroche 75542 by: Philip Olson Re: How do I convert from perl to php? - Reality Check Taxation 75519 by: George Whiffen 75536 by: George Whiffen mail client 75520 by: Krzysztof Kakol Yet Another Mysql Problem 75523 by: Stephen Phillips 75524 by: Jon Farmer 75525 by: Stephen Phillips 75530 by: Richard Black 75531 by: Fred 75538 by: Fred solaris + APACHE + PHP = ??? it's working ? 75526 by: Evgeny Rachlenko 75527 by: Justin England How to load .php3 pages using PHP4 75532 by: EDUMEXICO 75533 by: Justin England what the best version PHP + APACHE on Solaris8 75534 by: Evgeny Rachlenko SAFE_MODE + deleting files 75540 by: Robert Mena DTD Validation with DOM 75541 by: Fernando Nemec get_included_files() in php3 75543 by: Martin Towell usage stats 75545 by: Joseph Blythe 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--- hi, can anyone help me this ? 1) I made a simple forum, and it will allow the users to send their messages in HTML format. But I worried about the security of my website, so I removed all of the SCRIPT tags in their messages by placing /SCRIPT instead. (Because the users maybe use SCRIPT language=JavaScript, so I cannot replace SCRIPT exactly) Is it the best solution to protect my pages from malicious code ? (is it secure for my pages ?) Are there other ways that someone can use malicious codes in their messages without SCRIPT ? 2) In the case I do not allow the users send messages in HTML codes, I replaced (similar with phpBB code) : [a]=a href= [/a]= [//a]=/a example the content of message is : [a]www.microsoft.com[/a]Click here...[//a] ...will place a link to Microsoft.com, but the problems will happen when the users use only [a], or [/a], not use [//a] to close the link. Can anyone help me to fix this problem ? (is there another way to do this more simple ?) thanks very much... ---End Message--- ---BeginMessage--- Hiya, well, you could replace all script tags with this regex: $string = preg_replace(/\/?SCRIPT.*?/is, , $string); But, if you're converting all and to their html equivelants (which you should be) using something like htmlspecialchars or your own regex, you shouldn't even need to do that. You might also want to think about strip_tags(), though again, I prefer just to convert the characters and not worry about it. as for your links, I'd rethink the user input and use something like [a=www.microsoft.com]Click[/a] ; // quick and dirty regex $string = preg_replace(/\[a=(.+?)\](.*?)\[\/a\]/is, a href=\\\1\ target=\_blank\\\2/a, $string); James Trongduc [EMAIL PROTECTED] wrote in message 001101c17341$b6de6060$1d0b10ac@d">news:001101c17341$b6de6060$1d0b10ac@d... hi, can anyone help me this ? 1) I made a simple forum, and it will allow the users to send their messages in HTML format. But I worried about the security of my website, so I removed all of the SCRIPT tags in their messages by placing /SCRIPT instead. (Because the users maybe use SCRIPT language=JavaScript, so I cannot replace SCRIPT exactly) Is it the best solution to protect my pages from malicious code ? (is it secure for my pages ?) Are there other ways that
[PHP] Missing PHP.ini
Hello everyone! I upgraded my system from win98 to win2k, a few weeks ago. Now, I can't seem to locate my php.ini file. I've looked in C:\ C:\windows C:\windows\system (and system32) to no success. Is anyone aware of what may have happened? I was under the impression that PHP could NOT run without the Php.ini file, is that incorrect? Please help. -john __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- -- 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] Missing PHP.ini
John, Look in the original distribution files for php.ini-dist (or php.ini-optimized) and copy it to c:\windows\php.ini As far as I know php can run without a php.ini I beleive it has builtin defaults. Regards, Joseph -Original Message- From: John Monfort [mailto:[EMAIL PROTECTED]] Sent: Friday, 23 November 2001 12:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Missing PHP.ini Hello everyone! I upgraded my system from win98 to win2k, a few weeks ago. Now, I can't seem to locate my php.ini file. I've looked in C:\ C:\windows C:\windows\system (and system32) to no success. Is anyone aware of what may have happened? I was under the impression that PHP could NOT run without the Php.ini file, is that incorrect? Please help. -john __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- -- 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] Missing PHP.ini
doesn't win2k files go under C:\winnt ? what about looking under the php directory??? -Original Message- From: John Monfort [mailto:[EMAIL PROTECTED]] Sent: Friday, November 23, 2001 1:06 PM To: [EMAIL PROTECTED] Subject: [PHP] Missing PHP.ini Hello everyone! I upgraded my system from win98 to win2k, a few weeks ago. Now, I can't seem to locate my php.ini file. I've looked in C:\ C:\windows C:\windows\system (and system32) to no success. Is anyone aware of what may have happened? I was under the impression that PHP could NOT run without the Php.ini file, is that incorrect? Please help. -john __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- -- 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] Missing PHP.ini
Thanks Joseph! btw, Happy Thanksgiving to all! __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- On Fri, 23 Nov 2001, Joseph Blythe wrote: John, Look in the original distribution files for php.ini-dist (or php.ini-optimized) and copy it to c:\windows\php.ini As far as I know php can run without a php.ini I beleive it has builtin defaults. Regards, Joseph -Original Message- From: John Monfort [mailto:[EMAIL PROTECTED]] Sent: Friday, 23 November 2001 12:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Missing PHP.ini Hello everyone! I upgraded my system from win98 to win2k, a few weeks ago. Now, I can't seem to locate my php.ini file. I've looked in C:\ C:\windows C:\windows\system (and system32) to no success. Is anyone aware of what may have happened? I was under the impression that PHP could NOT run without the Php.ini file, is that incorrect? Please help. -john __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- -- 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] Missing PHP.ini
On Fri, 23 Nov 2001 12:36, John Monfort wrote: Hello everyone! I upgraded my system from win98 to win2k, a few weeks ago. Now, I can't seem to locate my php.ini file. I've looked in C:\ C:\windows C:\windows\system (and system32) to no success. Is anyone aware of what may have happened? I was under the impression that PHP could NOT run without the Php.ini file, is that incorrect? Please help. No, PHP uses default settings if it doesn't find the ini file. Run phpinfo() in a script to see where it expects to find the ini file to be, then put one there, if you need other than the default settings. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Brain fried - core dumped. -- 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] SQL in Function
On Thu, 22 Nov 2001 18:30, Oosten, Sjoerd van wrote: Hello, im a newbie in writing functions but right now im trying to. I have made the following function // FUNCTION TO DECIDE WHETHER A PROJECT IS IN BETWEEN PROJECTBEGIN AND PROJECTEND , YES OR NO function Activeyesno($month,$day,$year,$Project_id){ $dayactief = mktime(0, 0, 0, $month, $day, $year); $daytemp = date(Y-m-d, $dayactief); $resultactive = mysql_query(SELECT * FROM EIAProjecten WHERE ((Project_begindatum = '$daytemp' AND Project_id = '$Project_id') OR (Project_einddatum = '$daytemp' AND Project_id = '$Project_id')),$db); $num_rows = mysql_num_rows($resultactive); if ($num_rows == '1'){ return red; } } AND i'm calling this function in an while loop ? echo Activeyesno($month,$day,$year,$Project_id); ? (I translated it into english so maybe some mistakes!) When i try to call the function i get a mysql error every time, even when i make $resultactive (SELECT * FROM EIAProjecten) // NO DATE 1. Is it possible to make a sql connection in my function 2. did i do something wrong? Can somebody help me? What is the error? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA (This tagline in Stereo where available) -- 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] strip php out of html
Hello, Is there a way to strip only php code out of an html file? I know about strip_tags but its going to be alot of work to make the allowable list, as all I want to strip out is: ?php ... ? I tried like so: eregi_replace (?php include(\whatever.php\); ?, , $string); but it didn't find it suppose because of the escape characters... Another option would be to find the php code evaluate it and then put the result back in the correct position, I sort of tried this with not much luck. Any ideas.. Regards, Joseph -- 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] strip php out of html
David, Basically I have found a way of making printable versions of every page in a website I am currently working on (without a database etc), because I am using a dreamweaver template the main content is always surrounded by: !-- #BeginEditable content -- ... !-- #EndEditable -- Just a link on a page pointing at the script below: -- html -- ?php $file = fopen($HTTP_REFERER, r); if(!$file)die(Cannot open the file.); $readfile = fread($file ,4); $searchfile = eregi(!-- #BeginEditable \content\ --(.*)!-- #EndEditable --, $readfile ,$out); echo $out[0]; ? -- html -- My problem is that there is a bit of php code showing in the source view which gives away some of my included files names which I really don't want people seeing, especially clever people like the ones on this list :) I don't need the php in the printable version so if I can either eval it or strip it out that would be nice. Regards, Joseph -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Friday, 23 November 2001 2:28 PM To: Joseph Blythe; [EMAIL PROTECTED] Subject: Re: [PHP] strip php out of html On Fri, 23 Nov 2001 14:10, Joseph Blythe wrote: Hello, Is there a way to strip only php code out of an html file? I know about strip_tags but its going to be alot of work to make the allowable list, as all I want to strip out is: ?php ... ? I tried like so: eregi_replace (?php include(\whatever.php\); ?, , $string); but it didn't find it suppose because of the escape characters... Another option would be to find the php code evaluate it and then put the result back in the correct position, I sort of tried this with not much luck. Any ideas.. Regards, Joseph It sounds like you want to capture the output of the script - so you just end up with what you would see in View Source??? Is this a one off thing, or what exactly is the problem you are trying to solve? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Always draw your curves, then plot the data. -- 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] strip php out of html
Sorry people it is actually evaluating the code I was looking at it from inside Maguma PHP4EE studios internal preview which was not evaluating it, after uploading it to the webserver it now is ok doh! :) Anyway i do need to strip out the original link that points to the printable script so that people don't click on it and point it at its self, it just comes up blank anyway as it does not use the dreamwaever template. Regards, Joseph -Original Message- From: Joseph Blythe [mailto:[EMAIL PROTECTED]] Sent: Friday, 23 November 2001 2:47 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: [PHP] strip php out of html David, Basically I have found a way of making printable versions of every page in a website I am currently working on (without a database etc), because I am using a dreamweaver template the main content is always surrounded by: !-- #BeginEditable content -- ... !-- #EndEditable -- Just a link on a page pointing at the script below: -- html -- ?php $file = fopen($HTTP_REFERER, r); if(!$file)die(Cannot open the file.); $readfile = fread($file ,4); $searchfile = eregi(!-- #BeginEditable \content\ --(.*)!-- #EndEditable --, $readfile ,$out); echo $out[0]; ? -- html -- My problem is that there is a bit of php code showing in the source view which gives away some of my included files names which I really don't want people seeing, especially clever people like the ones on this list :) I don't need the php in the printable version so if I can either eval it or strip it out that would be nice. Regards, Joseph -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: Friday, 23 November 2001 2:28 PM To: Joseph Blythe; [EMAIL PROTECTED] Subject: Re: [PHP] strip php out of html On Fri, 23 Nov 2001 14:10, Joseph Blythe wrote: Hello, Is there a way to strip only php code out of an html file? I know about strip_tags but its going to be alot of work to make the allowable list, as all I want to strip out is: ?php ... ? I tried like so: eregi_replace (?php include(\whatever.php\); ?, , $string); but it didn't find it suppose because of the escape characters... Another option would be to find the php code evaluate it and then put the result back in the correct position, I sort of tried this with not much luck. Any ideas.. Regards, Joseph It sounds like you want to capture the output of the script - so you just end up with what you would see in View Source??? Is this a one off thing, or what exactly is the problem you are trying to solve? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Always draw your curves, then plot the data. -- 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] MySQL query problem!
I have the following query $query = INSERT INTO acl ( username, password ) VALUES ( 'henri', ENCRYPT('diesel','henri') ); This is the error i get : Column 'password' cannot be null What is wrong with my query? -- 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] GD, PNG
I try to compile againts PNG and JPEG and for web inteface i had install zlib and png and jpeg then gd but still have no sucess on it On Thursday 22 November 2001 09:03, you wrote: The operating system you are using would be nice to know- and wether its for apache, cgi-bin, or whatever. Most unixes (and it looks like you got a unix) have zlib in /usr not /usr/local. Quite a few already have gd and libpng in /usr as well. That's why it would be nice to know what your build environment is. Anyway, I'm pretty sure that you need to make sure gd is compiled against png. On my system, for example, my gd library is compiled with png, jpeg, and FreeType2 support. Secondly- if your system is darwin, you need to fix a few things. First, run ranlib on /usr/local/lib/libpng.a Then you can build gd against it. Then, though, you need to do the same to libgd ranlib /usr/local/lib/libgd.a note that the above is only needed on Darwin. That is properly done on most other unixes for you (in fact, most unixes compile those as shared libraries) -- 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] MySQL query problem!
On Fri, 23 Nov 2001 16:17, De Necker Henri wrote: I have the following query $query = INSERT INTO acl ( username, password ) VALUES ( 'henri', ENCRYPT('diesel','henri') ); This is the error i get : Column 'password' cannot be null What is wrong with my query? Mysql docs say: ENCRYPT(str[,salt]) Encrypt str using the Unix crypt() system call. The salt argument should be a string with two characters. (As of MySQL Version 3.22.16, salt may be longer than two characters.): mysql select ENCRYPT(hello); - 'VxuFAJXVARROc' If crypt() is not available on your system, ENCRYPT() always returns NULL. ENCRYPT() ignores all but the rst 8 characters of str, at least on some systems. This will be determined by the behavior of the underlying crypt() system call. # It may be that you don't have crypt on your system; also, you might want single quotes around the ENCRYPT and double quotes to delimit the string and salt, thus: VALUES ( 'henri', 'ENCRYPT(diesel,henri)' ); -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA , said Tom blankly. -- 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] MySQL query problem!
On waht systems does encrypt() work on.In my Mysql client my query results are null,so i dont have encrypt on my system! -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: 23 November 2001 08:24 To: De Necker Henri; PHP-General (E-mail) Subject: Re: [PHP] MySQL query problem! On Fri, 23 Nov 2001 16:17, De Necker Henri wrote: I have the following query $query = INSERT INTO acl ( username, password ) VALUES ( 'henri', ENCRYPT('diesel','henri') ); This is the error i get : Column 'password' cannot be null What is wrong with my query? Mysql docs say: ENCRYPT(str[,salt]) Encrypt str using the Unix crypt() system call. The salt argument should be a string with two characters. (As of MySQL Version 3.22.16, salt may be longer than two characters.): mysql select ENCRYPT(hello); - 'VxuFAJXVARROc' If crypt() is not available on your system, ENCRYPT() always returns NULL. ENCRYPT() ignores all but the rst 8 characters of str, at least on some systems. This will be determined by the behavior of the underlying crypt() system call. # It may be that you don't have crypt on your system; also, you might want single quotes around the ENCRYPT and double quotes to delimit the string and salt, thus: VALUES ( 'henri', 'ENCRYPT(diesel,henri)' ); -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA , said Tom blankly. -- 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] GD, PNG
Two things come to mind when compiling under redhat 6.x 1) Delete all headers and libs relating to gd in /usr/lib and /usr/include these are old and will cause conflicts. 2) Use --with-..-dir=.. Here is my successful configure command assuming you have successfully installed freetype2 and gd with frretype2 support. redhat comes with compatible zlib, png and jpeg libs ./configure \ --prefix=/usr/local/Zend \ --with-apxs=/usr/local/apache/bin/apxs \ --with-config-file-path=/usr/local/Zend/etc \ --with-mysql=../../mysql \ --with-gd=/usr/local/gd \ --with-freetype-dir=/usr/local/freetype2 \ --with-png-dir=/usr \ --with-jpeg-dir=/usr \ --with-zlib-dir=/usr \ --with-xml \ --with-pdf \ --enable-wddx \ --enable-sockets \ --enable-track-vars \ --disable-debug Hope this helps some as I too had major troubles geeting gd support under php seems to work really well now though. Regards, Joseph -Original Message- From: Yamin Prabudy [mailto:[EMAIL PROTECTED]] Sent: Saturday, 24 November 2001 4:46 AM To: Michael A. Peters; PHP Subject: Re: [PHP] GD, PNG I try to compile againts PNG and JPEG and for web inteface i had install zlib and png and jpeg then gd but still have no sucess on it On Thursday 22 November 2001 09:03, you wrote: The operating system you are using would be nice to know- and wether its for apache, cgi-bin, or whatever. Most unixes (and it looks like you got a unix) have zlib in /usr not /usr/local. Quite a few already have gd and libpng in /usr as well. That's why it would be nice to know what your build environment is. Anyway, I'm pretty sure that you need to make sure gd is compiled against png. On my system, for example, my gd library is compiled with png, jpeg, and FreeType2 support. Secondly- if your system is darwin, you need to fix a few things. First, run ranlib on /usr/local/lib/libpng.a Then you can build gd against it. Then, though, you need to do the same to libgd ranlib /usr/local/lib/libgd.a note that the above is only needed on Darwin. That is properly done on most other unixes for you (in fact, most unixes compile those as shared libraries) -- 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] MySQL query problem!
On Fri, 23 Nov 2001 17:05, De Necker Henri wrote: -Original Message- From: David Robley [mailto:[EMAIL PROTECTED]] Sent: 23 November 2001 08:24 To: De Necker Henri; PHP-General (E-mail) Subject: Re: [PHP] MySQL query problem! On Fri, 23 Nov 2001 16:17, De Necker Henri wrote: I have the following query $query = INSERT INTO acl ( username, password ) VALUES ( 'henri', ENCRYPT('diesel','henri') ); This is the error i get : Column 'password' cannot be null What is wrong with my query? Mysql docs say: ENCRYPT(str[,salt]) Encrypt str using the Unix crypt() system call. The salt argument should be a string with two characters. (As of MySQL Version 3.22.16, salt may be longer than two characters.): mysql select ENCRYPT(hello); - 'VxuFAJXVARROc' If crypt() is not available on your system, ENCRYPT() always returns NULL. ENCRYPT() ignores all but the rst 8 characters of str, at least on some systems. This will be determined by the behavior of the underlying crypt() system call. # It may be that you don't have crypt on your system; also, you might want single quotes around the ENCRYPT and double quotes to delimit the string and salt, thus: VALUES ( 'henri', 'ENCRYPT(diesel,henri)' ); On waht systems does encrypt() work on.In my Mysql client my query results are null,so i dont have encrypt on my system! I doubt that crypt would exist on a Winblows box - you might have to use PASSWORD instead. However I'd hope to find it on a *nix system because that is what is used to encrypt the user passwords in *nix -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Never say, Oops!; always say, Ah, interesting! -- 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] error handling and __LINE__
try, assert() instead of echo()ing error messages. assert('is_object($obj)'); and write your error handler code or use mine :) or am i missing something? Papp Gyozo - [EMAIL PROTECTED] - Original Message - From: SafeV [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 22, 2001 4:15 PM Subject: [PHP] error handling and __LINE__ | Hi, | I wonder if there's a way to find the line number of the calling script | from a function, like the error messages PHP generates. An example: | | In an included file I have a function and want to do something similar to: | | function foo($obj) { | if (!is_object($obj)) { | echo Error: supplied argument is not an object in ; | echo __FILE__ . line . __LINE__; | } | ... | } | | But __FILE__ and __LINE__ refers to the current file, ie. the file with | the function in, and not the file where the function is called from. | The first one I can solve by using $SCRIPT_NAME, but what about the line | number??? | | | | -- | 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] |