[PHP] Notices flooding logs with fastcgi
Hello everybody, I have chosen this list because my problem is related to one particular style of php installation. At least I think so. I'm running php 5.2.11 and plesk 9.2.3, php through fastCGI. My problem is that, since error_log is unset, php passes on any errors to the webserver (-handler). This fills up my logs with hundreds of MBytes of Notices every day, even though error_reporting is set to 6135 (notices shouldn't be logged). So error_reporting appears to be ignored when error_log is unset and php is run through fastcgi. Any idea how I can fix that? I unfortunately can't change error_log to the appropriate path, because the fastcgi user doesn't have access to the log directory... Here is an example log: [Mon Oct 26 00:57:52 2009] [warn] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /srv/www/vhosts//httpdocs/ x3/inc/shopstat_functions.inc.php on line 82 Thanks so much in advance, -- Cheers, Max GNU/Linux - User #477672 PGP: 0x6C29B594
Re: [PHP] Notices flooding logs with fastcgi
2010/1/18 Ashley Sheridan a...@ashleysheridan.co.uk On Mon, 2010-01-18 at 12:20 +, Max Zimmermann wrote: Hello everybody, I have chosen this list because my problem is related to one particular style of php installation. At least I think so. I'm running php 5.2.11 and plesk 9.2.3, php through fastCGI. My problem is that, since error_log is unset, php passes on any errors to the webserver (-handler). This fills up my logs with hundreds of MBytes of Notices every day, even though error_reporting is set to 6135 (notices shouldn't be logged). So error_reporting appears to be ignored when error_log is unset and php is run through fastcgi. Any idea how I can fix that? I unfortunately can't change error_log to the appropriate path, because the fastcgi user doesn't have access to the log directory... Here is an example log: [Mon Oct 26 00:57:52 2009] [warn] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /srv/www/vhosts//httpdocs/ x3/inc/shopstat_functions.inc.php on line 82 Thanks so much in advance, -- Cheers, Max GNU/Linux - User #477672 PGP: 0x6C29B594 I believe that the reporting level is only used for errors displayed in the browser window, not to the ones that are logged. If you're having your error logs fill up with errors, this isn't an issue with PHP but the coder! It is obviously more than a few errors, unless your website has millions of visitors each day triggering the same error, but which is more likely a scenario?! I'd advise fixing those errors, even the warnings, as warnings are often a prelude to a logic problem somewhere in the code. Thanks, Ash http://www.ashleysheridan.co.uk Hey Ash, thanks for your reply. I know this is a coding issue, and xt:commerce always produces loads of notices. That said, I think the error_reporting setting does apply to logging when mod_php is used. I could be wrong though. But even fixing the whole of xt:commerce code to be notice free (which would be rediculously much work) doesn't solve the problem. Whenever anyone is installing something new on his website lying on this server, I'm gonna have the same problem again. I can't spend my whole time basically reviewing code that someone runs on the server... I think that's understandable ;) So I'm afraid I'm gonna need some other ideas :( Thanks again, Max
Re: [PHP] Notices flooding logs with fastcgi
2010/1/18 Richard Quadling rquadl...@googlemail.com 2010/1/18 Max Zimmermann maxzimmerm...@googlemail.com: 2010/1/18 Ashley Sheridan a...@ashleysheridan.co.uk On Mon, 2010-01-18 at 12:20 +, Max Zimmermann wrote: Hello everybody, I have chosen this list because my problem is related to one particular style of php installation. At least I think so. I'm running php 5.2.11 and plesk 9.2.3, php through fastCGI. My problem is that, since error_log is unset, php passes on any errors to the webserver (-handler). This fills up my logs with hundreds of MBytes of Notices every day, even though error_reporting is set to 6135 (notices shouldn't be logged). So error_reporting appears to be ignored when error_log is unset and php is run through fastcgi. Any idea how I can fix that? I unfortunately can't change error_log to the appropriate path, because the fastcgi user doesn't have access to the log directory... Here is an example log: [Mon Oct 26 00:57:52 2009] [warn] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /srv/www/vhosts//httpdocs/ x3/inc/shopstat_functions.inc.php on line 82 Thanks so much in advance, -- Cheers, Max GNU/Linux - User #477672 PGP: 0x6C29B594 I believe that the reporting level is only used for errors displayed in the browser window, not to the ones that are logged. If you're having your error logs fill up with errors, this isn't an issue with PHP but the coder! It is obviously more than a few errors, unless your website has millions of visitors each day triggering the same error, but which is more likely a scenario?! I'd advise fixing those errors, even the warnings, as warnings are often a prelude to a logic problem somewhere in the code. Thanks, Ash http://www.ashleysheridan.co.uk Hey Ash, thanks for your reply. I know this is a coding issue, and xt:commerce always produces loads of notices. That said, I think the error_reporting setting does apply to logging when mod_php is used. I could be wrong though. But even fixing the whole of xt:commerce code to be notice free (which would be rediculously much work) doesn't solve the problem. Whenever anyone is installing something new on his website lying on this server, I'm gonna have the same problem again. I can't spend my whole time basically reviewing code that someone runs on the server... I think that's understandable ;) So I'm afraid I'm gonna need some other ideas :( Thanks again, Max Don't log the errors! Let them go to php's normal error log. If you can have a per-site setup, then log them per site and pass them to the coder/owner to fix. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling Hey Richard, thanks for you reply. Yes, that was what I was thinking about. And after a bit of thinking, this is what I'm going to do. Everything else seems pointless :) Thanks for the tip! Max
Re: [PHP] Notices flooding logs with fastcgi
2010/1/18 Robert Cummings rob...@interjinn.com Ashley Sheridan wrote: On Mon, 2010-01-18 at 12:20 +, Max Zimmermann wrote: Hello everybody, I have chosen this list because my problem is related to one particular style of php installation. At least I think so. I'm running php 5.2.11 and plesk 9.2.3, php through fastCGI. My problem is that, since error_log is unset, php passes on any errors to the webserver (-handler). This fills up my logs with hundreds of MBytes of Notices every day, even though error_reporting is set to 6135 (notices shouldn't be logged). So error_reporting appears to be ignored when error_log is unset and php is run through fastcgi. Any idea how I can fix that? I unfortunately can't change error_log to the appropriate path, because the fastcgi user doesn't have access to the log directory... Here is an example log: [Mon Oct 26 00:57:52 2009] [warn] mod_fcgid: stderr: PHP Notice: Undefined offset: 1 in /srv/www/vhosts//httpdocs/ x3/inc/shopstat_functions.inc.php on line 82 Thanks so much in advance, -- Cheers, Max GNU/Linux - User #477672 PGP: 0x6C29B594 I believe that the reporting level is only used for errors displayed in the browser window, not to the ones that are logged. The error_reporting setting controls both logged and displayed errors. @Max ... is it possible your application is resetting error_reporting after you set it manually? Maybe try a recursive grep on the source tree for error_reporting. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP Hey Rob, thanks for your reply. No, unfortunately this seems to be a problem with fastCGI, since phpinfo() run somewhere inside the script still says that the error_reporting is set correctly. It just doesn't seem have any influence when errors are logged by the SAPI handler. But since this appears to be not easily changeable right now, I'm going to go with Richard's idea. Thanks all of you for helping! :) Best, Max
[PHP] Re: Getting part of string matched with regular expressions
Teck wrote: Hi, I'm trying to find a way to get part of a string where the part is matched with regular expressions. So, for example, if I have a string: a2b3cd5ef6ghi7232jklmn I need to grab 12b3cd5 using regular expressions and store the part in a variable. $var = do_something(,,a2b3cd5ef6ghi7232jklmn); I was using preg_replace for this, and try to delete (i.e., replace the non-matched part with an empty string) the second part, but I can't make it work. You can use backreferences in regular expressions. $var= preg_replace('/([a-z]+)/is','$1','azxcvjf937^88'); if($var==='azxcvjf') echo MATCH; http://php.net/manual/en/function.preg-replace.php look at Example1. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Match anything between two that is not a except if it is escaped...
mathieu leddet writes: Hi everyone, I am struggling with regular expression trying to match strings delimited by double quotes, but taking into consideration that \ is not a string ending character. .. // pattern for catching strings between $pattern = '#([^]*)#'; . $out contains : this is a string : bHi everyone my name is \/bMathieu\b!/b Here is a second string : bPHP is just perfect/b . -- Mathieu If I right understand you scope. (yes, my English is bad) You hope to get result such as: this is a string : bHi everyone my name is \Mathieu\!/b Here is a second string : bPHP is just perfect/b I try to fix you regular expression. $pattern = '#(.*?)(?=[^])#is'; attend to this: (?=[^]) when PHP compile this string - inside it looks like (?=[^\\]) when regular expression compile inside pcre library it looks like #(.*?)(?=[^\])#is this part: (?=[^\]) is mean folow: double quote, which not have leading backslash. see folow: [EMAIL PROTECTED]:~$ cat preg.php ?php $in = 'this is a string : Hi everyone my name is \Mathieu\! Here is a second string : PHP is just perfect'; // pattern for catching strings between $pattern = '#(.*?)(?=[^])#is'; // surround matching string with HTML span code to highlight $replacement = 'b${1}/b'; // perform the reg exp replacement $out = preg_replace($pattern, $replacement, $in); echo $out,\n\n; [EMAIL PROTECTED]:~$ php preg.php this is a string : bHi everyone my name is \Mathieu\!/b Here is a second string : bPHP is just perfect/b Is this rigth? -- Max Anotnov (idler at instanceof dot ru) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Match anything between two that is not a exceptif it is escaped...
Jochem Maas writes: attend? don't understand what you mean BUT you have given the OP the answer by changing his regexp to include a [negative] look behind assertion for the backslash. :-) I hope, my regular expression answer the purpose, than need Mathieu (what mean abbreviation OP? can send direcly to my mailbox) -- Max Anotnov (idler at instanceof dot ru) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Match anything between two that is not a exceptifitis escaped...
Jochem Maas : mathieu leddet schreef: Thanks a lot Max (and Jochem), you solved my issue. PS - you solved the issue but did you learn what a [negative] look behind assertion is? Mathieu, I agree with Jochem. If you periodicaly solve issues, such this - you must know about behind assertions in pcre. I ask google, and google give me good manual. http://www.pcre.org/pcre.txt open this page and use brouser search interface to find section PCREPATTERN or PCRE REGULAR EXPRESSION DETAILS it is best manual about PCRE (IMHO) But I don't know - is php pcre fully compatible with pcre library. Also see documentation in php.net :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] issues with imap_qprint()
Hey there, I try to decode the subjects of an email with German umlaute (öäü ..), which are encoded in in quoted printable. For Example ... the string Gr=FC=DFen has to be converted to Grüßen. I tried it with a little example and it worked fine: ?php $test = imap_qprint(Gr=FC=DFen); $handle = fopen(codetest.xml, w); fwrite($handle, $test); // writes Grüßen into the file fclose($handle); ? But when i implement the imap_qprint function into the real script, in which i read the email header information it writes something like this: =?ISO-8859-1?Q?Grüßen? So it decodes right but it puts this ugly iso code info around the result. It's kinda wired because i use it exactly the way I did in the example shown above. Is there any way to avoid this or a build in function to strip that crap?? greets, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imap_search - criterion ON
Hey there, i am trying to use the imap_search function oh PHP. In the documentation it says i can use ON to search for a date. Whenever i try that I get: Unknown search criterion: ON Which is wired because ON is even mentioned in the IMAP2 criteria?!? Any ideas what's wrong? Greets, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Consultant / Contractor
Hi all, I apologize in advance for a commercially orientated posting in this discussion list - I did not see a business focused list to use instead. I am looking for a good reliable PHP developer that can help with some one off projects that I have (10-20 hours a month perhaps) - geographic location is not a concern (aka I am open to persons outside of the US), the requirement of reliable communication and timely delivery is absolute. If you are interested in something like this please email me off list with your Resume/CV, any sample projects that would be good to look at, and of course your contact information. Thanks, Max max [at] clarksys [dot] com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [php] passing variables doesn't work
Whatever form information you want to pass has to be part of the form. WILLEMS Wim (BMB) wrote: select name=database size=1 In the second script, the value of this will be in $_POST[database]. ?php $wim = 5; /* this is added to test the passing of the variables - doesn't work either */ $wim isn't part of your form - it will /not/ get saved into the next PHP script. You can handle it through input type hidden elements in the form, or through sessions, for example, depending on what you want to do with it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] If array()
John Taylor-Johnston wrote: How can I use if to see an array contains something? if (sizeof($array)) ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POPUP window in PHP
Captain wrote: hi, i want to do YES/NO confirmation (like POPUP). If YES, it will upload a file PHP is server-side, not client-side. You can have the confirmation passed as a GET variable in a two-step process for example, i.e. first show a confirmation form if $_GET[confirm] is not set, else check $_GET[confirm] and process the uploaded file. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POPUP window in PHP
Captain wrote: My requirement is, i want to upload one file. i am checking whether it exists or not in Server side. Your script will have to work in stages, generating a page and sending to the browser on each stage: 1. Make a form to upload a file for the user to submit - this is just ordinary HTML. 2. Once the form is submitted to your script, process the file: check if it already exists. If it does not, just move the file to a permanent location and go to step 4. If it does, move it a temporary location on the server, and generate a page with a second form, asking the user whether they want the file replaced. 3. Once the form from step 2 is submitted, if the file is to be replaced, move the file from its temporary location to the permanent location. 4. Generate a page saying the operation went through fine. For a reference on file uploads, check the online documentation: http://www.php.net/manual/en/features.file-upload.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date verification
Ron Piggott (PHP) wrote: Is there a PHP function which verifies a valid date has been entered (-MM-DD)? Ron http://www.php.net/manual/en/function.checkdate.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calling Curt Z, Curt Z to the white courtesy phone please
Curt Zirzow wrote: I'm including the list in this reply in case any wants to give some feedback. http://zirzow.dyndns.org/php-general/NEWBIE http://www.thelinuxconsultancy.co.uk/phpeditors.php is no longer valid. I mean, the list is no longer there, though the URL is still valid. It got pretty out of date anyhow. php-editors.com is a good alternative suggestion. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php-cgi limitations
Can anyone offer or point me to a summary of differences between running php as an Apache module vs as a cgi executable? Specifically, I'm wanting to upgrade our servers to php 5 but there is one crucial third-party app we're using that still needs php 4, so I'm hoping I can run just that app under php 4 cgi until the vendor updates to support php 5. Google is unusually laconic on this, but perhaps I just offended it with too many daft queries on the subject... :) -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php-cgi limitations
El Bekko wrote: Max Schwanekamp wrote: Can anyone offer or point me to a summary of differences between running php as an Apache module vs as a cgi executable? Specifically, I'm wanting to upgrade our servers to php 5 but there is one crucial third-party app we're using that still needs php 4, Are you sure that app won't work under PHP5? Thanks for the reply. The app in question is FogBugz, and they state emphatically that it does not yet work under PHP5. I guess there's only one way to find out, really - test test test. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help with nl2br
canobit canobit wrote: I have cobbled the following code that when it retrieves the data from Mysql, the data is displayed with no line breaks which results in one large paragraph. I have been trying for quite awhile without sucess to get nl2br working with this code. The original data is entered by the user via a textarea form. snip /snip / while($row = mysql_fetch_row($result)) { echo trfont color=blue size =4; echo .$row[1]/b; echo trfont color=black size = 3; echo .$row[2]; echo br \n; echo br \n; snip / There is no nl2br in your code sample, so I'm assuming you want to put $row[2] through it? It's about as simple as nl2br($row[2]). If that doesn't work, then perhaps you should post sample code that is failing, and the output you get, along with the output you're expecting. All that said, you might want to invest some time in learning a DB abstraction layer such as ADODb or PEAR::DB (there are lots of others). You'll commonly find convenience functions to do things like output query results into an HTML table. Why waste time debugging the wheel? -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Editing an existing pdf?
Jay Contonio wrote: I am just looking for someone to point me in the right direction. I need to be able to *edit* an existing pdf, not create a new one. I basically would be adding an image or text from a form to an existing pdf. Does the PDFLib have an overlay function? These will not be 72 DPI pdf's either. Never used it myself, but FPDF says it can do this using the FPDI extension. http://fpdf.org/en/FAQ.php (see item 17) -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Editing an existing pdf?
Jay Contonio wrote: With FPDF you have been able to add jpegs or pngs to existing high-res pdfs? I understand adding data using the FDF file but what about an image? Yeah, I use FPDF on a fairly busy site to generate PDFs that have one of various logos embedded. The PDF can be regular 72DPI - that's print quality for text. But the image should be at print resolution, i.e. 300DPI or better, preferably a 24-bit PNG. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reverse Engineering of Smarty
Zareef Ahmed wrote: Accidentally I got deleted all of my php code in one of my application, I was using smarty and its compiled directory has the code in its native format. Is there any way so I can do some type of reverse engineering to bring back my original code? No, Smarty's compiled PHP is strictly for the output. There is little connection (or there shouldn't be anyway) between your application php and the compiled php that Smarty produces when it parses a template file. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get timestamp?
Jay Paulson wrote: How would I go about getting the timestamp of a day of the week from 7 weeks ago? $lastSunday = strtotime(last Sunday); $Sunday7Weeks = $lastSunday - ???; $lastsunday = strtotime(last Sunday); $sunday7weeks = $lastsunday - (86400 * 49); // 7 weeks = 49 days Test: echo 'Last Sunday\'s date was '.date(m/d/y,$lastsunday); echo 'br7 Weeks prior to Last Sunday, the date was '.date(m/d/y,$sunday7weeks); -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get timestamp?
Max Schwanekamp wrote: Jay Paulson wrote: How would I go about getting the timestamp of a day of the week from 7 weeks ago? $lastsunday = strtotime(last Sunday); $sunday7weeks = $lastsunday - (86400 * 49); // 7 weeks = 49 days Oops, that would be the sunday 7 weeks prior to _last_ Sunday, which would really be Sunday 8 weeks ago, so maybe change the 49 to 42... -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me plz
If this is on the same web page, your question has nothing to do with PHP - look into, i.e., JavaScript. suresh kumar wrote: hi, i am using 2 combo box one for country another one for city.when i select country name from combo box their corresponding city names has to be changed in their corresponding combo box.i dont know how 2 implement this.pz give me some idea.its urgent. A.suresh Send instant messages to your online friends http://in.messenger.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SELECT?
William Stokes wrote: I have one MySQL table with about 500 rows. I need to read the table one row at a time, make some changes to data in one field and then store the changed data to another table. I'm using PHP to change the data but I have no idea how to select one row at a time from the DB table. A couple of possible options, depending on your specific situation: 1. Use INSERT...SELECT syntax. If you're doing a regular transformation on all selected rows that can be handled by MySQL function(s), this would be easiest and fastest. e.g. (table_b.id is an auto-incremented primary key): INSERT INTO table_b (id, table_a_id, transformed_value) SELECT NULL, id, SOME_FUNCTION(mycolumn) FROM table_a 2. Depending on the size of the records, you might want to just read all 500 rows into a two-dimensional array and use an array fn such as array_walk to apply a function to change the relevant data and insert into your new table. To get all rows into an array, you set an array variable and iterate over the MySQL result set to build the members of the array. If you need details on how to do *that*, you'll need to indicate which version of PHP you're using and whether you're using an abstraction layer for database access. For an example in PHP 4, you might have: $db_cursor = mysql_query(SELECT * FROM my_table, $db); //check for errors [omitted] //count the records $recordcount = mysql_num_rows($db_cursor); //assemble the recordset array $recordset = array(); for($i=0;$i$recordcount; $i++) { $recordset[] = mysql_fetch_assoc($db_cursor); } //clean up, etc. [omitted] Then use array_walk() or similar... HTH -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Anyone getting bounces from
John Nichel wrote: Jay Blanchard wrote: [EMAIL PROTECTED] ? I am getting failure notices out the wazoo for some very old messages to the general list. I am too. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PhpMailer vs Pear:Mail
Richard Heyes wrote: Petr Smith wrote: I tried all and ended with http://www.phpguru.org/static/htmlMimeMail5.html fast, stable, usable. A very good choice. ;-) But but but, what *is* the advantage of one over the other? I've been a PhpMailer devotee for some time. PEAR::Mail is too spare, PhpMailer is reasonably quick and has proven quite stable (I've built a couple newsletter apps using it). What's the advantage of Richard's package vs. the Pear one (on which he is a lead dev) vs. PhpMailer? -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] probably a simple mysql copy multiple rows question
Dave Carrera wrote: so if the output of my current table is BASE 600 1.99 BASE 601 2.99 then i would like to copy these rows so that the table looks like this BASE 600 1.99 BASE 601 2.99 NEW600 33 NEW601 33 This is a SQL question, not PHP. That said, what you're describing is INSERT...SELECT syntax. In your example, something like: INSERT INTO mytable (name, code, price) SELECT 'NEW', code, '33' FROM mytable WHERE name = 'BASE' /* or whatever rows you need to copy */ Supported by MySQL, PostGres and others. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checkng if string is a number
Which version of PHP are you using? On php 4.4.0 (SuSE 10.0 default RPM, not custom build, so perhaps I'm missing some extras you're using?) the following script works fine: ?php if (10==intval(ten)) echo boo\n; else echo no boo\n; ? I get no boo. intval doesn't convert my ten to a number. Moreover, the output of the following: ?php echo intval(ten); ? produces an expected (by me) 0. On Thursday 17 November 2005 20:37, blackwater dev wrote: do something else. is_int doesn't work, intval converts ten to a number so that doesn't work Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checkng if string is a number
If I misunderstood the intval part of your post, than the [proposed already] is_numeric solutions are the way to go. is_numeric will, however, unlike the conversion functions, return false if there's anything but a number in the string, so, i.e., is_numeric (10a1) will return false, but intval (10a1) will give 10. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue
Hi list, Does anyone have any information/updates on this issue perhaps? The thread on http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027056.html hasn't had anything new (since Nov 6), and on http://bugs.php.net/bug.php?id=35059 it's been stated as fixed ever since (Nov 2). The FreeBSD php port doesn't seem to have moved past 4.1.1_1, which, as the thread implies, still has the problem, and since the PHP CVS commit was made 4 days before that, I'm [wildly] guessing that fix was already consumed... On a side note, has anyone had an issue with PHP and mod_rewrite of the same nature on a non-FreeBSD install? Thanks! Max. On Tuesday 08 November 2005 21:07, Geert Booster wrote: I've seen this problem on a FreeBSD 5.3 machine with Apache2 and PHP 4.4.1_1. The problem looks to be a problem with mod_rewrite and PHP, because the different scripts (MovebleType, Gallery2, Dokuwiki) are rewriting and getting the same errors. Maybe the following [1] thread on the FreeBSD ports lists does help you. I (and the other sysops/users of this machine) are waiting for a patch for this problem (By PHP developers or maybe the FreeBSD porters, it could be a FreeBSD issue) because we don't want to go back to 4.4.0 when it's not needed (critically fixes in 4.4.1..) You're not the only one :-) [1] http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027038.html Yours sincerely, Geert Booster -- Geert Booster [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php related segmentation fault with Apache 2.0.55
I have had various problems with upgrading one or the other, until I took it as a rule to recompile both upon an upgrade. On the machine I do things completely manually on [which has it's drawbacks], I generally also upgrade to the current version of PHP together with any Apache update, and vice-versa. The current 4.x version is 4.4.1 [although on a FreeBSD install I had some issues and downgraded to 4.4.0, but this behaviour hasn't been confirmed outside of FreeBSD until now] - perhaps try recompiling PHP to the current 4.x version (or if you feel up to it, upgrade to the 5.x versions?), and see if it helps? Resolved a lot of my problems in the past... On Thursday 17 November 2005 22:31, kristina clair wrote: 2.0.54 to Apache 2.0.55. The scripts that are failing with the new Apache work with no problems with the old Apache. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checkng if string is a number
Curt, yes, technically, 0 is a number - it's a bit late here, and I believe I mis-understood the original question, which is why I re-posted in the thread. I guess my mind got a bit confused by the combination of is_int doesn't work, intval returns a number and '10' vs 'ten' example. That's probably due to the fact I normally rely on intval() to do the job for integers, which also helps remove some user mis-types at the end of number fields, which is useful in situations when A) you're ok with the user typing 11l when they mean 111 B) you don't want to accept a value of 0 In principle, that's the only problem with intval - a 0 will evaluate as false in a logical statement. Unless one wants to make sure it's a full number from start to end, of course... Max. On Thursday 17 November 2005 23:05, you wrote: On Thu, Nov 17, 2005 at 08:47:30PM +0100, Max Belushkin wrote: extras you're using?) the following script works fine: ?php if (10==intval(ten)) echo boo\n; else echo no boo\n; ? I get no boo. intval doesn't convert my ten to a number. Moreover, the output of the following: Yes it does. echo intval('a'); // 0 echo intval('0'); // 0 echo intval(0); // 0 echo intval(0.1); // 0 $v = intval('ten'); var_dump($v); // int(0) $v = intval('10'); var_dump($v); // int(10) Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: please shed some light on SQLsyntax error
Bruce Gilbert wrote: //build and issue query $sql = INSERT INTO $table_name values ('', '$_POST[f_name]', '$_POST[l_name]', '$_POST[address1]', '$_POST[address2]', '$_POST[address3]', '$_POST[postcode]', '$_POST[country]', '$_POST[prim_tel]', '$_POST[sec_tel]', '$_POST[email]', '$_POST[birthday]'); Holy riddled-with-security-holes batman! Strange that no one has jumped on this. That code could be easily hijacked to do nasty things to your server. Google sql injection php or something like that and you'll get lots of resources. E.g.: http://dev.mysql.com/tech-resources/articles/guide-to-php-security.html PS - Hello all! This is my first post to the list; I've been lurking for a week or two. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mod_rewrite, apache2, php5RC1 and osx bsd
I've been having a problem with PHP 4.4.1 and mod_rewrite, which, as Geert Booster kindly pointed out, has been reported on http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027038.html, which also has a link to the PHP bug report in the thread. Not sure if this is relevant to PHP5, but thought I'd mention that something similar exist(ed?) in the 4.4.1 version. On Thursday 10 November 2005 22:36, Richard Lynch wrote: On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote: Hi there, ive been having issues with mod_rewrite and apache2 with PHP 5.1RC1. I have googled the php bugs and people have been experiencing the same issue however the php people cant see to reproduce the bug. Its most definately doing it for me, here is a rewrite rule i have setup, if i [L] to a php script, it either tries to download the faked url file or hangs. I reverted back to 5.1.0b2 and it works fine ?? What do i do ? RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$ ../../phpscript.php I should think all those .* should be .+ instead... I mean, if somebody surfs to this URL: http://example.com//example.video Do you really want that to hit ../../phpscript.php This probably will not fix your bug, mind you, but it's probably worth trying just to see. I think you could also lose all those ()s in the Regex, as you don't seem to be doing anything with them. Or perhaps mod_rewrite collects them and passes them in to phpscript.php somehow? You could also consider using: [^/]* instead of . because, after all, .* does match /, so maybe you are confusing the Regex so that: //example.video actually matches your pattern, even though you really don't want it to. I haven't used mod_rewrite enough to know what pattern system it uses, so I could be full of [bleep] here. If all else fails, consider not using mod_rewrite at all, and having a ForceType on some convenient directory to change that directory into a PHP script. For example, suppose you now have: ~/videos/*.video with a zillion video files in there for the * mkdir video_files mv videos/*.video video_files rmdir videos cp phpscript.php videos echo -e Files videos\nForceType application/x-httpd-php\n/Files .htaccess Now, your videos directory is *REALLY* your phpscript.php, but it just *looks* like a directory in the URL. You'd need to change phpscript.php to read the videos (or whatever it does to them) from /video_files/ instead of where they are now. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue
Maybe the following [1] thread on the FreeBSD ports lists does help you. I (and the other sysops/users of this machine) are waiting for a patch for this problem You're not the only one :-) [1] http://lists.freebsd.org/pipermail/freebsd-ports/2005-November/027038.html Oh, thanks a lot! I'll be keeping an eye on the thread - I have mod_rewrite employed... well, everywhere, so I'm guessing that's what the culprit was. Will be waiting for patch news before trying to update to 4.4.1 again! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue
Try using require_once or include_once Well, here's all the fun starting. This is relatively long, but please bear with me. First of all, yes, I did include_once, require_once, even resorted to if (! $inc_done) include_once(func.php), and setting $inc_done in func.php. No-go, was still getting the Cannot redefine mquery() error message. Now for the fun. I've had a different set of scripts employing a different func.php. Let's say, for simplicity, /home/test1/index.php included /home/test1/func.php, and /home/test2/index.php included /home/test2/func.php. However, in both of those, mquery() is defined. But they do *not* include anything else, and the paths where set as written above. And, what do you know? If I worked inside test1 for a while, and went to test2, I'd get: Cannot redefine mquery() in /home/test2/func.php line 9 (first defined in /home/test1/func.php on line 9). Voila. Going through PHP 4.4.1 release notes, I noticed the change stating fixed a memory corruption bug in include(). Now, I don't know how FreeBSD ported the PHP code into it's ports tree, but for me, on FreeBSD 5.1, PHP 4.4.1 *introduced* a memory corruption bug in include. I downgraded to 4.4.0, and everything works perfectly fine again. I've written to the freebsd-questions mailing list, but got no sensible reply so far (only one was upgrade the ports that use PHP to newer versions, but my own simple set of scripts exhibits this very strange behaviour, so it's not a solution). I'll wait a few days to see if anyone else in FreeBSD experiences the same behaviour (the port was only introduced 2-3 days ago) before posting a bug report, else if no one else sees the same thing I did, I'll have to dig through PHP code to see what was modified in the include()-related code, I guess, and see what influences the behaviour I'm seeing... Comments? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue
On Saturday 05 November 2005 17:49, James Benson wrote: I've had a different set of scripts employing a different func.php. However, in both of those, mquery() is defined. But they do *not* include anything else, and the So you defined mquery() in both files and one include's or require's the other file? I'm sorry, but what wasn't clear in my post? A *separate* set of scripts includes a *separate* func.php, and even not by relative, but by absolute paths! Example: /home/test1/index.php: ?php include (/home/test1/func.php); ? /home/test2/index.php: ?php include (/home/test2/func.php); ? Both func.php are the same, defining a function mquery, which connects to mysql, and returns. After working with the index.php in Test1 until I get the Cannot redefine error, I go to test2, and I get the error that *that function was defined in /home/test1/func.php. Test1, while I'm in Test2, and that never ever ever ever (...) includes *anything* from Test1. So the *Test1* func.php is still sitting somewhere in memory in the thread test2 is being loaded on - thus, include_once does not help, as the test2 func.php is NOT included. The weird thing is, $inc_done isn't defined either for the PHP thread, as when I tried the piece of code I quoted in my last message, the include_once still went through. How can this be happening? I do not know, but since a downgrade to 4.4.0 fixed it all back proper, I am seriously beginning to suspect a problem or undocumented (widely documented, at least) change in PHP 4.4.1 on FreeBSD ports. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue
It would also be helpful to see the mquery() script - maybe someone else may know more then! Well, mquery is simply mysql_query($query);, in the stipped-down version I've had to resort to for testing. Basically, does nothing, since even mysql_connect that USED to be at the start of func.php got removed in the tests. I'm quessing this is a FreeBSD 5.1-PHP 4.4.1 specific issue by now, but until now, no one on the FreeBSD mailing lists seems to have cried wolf, so I'll wait and see what on earth is going on... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 4.4.1 on Apache 2.0.x issue
I cant see this being an issue with PHP because it would do that for every function, have you tried using a different function, something simple say, I've been trying it in various ways - for the simplest functions, it takes hundreds of request to appear, for the more involved things which employ database functions, for example, it only takes 5-10 requests. The main issue is that all of this has been working for over 3 years, let alone tiny problems with apache/openssl upgrades, but there has been nothing like the upgrade of PHP 4.4.0 to 4.4.1 - which is what makes me wonder, what DID change so radically in PHP 4.4.1, or is it just a porting problem? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.4.1 on Apache 2.0.x issue
Hi list, after upgrading to PHP 4.4.1, I'm having the following problem: Apache is running in prefork mode. index.php includes func.php, which defines some functions and connects to MySQL. For a while (1-2 requests) everything runs ok, except mysql sockets keep stacking up. And then - wham, suddenly, I'm getting errors: Cannot redeclare mquery() (previously declared in /home/test/func.php:9) in /home/test/func.php on line 9 If I wait a few seconds, it works for a couple of requests again. And then the error is back. What on EARTH is happening? My wild guess is, somehow the memory gets shared, and the previous script is still loaded into a thread when the new one is called, but how can this be happening? I would greatly appreciate any advice... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: proc_open, fwrite, 16384 bytes magic
In this case are you sure that the file is being sent via proc_open()? can you provide a simplified script that does this? Sure, here's a test script, the output from it, and a few words on the email I receive: ?php $descriptorspec = array( 0 = array(pipe, r), 1 = array(pipe, w), 2 = array(file, /tmp/error-output.txt, a) ); $text = ; for ($i=0; $i10240; $i++) $text.=1; $text.=END\n; $doccmd = /usr/bin/qmail-inject; $res = proc_open ($doccmd, $descriptorspec, $pipes); fwrite ($pipes[0], TO: [EMAIL PROTECTED]); echo fwrite ($pipes[0], $text).\n; echo fwrite ($pipes[0], $text).\n; fclose ($pipes[0]); ? The output is: 10244 6109 Now, that's not counting the first TO: plus two \n's. Altogether it always sums up to 16384 bytes. In the email I receive, it honestly shows exactly the amount of data fwrite() claimed to have written, and not a symbol more. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] proc_open, fwrite, 16384 bytes magic
can you proc_open() anything else and get it to accept more than 16KB ? also 4.4.1 is out. No, I've just tried the same with /bin/cat, I get the same result, i.e.: ?php $descriptorspec = array( 0 = array(pipe, r), 1 = array(pipe, w), 2 = array(file, /tmp/error-output.txt, a) ); $text = ; for ($i=0; $i10240; $i++) $text.=1; $doccmd = /bin/cat; $res = proc_open ($doccmd, $descriptorspec, $pipes); echo fwrite ($pipes[0], $text).\n; echo fwrite ($pipes[0], $text).\n; fclose ($pipes[0]); ? The output is: 10240 6144 which makes up exactly the magic 16384 bytes. So it's certainly not a qmail issue. Any ideas? :/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] proc_open, fwrite, 16384 bytes magic
Sorry, as a follow-up, I just realized that from 'cat' I AM finally getting an error in the log file, which will perhaps help trace the issue: cat: stdout: Broken pipe The output is: 10240 6144 which makes up exactly the magic 16384 bytes. So it's certainly not a qmail issue. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] proc_open, fwrite, 16384 bytes magic
Hi everyone, I've ran into a rather strange problem with Apache 2.0.x, PHP 4.4.0, FreeBSD. When I proc_open qmail-inject, the first 16384 bytes from a buffer are accepted perfectly, which makes it an exact 16 KB. If a buffer is larger, the rest is discarded. No errors appear anywhere - and I think I've looked just about everywhere I could think of by now. This problem does not manifest itself on a different installation of Apache 2.0.x, PHP 4.3.8, SUSE Linux, but tested against postfix, up to sizes of 95 KB. I've searched Google all over, but could not find any hints. My best guess so far is that I'm missing something in configuration directives, or it's a qmail problem - although, with qmail-inject fed via cat, everything works just fine, regardless of size. I would be grateful for any hints. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie question regarding forms and drop down list
I am pretty new to php, so if I am asking a poor question, please forgive me. I have a few input forms using html and php that will take input from text boxes and then put that input into a MySql database. All of the information for the form is put in between a form method element. When I try to add code for a drop donw inside the form method element, the code doesn't work, and I get a parse error. The code will work outside the element. I assume I am just missing something dumb. Could someone please enlighten me. I can post my code if it will help. Thanks, Max Krone -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie question
Hello all, I am new to php programming and web programming in general. I have created a php file that if it works will create a simple form for inputing contact information and then once the submit button is pressed, the information is saved into a MySQL database. When I try to submit, I get no error messages, but no data goes into the MySQL table. I have verified that my MySQL User and Password are correct and I believe I am actually connecting to the database. Please look at what I have created and tell me what I am doing wrong, what I can do better, why I am an idiot, et .al. Thanks, Max ?php if ($_POST[FirstName] == ) { $display_block = h1Add an Entry/h1 form method=\post\ action=\$_SERVER[PHP_SELF]\ PstrongFirst/Last Names:/strongbr input type=\text\ name=\FirstName\ size=30 maxlength=75 input type=\text\ name=\LastName\ size=30 maxlength=75 PstrongAddress:/strongbr input type=\text\ name=\Address\ size=30 PstrongCity/State/Zip/strongbr input type=\text\ name=\City\ size=30 maxlength=50 input type=\text\ name=\State\ size=5 maxlength=2 input type=\text\ name=\Zip\ size=10 maxlength=10 PstrongTelephone Number:/strongbr input type=\text\ name=\phone\ size=30 maxlength=25 PstrongEmail Address:/strongbr input type=\text\ name=\email\ size=30 maxlength=150 Pinput type=\submit\ name=\submit\ value=\Add Entry\/p /FORM; } else if ($_POST[FirstName] != ) { //time to add to tables, so check for required fields if (($_POST[FirstName] == ) || ($_POST[LastName] == ) || ($_POST[city] == ) || ($_POST[State] == ) || ($_POST[Zip] == ) || ($_POST[phone] == ) || ($_POST[email] == )) { header(Location: addentry.php); exit; } //connect to database $conn = mysql_connect(localhost, user, password) or die(Failure to attach to database); mysql_select_db(database, $conn) or die(Failure to attach to database); //add to first and last name $add_table = INSERT into table values (NULL, '$_POST[FirstName]', '$_POST[LastName], '$_POST[Address], '$_POST[City], '$_POST[State], '$_POST[Zip], '$_POST[phone],'$_POST[email]); mysql_query($add_table) or die(mysql_error()); } ? HTML HEAD TITLEAdd an Entry/TITLE /HEAD BODY ?php echo $display_block; ? /BODY /HTML -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: merge array
Thanks for your help. Lucian Cozma [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... That should do it: ?php $x = array(3,4,6,8); $y = array(10,20,40,10); $tmp = $x; rsort($tmp); $n = $tmp[0]; $newArr = array(); $newArr = array_fill(0, $n-1, 0); for($i=0;$icount($x);$i++) { $newArr[$x[$i]-1] = $y[$i]; } print_r($newArr); ? Max [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello all, I have two arrays as follows: $x = array(3,4,6,8); $y = array(10,20,40,10); I need these arrays could be merged with '0' in between. Result expected : $x = array(1,2,3,4,5,6,7,8); $y = array(0,0,10,20,0,40,0,10); Can anybody help me ? Thanks in advance. Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] merge array
Hello all, I have two arrays as follows: $x = array(3,4,6,8); $y = array(10,20,40,10); I need these arrays could be merged with '0' in between. Result expected : $x = array(1,2,3,4,5,6,7,8); $y = array(0,0,10,20,0,40,0,10); Can anybody help me ? Thanks in advance. Max
[PHP] change array
Hello all, $x = array(03,04,08,10); $y = array(100,110,120,130); I need these arrays be converted to: $x = array(01,02,03,04,05,06,07,08,09,10,11,12,13); $y = array(0,0,100,110,0,0,0,120,0,130,0,0,0); Can somebody give an answer ? Thanks. Max
[PHP] Files upload
Is there any difference between using move_uploaded_file(... or if(is_uploaded_file... ... copy( (security hazards etc.)? WBR, Max 'AMiGo' Gashkov [EMAIL PROTECTED] ]=[ http://diary.otaku.ru/amigo Distributed.net participant [408228][RC5-72] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Files PHP in tmp ?
Are they things like php45a45s879a787g54a21s3a12g3a21s31a3a? If so, yup i know the feeling 297,548,197 of them using up 128GB of storage on my HD! Don't worry They're just sessions Oh and don't worry Unless your site is a huge wooper with 500,000 - 1,000-,000 users loggin in a day, you won't get huge amounts lol Nico [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I've a lot of files named php in my tmp folders .. What's these files ? Nico -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Making a file manager with PHP?
Hello there. Basically I'm trying to make a file manager with PHP. Here's what I need to do Ok I have artists and coders working for my site No FTP I want them to be able to upload/download files from me as and when they please without having to email me the files The files that will be uploaded and downloaded are with these extentions .htm .html .php .phps .jpg .gif .swf I can scrape together the upload bit, but the download bit just runs the file rather than brings up the download feature of the web browser. How can I make it download it? TIA!
[PHP] Re: How do you update multiple rows at the same time?
You on MySQL? If so do this UPDATE tblName SET firstcol = '$var41stcol', $secondcol = '$var42ndcol' and so on Steve Jackson [EMAIL PROTECTED] wrote in message 01c2c3a0$27591b50$[EMAIL PROTECTED]">news:01c2c3a0$27591b50$[EMAIL PROTECTED]... I am having trouble with this. I need to update 1column in a variable number of rows depending on how many categories are in my database at a given time. Can anyone provide any pointers or example code Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com/ http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] total file size
It can be done with ASP and JSP. ROFLMFAO! No it shouldn't be reported to their bugs database! It's not a bug! It just isn't a feature of PHP! You could suggest it to them though... Victor [EMAIL PROTECTED] wrote in message 01c2c34a$0ee9e140$237b7018@JUMPY">news:01c2c34a$0ee9e140$237b7018@JUMPY... With what then? Why not? Should this be a bug filed in their bugs database? - Vic -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 2:00 PM To: Victor; [EMAIL PROTECTED] Subject: Re: [PHP] total file size yes, it is possible, but not with php. Jim - Original Message - From: Victor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 22, 2003 8:10 PM Subject: [PHP] total file size Is there a way to find out total upload file size from a file uploaded though an html form? I figure if I know the total size, then I can just consistently poke at the file being uploaded and math a progress bar for the file being uploaded, of course, this all hangs upon the ability of getting the total file size BEFORE it is uploaded. It IS possible I have seen it done with JSP; anybody can help me with this? Thanks - Vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I'm new in PHP
www.php.net/manual Beogradjanin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Zdravo php-general, Hi I have setup PHP Apache MySql. I;m new in this stuff where can I learn hot to make web pages in PHP...??? +++Info About this E-mail+ +Poruka je napisana u 16:24:13 + +Dana Sunday, January 26, 2003 + +Files in this E-mail massage+ +none + ++ +Email: [EMAIL PROTECTED] + ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Posting data using fsockopen() causes session problem
Hi, I finally figured out how to use fsockopen() to post data when my server responded with a Document Moved error. I knew the document was where I said it was ... After many hours I realised that the location the document had allegedly been moved to was the login screen that the user would be redirected to if they did not have a valid session id. I removed the session handling and ... success! This is not an acceptable solution because I need the session to be valid. Any help would be most appreciated. Thanks, Max -- Oz Impact Multimedia Innovate, Immerse, Inspire www.ozimpact.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] case statement?
Hi- I was wondering if php had a case function? Instead of building a large if/elseif/else block I would like to do a case $page in (list). Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pcre pattern match help
Hi- I would like to do a pattern match against a string, sometimes this pattern will include the full string, and sometimes it will not, if the pattern does not include the second match I still want to get the first pattern match. Below is my code, and the results I am looking for. Thanks in advance, Max preg_match (/\:\[(\S+)\]\:(\S*)/,$transport,$matches); print_r ($matches); $tranport = :[127.0.0.l); print_r ($transport) - Array ( ) ** I want this to return 127.0.0.1 $transport = smtp:[64.70.36.4]:25; print_r ($transport) - Array ( [0] = :[64.70.36.4]:25 [1] = 64.70.36.4 [2] = 25 ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Verisign Credit Card Processing with PHP
Hi- I was wondering anyone out there is using the verisign payflo product with php and could share their experiances with me. Are there good alternate choices that I should be looking at? Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regex for fqdn test
Hi- I was wondering if someone could help me with a regex to test for a valid domain name (foo.com). Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Socket_connect() timeout
Hi- Warning: socket_connect() unable to connect [60]: Operation timed out in /usr/home/maxc/public_html/admin/functions.inc on line 66 Is there any way to time out this function? I only want to wait 5 seconds. Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Socket_connect() timeout
Warning: socket_connect() unable to connect [60]: Operation timed out in /usr/home/maxc/public_html/admin/functions.inc on line 66 Is there any way to time out this function? I only want to wait 5 seconds. Thanks in advance, Max Johannes Schlueter [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Friday 13 December 2002 21:30, Max Clark wrote: I found the socket_create function that is listed as experimental and requires a re-compile of php. Is there a built in way to perform this kind of test? Based upon the second example on http://www.php.net/manual/en/ref.sockets.php : echo h2TCP/IP Connection/h2\n; /* Get the service for TCP-Port 25. */ $service_port = getservbyport (25, 'tcp'); /* Get the IP address for the target host. */ $address = gethostbyname ('www.example.com'); /* Create a TCP/IP socket. */ $socket = socket_create (AF_INET, SOCK_STREAM, 0); if ($socket 0) { echo socket_create() failed: reason: . socket_strerror ($socket) . \n; } else { echo OK.\n; } echo Attempting to connect to '$address' on port '$service_port'...; $result = socket_connect ($socket, $address, $service_port); if ($result 0) { echo socket_connect() failed.\nReason: ($result) . socket_strerror($result) . \n; } else { echo OK.\n; } johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie - decimal places in arthimetic functions
Hi- How can I control the decimal places returned by an arthimetic function? I would like this divsion function to only return two decimal places (rounded up). $calcsize = $value / $oneGig; Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Testing smtp server
Hi- I would like to open a connection to tcp port 25 (smtp) as a conditional in a script (if succeeds to this, else to that). I found the socket_create function that is listed as experimental and requires a re-compile of php. Is there a built in way to perform this kind of test? Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions: Trigger a new one, Expire an old one
Hi, I use php 4.2.3 with session.auto_start = 1 in php.ini What I use with URL session : $_SESSION= array(); unset($_GET[session_name()]); session_destroy(); Header(Location: next_script.php); with cookie session : $cook_param= session_get_cookie_params(); $life_time= $cook_param['lifetime']; $path= $cook_param['path']; setcookie(session_name(),,$life_time,$path); $_SESSION= array(); session_destroy(); mb Jonathan Sharp wrote: Ok, here is my solution: I wanted this to be as self contained as possible: function clean() { /* get name of session find session id */ $name = ini_get('session.name'); $sessid = ( !$_COOKIE[$name] ? ( !$_GET[$name] ? ( !$_POST[$name] ? false : $_POST[$name] ) : $_GET[$name] ) : $_COOKIE[$name] ); /* run query now to see if sesion is expired, if yes */ unset( $_COOKIE[$name] ); unset( $_GET[$name] ); unset( $_POST[$name] ); unset( $_REQUEST[$name] ); } clean(); session_start(); Since _COOKIE/etc needs to be UNSET before session_start is called and re-calling session_start does sqat, the above code (not all of it but general idea) 'finds' the session id (session_id() has no effect until session_start is called) and tests to see if it's expired, if so, it 'kills' all possible locations for session_start() to find an id. *simple*... (or something like that) -js Chris Shiflett wrote: Yeah, John hinted at the answer there. You just need to make the session ID go away prior to starting the session . Just unset it or set it to the empty string or whatever you want to do. It is probably either $_COOKIE[PHPSESSID] or $_GET[PHPSESSID]. Chris John W. Holmes wrote: Simple question. If a users session expires or has timed out, how do I 'force' php to generate a new sessionId? Session_start() ?? If there isn't a session id present, it'll create one. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Postgres-Transaction-user_ignore_abort-Connection stop by the client
Hi, I use Postgresql 7.2.2 + php 4.2.3 and I meet a problem with transaction and connections interruption. The application is the famous example of the bank accounts and the money transfers. I consider a table named DEAL where each transaction is saved. Each tuple has an id number as key. When a tuple is added, the maximum value of id is computed, and increased by one to determinate the key of the next tuple. My script php follows this steps : ignore_user_abort(0|1) Compute the key - v BEGIN WORK UPDATE the first bank account with v (credit) sleep(300) UPDATE the second bank account with v+1 (debit) COMMIT WORK While the sleep, the client may use the STOP button on his browser and stop the connection. I tried to execute exhaustive tests : ignore_user_abort(0) or ignore_user_abort(1), with or without transaction, with or without rollback. For these tests, I follow two steps : 1/ the client execute the first request but stops the connection while the sleep instruction. 2/ with pgaccess, I read the content of DEAL 3/ the client executes a new request without interruption 4/ the result is displayed on the browser and checked with pgaccess TEST 1 request 1 * ignore_user_abort(0) Compute the key - v=10 BEGIN WORK UPDATE the first bank account with v as key (credit) sleep(300)-- INTERRUPT UPDATE the second bank account with v+1 as key (debit) COMMIT WORK Result : nothing new in the database (with pgaccess) request 2 * ignore_user_abort(0) Compute the key - v=10 BEGIN WORK UPDATE the first bank account with v (credit) UPDATE the second bank account with v+1 (debit) COMMIT WORK Result : the request 1 is executed now ! and while the key (v=10) is the same, the request 2 fails. Problem : why the whole first request is taking into account now ? TEST 2 The same by removing BEGIN and COMMIT. The first request : only the first update (before the stop) is executed The second request is executed correctly. Problem : ignore_user_abort is called with 0, so why the execution of the script for the first request doesn't continue ? TEST 3 and 4 The tests 3 and 4 reproduce the test 1 and 2 by using ignore_user_abort(1). The results are absolutely the same ! TEST 5 and 6 The tests 5 and 6 reproduce the test 1 and 2 by using ROLLBACK if ( connection_aborted() ) { ROLLBACK WORK; exit } is added after the sleep. The results are absolutely the same again ! I find the results very strange, isn't it. In advance, thanks for your help. mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session and URL
I meet a probleme with the session. My example considers 2 scripts : - the first script (test_session_url.php) opens a session (session.auto_start=1 in php.ini), defines a counter, prints some information and an hypertext to execute the second script which has session id as parameter ?php $_SESSION['count']= 1; echo HTMLTITLESession and URL/TITLEBODY; echo hello ! : it's .$_SESSION['count']. visit; echo brbr Information :br; echo ---name = .session_name().br; echo ---id = .session_id().br; echo A HREF=nextpage_session_url.php?; echo session_name().=.session_id(); echo next page/A; echo /BODY/HTML; ? - the second script (nextpage_session_url.php) validates the parameter (set, empty, value), add one to the counter and then check the value of the counter. It makes the same thing 5 times by printing an hypertext with itself and after, it prints an new hypertext to come back to the first script by beginning a NEW SESSION. ?php if ( !isset($_GET[session_name()]) || empty($_GET[session_name()]) ) { echo HTMLTITLESession and URL/TITLEBODY; echo parameter error; echo /BODY/HTML; exit; } $id= $_GET[session_name()]; if ( $id != session_id() ) { echo HTMLTITLESession and URL/TITLEBODY; echo value of session id error : BR; echo parameter : $id and current session_id :.session_id().--; echo /BODY/HTML; } else { $_SESSION['count']++; if ( $_SESSION['count'] 5 ) { $_SESSION= array(); session_destroy(); session_start(); // problem is the same with or without this instruction include(test_session_url.php); } else { echo HTMLTITLESession and URL/TITLEBODY; $cpt = $_SESSION['count']; echo hello ! : it's .$_SESSION['count']. visit; echo brbr Information :br; echo ---name = .session_name().br; echo ---id = .session_id().br; echo A HREF=nextpage_session_url.php?; echo session_name().=.session_id(); echo next page/A; echo /BODY/HTML; } } ? Now my problem : NEVER a new session (with a new ident) is created. However I execute $_SESSION= array(); and session_destroy(); I use php 4.2.3 and apache 1.3.26 For testing, I configurate my browser to refuse the cookies (but the problem is the same when I accept the cookies). Perhaps something to change in php.ini ? In advance thanks. mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Erase the cookie sessions
Hi, I wish test the session. I use php 4.2.3 et session.auto_start is 1. My first example is : html head titleSession example/title body ?php if ( !isset($_SESSION['count']) ) { $_SESSION['count']= 1; } else { $_SESSION['count']++; } if ( $_SESSION['count'] 5 ) { $cpt = $_SESSION['count']; echo hello ! : $cpt times; else { setcookie(session_name(),); // setcookie(session_name(),,,/); $cpt = $_SESSION['count']; echo Session changeBR; echo hello ! : $cpt times; session_unset(); session_destroy(); } ? /body /html I don't find the solution to use setcookie ; I try the two instructions above (the script is correct without the else). An idea ? In advance, thanks. mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Erase the cookie sessions
Marek Kilimajer wrote: You miss closing } Thanks, but that's a copy-paste error and that's not my problem really. mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Erase the cookie sessions
Max Buvry wrote: Marek Kilimajer wrote: You miss closing } Thanks, but that's a copy-paste error and that's not my problem really. mb Solved : my solution for information (before test with url !) ?php if ( !isset($_SESSION['count']) ) $_SESSION['count']= 1; else $_SESSION['count']++; if ( $_SESSION['count'] 5 ) { $cook_param= session_get_cookie_params(); $life_time= $cook_param['lifetime']; $path= $cook_param['path']; setcookie(session_name(),,$life_time,$path); echo HTMLTITLESession and cookie/TITLEBODY; echo session changeBR; echo hello ! : it's .$_SESSION['count'].times and the lastBR; $_SESSION= array();//session_unset(); session_destroy(); echo /BODY/HTML; } else { echo HTMLTITLESession and cookie/TITLEBODY; $cpt = $_SESSION['count']; echo hello ! : it's .$_SESSION['count'].times; echo brbr Information :br; echo name = .session_name().br; echo id = .session_id().br; echo /BODY/HTML; } ? The problem was setcookie execution after the header sending. mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookie
Hi, I use : apache 1.3.26, php 4.2.3, postgresql 7.2 (under solaris 7). I attempt to modify my old sources which run with the previous versions and I meet a problem with the cookie. I read that we can see the contents of a cookie with 2 methods : echo $testcookie echo $_COOKIE[testcookie] For me, only the second method runs. An idea ? In advance, thanks mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie
Thanks for your response. The doc isn't explicit when it explains this two methods and don't focus on the register globals function for the first method. So I use the second method only. Thanks mb Bob Irwin wrote: I'm pretty sure this is a global variables problem. There is an option in your ini.php file that refers to 'global variables' You need to set this on, otherwise reference to them with the absolute variable name. Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom - Original Message - From: Max Buvry [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 02, 2002 2:37 AM Subject: [PHP] Cookie Hi, I use : apache 1.3.26, php 4.2.3, postgresql 7.2 (under solaris 7). I attempt to modify my old sources which run with the previous versions and I meet a problem with the cookie. I read that we can see the contents of a cookie with 2 methods : echo $testcookie echo $_COOKIE[testcookie] For me, only the second method runs. An idea ? In advance, thanks mb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ Scanned by PeNiCillin http://safe-t-net.pnc.com.au/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Please, Help dynamicaly creating an Array
Thanks Marek, That's exactly what I was looking for. I also found another solution, which was to build a second array with the information I want and merge the two arrays together with +. I like eval better :) thanks again. For anyone that is interested this works too. $a = 'THREE'; $b = 3; $data1 = array('ONE'=1,'TWO'=2); $data2[$a] = $b; $test = $data1 + $data2; -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 18, 2002 1:54 AM To: PHP Subject: Re: [PHP] Please, Help dynamicaly creating an Array Try eval(), like this: $str= 'THREE'=3, 'FOUR'=4; eval(\$data2 = array('ONE'=1,'TWO'=2,$str);); Max Sullivan wrote: I am trying to populate array values and keys from a variable with no luck. Lets say I have the following array. $data1 = array('ONE'=1,'TWO'=2,'THREE'=3,'FOUR'=4); And I want to create part of the array with the string below: $str= 'THREE'=3, 'FOUR'=4; $data2 = array('ONE'=1,'TWO'=2,$str); How can I create $data2 to work the same as $data1. When I try the above for $data2 a new key is created ([0]) for $str. And I end up with ...'TWO'=2, [0] = 'THREE'=3, 'FOUR'=4. It doesn't interpret the variable how I expect it to, instead it see's $str as a value. I guess the question is how can I make php use the string literally. I've tried everything I can think of and I think my head is about to explode :). Is it possible to create an Array this way? Any help is appreciated!! print_r($data1): Array ( [ONE] = 1 [TWO] = 2 [THREE] = 3 [FOUR] = 4 ) print_r($data2): Array ( [ONE] = 1 [TWO] = 2 [0] = 'THREE'=3, 'FOUR'=4 ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Please, Help dynamicaly creating an Array
I am trying to populate array values and keys from a variable with no luck. Lets say I have the following array. $data1 = array('ONE'=1,'TWO'=2,'THREE'=3,'FOUR'=4); And I want to create part of the array with the string below: $str= 'THREE'=3, 'FOUR'=4; $data2 = array('ONE'=1,'TWO'=2,$str); How can I create $data2 to work the same as $data1. When I try the above for $data2 a new key is created ([0]) for $str. And I end up with ...'TWO'=2, [0] = 'THREE'=3, 'FOUR'=4. It doesn't interpret the variable how I expect it to, instead it see's $str as a value. I guess the question is how can I make php use the string literally. I've tried everything I can think of and I think my head is about to explode :). Is it possible to create an Array this way? Any help is appreciated!! print_r($data1): Array ( [ONE] = 1 [TWO] = 2 [THREE] = 3 [FOUR] = 4 ) print_r($data2): Array ( [ONE] = 1 [TWO] = 2 [0] = 'THREE'=3, 'FOUR'=4 ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Enabling PHP in Apache when PHP is linked INTO the server?
I have an Apache server built with mod_php4.c linked into the executable. e.g. bash-2.03$ httpd -l Compiled-in modules: http_core.c mod_env.c mod_php4.c mod_perl.c What changes do i need to make to http.conf before I can use php in web pages which will work please? -- Thanks lots -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Enabling PHP in Apache when PHP is linked INTO the server?
Is that all? Probably something like: AddType application/x-httpd-php .php4 .php3 .phtml .php .inc AddType application/x-httpd-php-source .phps On Thursday 28 March 2002 23:40, Max Wilson wrote: I have an Apache server built with mod_php4.c linked into the executable. e.g. bash-2.03$ httpd -l Compiled-in modules: http_core.c mod_env.c mod_php4.c mod_perl.c What changes do i need to make to http.conf before I can use php in web pages which will work please? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and APACHE VirtualDomains
We have PHP and APACHE (1.3.19) installed and an instance of apache is running with php support enabled. I need to set up another instance of httpd using a seperate config file. However I cannot get PHP support enabled. I cannot find where the PHP modules are. I called a phpinfo() on the instance which is already running and it returned: It said the config file was in /usr/local/lib/php.ini I think i am looking for the module mod_php4 but I cannot see where it is. Any ideas? ALSO I'm having lots of trouble with VirtualDomains. I have an instance second httpd running (without php) on a port other than 80 and it runs fine. But whenever I add VirtualDomain to the httpd.conf the main page gets replaced by the main page of the VirtualDomain. This is really anoying me is there anything I should check for? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $HTTP_COOKIE_VARS
I've tried using $HTTP_COOKIE_VARS to get information about the cookie has been passed to the current script but I always get a cookie size of 1 containing no information. I have also tried using $_COOKIE but with no success. I'm running apache1.2.23 and php 4.1.2. Suggestions? Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mixed type
While looking thru php funcions (mixed ora_getcolumn ( int cursor, mixed column) in partucular) I came across type MIXED. What does that mean? There is no such type mentioned in the php docs under TYPES section. thanks. max. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and mySQL
I have a little problem when trying to count the number of results returned in a mysql query. I was using mysql_num_rows() to do it with no problems, but this isn't as quick as using mySQL's COUNT(*), or so I have been told so I swtiched. Here's a snipit of the code... $sqlinfo = SELECT username, COUNT(username) as count FROM usertable WHERE username='me' GROUP BY username; $sqlresult = mysql_query($sqlinfo) or die(mysql_error()); $count = mysql_result($sqlresult,0,count); if ($count = 0) { FAILED } else { while ($row = mysql_fetch_array($sqlresult)) { $username = $row['username']; } } The count value is set correctly but: when the while() loop is executed...no values are set (there are a lot more, but I shortened it for spaces sake). So, $username is null. If I remove the $count line, it worksany suggestions? Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date
Hi to all, I'm using this to get date from mySQL database: ... $p_datum = $row[mydatefield]; $mydate = getdate($p_datum); $month = $mydate['month']; $mday = $mydate['mday']; $year = $mydate['year']; ..but I allways get 1/1/1970. Can anybody help me? -- 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] Die
Hi, If I use die or exit() it break execution of php script but also browswer stop parsing html code. How to avoid this? Regards.Max. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ASP aplication object
Hi, Is exist something similar in PHP? Regards. Max. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problem
I'm trying to update from the CVS...and when I try to make I get the following error.. [root@freedom:~/php4]# make Making all in Zend byacc -p zend -v -d ./zend_language_parser.y -o zend_language_parser.c usage: yacc [-dlrtv] [-b file_prefix] [-o output_filename] [-p symbol_prefix] filename *** Error code 1 Stop in /usr/home/maxmouse/php4/Zend. *** Error code 1 Stop in /usr/home/maxmouse/php4. Now, here's the specs on my machine FreeBSD 4.4-Release, libtool-1.4.1, bison-1.30, autoconf-2.13, automake-1.4-p5. Any ideas? Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP and Image Magick for FreeBSD
Hello, Looking for statically linked pre compiled ImageMagic binaries (convert, mogrify, ect.) to run from the cgi, with PHP exec on FreeBSD. 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] Re: Array Elements While Loops
Hi. Don't forget to increment j : //loop to check for bad email addresses: $j = 0; $flag = 0; while ($j count($User)){ if (($User[$j]!=)!eregi(^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$, $User[$j])) { $flag = 1; $errorNo = $j + 1; } $j++; } -- TURPIN Jean Max STUDENT College of Reunion's Island -- 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: Warning: Sybase message: Incorrect syntax near 't'.
Caleb Carvalho wrote: $sybase_query=INSERT into problem VALUES('$product','$pro_title','$description','$solution'); $sybase_result=sybase_query($sybase_query); Hi try this : $sybase_query=quoted_printable_decode(INSERT into problem VALUES('$product','$pro_title','$description','$solution')); $sybase_result=sybase_query($sybase_query); -- TURPIN Jean Max STUDENT College of Reunion's Island -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP4 in .html. HELP!
Please, help. I write in httpd.conf: AddType application/x-httpd-php .html And see result in browser - browser get reply with content-type: application/x-httpd-php and suggest to save it. If I rename script to *.php and call it from browser it works Ok. How and where can I explain httpd and apache reply with content-type: text/html for .html PHP4 documents. Apache Version Apache/1.3.20 PHP/4.0.6 Could you help me, please. -- Max Kluev -- 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] Attaching stuff
I want to be able to include a graphic or something of that sort in a form mail (using mail() from form). Is this possible? Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Setcookie
Is there any way to see whether or not the cookie setting has actually worked without going to another page? I suspect there isn't but I'd like confirmation ;) Cheers Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Cookie Help
Hi, I have a problem with setting cookies...I am able to set cookies and retreive the information when using IE but not netscape. I'm not totally sure what the problem is. Here is the syntax that I am using, any suggestions are welcomed. $cookiedata = Mmmm; $time = mktime()+900; $expire = date(l, d-M-y H:i:s, ($time)); setcookie(cookiemonster, $cookiedata, $expire, /, domain.com., 1); It needs to be secure, hence the 1. Also, I need the domain to be domain.com and it cannot be www.domain.com. Can anyone help me at all? Thanks! Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] webmail
On Mon, 9 Jul 2001, Adrian D'Costa wrote: Hi, I am trying to write a web-based email client for my site (or are there any samples) using php4 and POP3. I have a book on professional PHP but that sample uses IMAP which is not installed on my system. Could anyone tell me where I can get some samples or how to proceed with this project. There are several good sources on the web which carry information about ongoing opensource projects. To cite three: http://www.freshmeat.net/ http://php.resourceindex.com/ http://sourceforge.net/ The one which I use which matches your requirements (non-PHP, perl-module driven) is NS WebMail, one which I use and gives basic webmail capablities, though missing some desired functionality (sort on date, sender, or subject; default sort is reverse chrono). It's relatively easy to install. http://nikosoft.free.fr/nswm.htm For freshmeat's listing check here: http://freshmeat.net/search/?q=webmail TIA Adrian Max Pyziur BRAMA - Gateway Ukraine [EMAIL PROTECTED] http://www.brama.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 as cron
Either recompile PHP as a cgi OR use lynx to do it so: lynx -dump http://www.mysite.com/myscript.php You can then collect the output in the usual ways. M -- From: AJDIN BRANDIC[SMTP:[EMAIL PROTECTED]] Sent: 21 June 2001 09:07 To: [EMAIL PROTECTED] Subject: [PHP] php as cron Hi I have PHP installed as Apache module but I want to run a cron job. I have .php script that works OK when executed through browser but is there any way I could execute it through a cron job. Ajdin -- 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] multiselects and arrays
Hi. Why doesn't PHP convert mutiselect values with plain names (not array-like) to arrays. Is there any reason to not doing this? Example: I have a page with multiselect, which name is SEL1 (I cannot use square brackets because I need to use a JavaScript on the page, so, it's not allowed in variable names to contain [ ] ). When browser submits this page, and if there are sew values selected in this multiselect, it just sends this values along to each other with same name. (such as in case of GET method: http://somehost.com/index.php?SEL1=1SEL2=2) So, why not parse this, and in case if there are more than one variable with same name, convert this variable to array, and put all the values there? Thanx -- 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] Forms and PHP_SELF
Chad Guilette [EMAIL PROTECTED] wrote in message 000701c0d962$d28fb670$0100a8c0@optimus">news:000701c0d962$d28fb670$0100a8c0@optimus... I'm currently working on a project and I've come across a problem which I'm sure has been discussed several times before but I still need some assistance on it. I have a page with a form whose action is $PHP_SELF so the form and the form action are all in the same pagethis works fine but in the form action a message is displayed stating success or failure of the insertion of data into a database and the user is redirected by means of a meta refershduring this time if the user refreshes the page the data is resubmitted againthe user can do this repeatedly Some people have suggested that I use headers but I cannot do this at this point because I've already sent the header... Well You can use output buffering see ob_start(); others have suggested I use some variable $script_ran_count = 1 then run and after increment so a test of it would be false...this had no effect others have suggested javascript... I'm really baffled...how can I have a self-submitting form page that has a display message and a meta redirect but if the user refreshes the page stop the resumission of data? Regards, Chad Guilette -- 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] ASP 2 PHP
On Wed, 9 May 2001, Brandon Orther wrote: Hello, I am looking at a complete database with it interface written in ASP. All of our company programs are written in PHP and that is what I want to use. I believe I remember seeing ASP 2 PHP converts before. Does anyone know of any. They don't have to work perfect just convert it with some bugs and I will fixes those. I've never tried it (though I have the rpms installed in the event one of my sites needs to use it), but I just saw on freshmeat.net that a new release of asp2php was released - http://asp2php.naken.cc/ is the link. Also it is using a MSSQL database if that helps at all. Thanks Brandon Max Pyziur BRAMA - Gateway Ukraine [EMAIL PROTECTED] http://www.brama.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] .doc to .txt
On Mon, 26 Mar 2001, Ankur Verma wrote: check out the microsoft word parser at www.wvware.com you can call this program ysing the exec() or system() function. also, search the mail archives for discussion on this topic in the very recent past. There is one utility which I find very helpful - 'catdoc'. It's homepage is: http://www.ice.ru/~vitus/catdoc/ hope that helps regards Ankur verma HCL Technologies Noida India Max Pyziur BRAMA - Gateway Ukraine [EMAIL PROTECTED] http://www.brama.com/ -Original Message- From: Siim Einfeldt aka Itpunk [mailto:[EMAIL PROTECTED]] Sent: Monday, March 26, 2001 5:41 PM To: [EMAIL PROTECTED] Subject: [PHP] .doc to .txt Hi all, I need to convert .doc files into text. I know it`s possible to do it by converting it in word, but I need to give the people of the site opportunity to upload a .doc file and then I need to display it (and not in another window, but rather 'in the site' like you would normally display some text). All the info, code examples, urls you can provide me conserning this one, I would appreciate it. And when answering, please send it to my private email as well, [EMAIL PROTECTED] Thank you in advance, Siim EInfeldt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]