[PHP] Re: Register_Shutdown_Function ??
I just upgraded from 4.1.1 to 4.2.1 -- didn't fix the problem. I'd be curious to know if other Windows users are having the same problem. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compressing my web pages?
I'm using IIS5.0 -- and PHP 4.2.1 -- I think there is a compression setting within IIS whereby the pages (before they are sent) are compressed, to be decompressed and then displayed by the browser (pending, of course, if that browser supports the HTTP 1.1 compression standard) -- My questions are; 1. How can I tell if IIS is compressing my PHP / HTML pages? 2. There are compression settings within the PHP.INI file -- what are these about, do I use these instead of the IIS compression?? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] file upload problem
The purpose of the function is to upload a file. It fails to upload despite not generating an error. I went into the php.ini file and found that the max file size was defaulted to 2mb. I increased this and it fixed the problem. -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 18, 2002 7:31 PM To: Rodney Davis Cc: [EMAIL PROTECTED] Subject: Re: [PHP] file upload problem On Sat, 18 May 2002, Rodney Davis wrote: I am trying to use the move_uploaded_file() function to upload files to a specific directory. It works fine with small .jpgs .txt etc etc but won't work with a large .mp3 file. Is this because it is too large? What can I do? You can tell us what won't work means. Do the police come to your door? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Output_Buffering ??
Can someone explain output_buffering to me? I looked on php.net -- but cannot find reference to it -- it's a setting in the PHP.INI file. In my *production* .ini version, the output_buffering tag is set to 4096 (4k) -- what exactly is the intent of this tag? What brought this question up was when I upgraded from 4.1.1 to 4.2.1, and this time decided to use the production level .ini file -- when I ran a script from my command line -- no output was appearing -- that is, I have print() functions throughout my looping script -- and it wasn't outputting -- I set the output_buffering tag to equal 0 -- and my looping script now displays the text I want it to. Is it that when a script exits or terminates that this 4k buffer gets flushed out (in this case) to my screen? What additional processing occurs if this tag is set to off, or 0 (zero) ? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Output_Buffering ??
Forget the question -- I found the link I needed: http://www.php.net/manual/en/function.ob-start.php Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can someone explain output_buffering to me? I looked on php.net -- but cannot find reference to it -- it's a setting in the PHP.INI file. In my *production* .ini version, the output_buffering tag is set to 4096 (4k) -- what exactly is the intent of this tag? What brought this question up was when I upgraded from 4.1.1 to 4.2.1, and this time decided to use the production level .ini file -- when I ran a script from my command line -- no output was appearing -- that is, I have print() functions throughout my looping script -- and it wasn't outputting -- I set the output_buffering tag to equal 0 -- and my looping script now displays the text I want it to. Is it that when a script exits or terminates that this 4k buffer gets flushed out (in this case) to my screen? What additional processing occurs if this tag is set to off, or 0 (zero) ? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ob_gzhandler? (compression)
Is there a listing somewhere that shows which web browsers support gz-encoded web pages? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_gzhandler? (compression)
If Im not mistaken, all the current and recent Micro$oft, Netscape friends support it. Jason Caldwell wrote: Is there a listing somewhere that shows which web browsers support gz-encoded web pages? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_gzhandler? (compression)
Even Lynx does. miguel On Sun, 19 May 2002, Gerard Samuel wrote: If Im not mistaken, all the current and recent Micro$oft, Netscape friends support it. Jason Caldwell wrote: Is there a listing somewhere that shows which web browsers support gz-encoded web pages? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to encode e-mail attachments, work with MIME
Hello all, I'm trying to write an script to fetch e-mail and save whatever attachments there are. Are there any articles or anywhere I can read about it? Thanks, Carlos Fernando Scheidecker Antunes Linux User #207984
[PHP] Non cachable php for use as an img src
Hello All, I want to return a gif from a php script. I want it to not be cachable anywhere not browsers, proxys etc. Actualy what I want to do is pass an existing .gif file as the output and do some database manipulation whilst I do so. A bit like a hit counter type system. img src=counter.php?site=1 Any help as to where I should start looking would be greatly appreciated. Henry. TIA. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHPBB2
Clearly the BB is designed to fill a page... it seems to have a minimum width, given the colums, images, etc etc that you can't really avoid... I'm not clear on the terms/licensing of the BB, but I'd try a mixture of: 1. editing the table code(s) it looks like the forums column can be shrunk down, which would reduce the overall size. 2. replacing some of the images and larger items with smaller ones 3. reducing the font size BTW - it's fine at 1024x768, so maybe it's *okay* for a certain % of your user base it wouldn't be for my target market tho. Justin French on 19/05/02 10:29 PM, r ([EMAIL PROTECTED]) wrote: Hi Guys and Girls, I have reciently set up PHPbb2 on our site, its great and no problems with the software but I am using frames so that a person can at any time jump out of the forum and came right back to the site but because of the frames the forum is pushed a lot to the right...(you have to scroll sideways to read everything) I know i hate when that happens if I visit a website and i'm pretty sure a lot of other people do too. Does anybody have any ideas on how i can make PHPBB's width a bit shorter? Its set up here: http://jumac.com/forums/ feel free to poke around and if you want post or write something etcnote though that I have not enabled a link to this location as yet because of the width thingso this section is not opened/dead/unknown I dont really know if this is a PHP question but I presume to make any changes I will have to dig into the PHP part right? ANY advise or help appreciated, Thanks in advance, -Ryan. /*Work...The sooner you fall behind, the more time you'll have to catch up.*/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compressing my web pages?
On Sunday 19 May 2002 14:27, Jason Caldwell wrote: I'm using IIS5.0 -- and PHP 4.2.1 -- I think there is a compression setting within IIS whereby the pages (before they are sent) are compressed, to be decompressed and then displayed by the browser (pending, of course, if that browser supports the HTTP 1.1 compression standard) -- My questions are; 1. How can I tell if IIS is compressing my PHP / HTML pages? If you have NN4.X use view source, if the source is empty then compression is active. This is because NN4.X has a problem/bug in viewing the source of a compressed page. If you're using some form of un*x then: lynx --mime_header http://www.domain.com/page.php -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* QOTD: I used to be an idealist, but I got mugged by reality. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PFDLib Function Problem
Hi, I'm making an script to make an PDF file width 2 windows fonts (Times new Roman and BmOCRB). When I add the second font the PDF file issn't created. here ar my font dec. $font = pdf_findfont($pdf, Times new roman, winansi, 1); if ($font) { pdf_setfont($pdf, $font, 12); } etc,etc,etc pdf_setfont($pdf, $font, 20); // till here it's ok etc,etc,etc $font2 = pdf_findfont($pdf, bmocrb, winansi, 1); // Here I get no error or any warning if ($font2) { pdf_setfont($pdf, $font2, 12); } -- Maurice -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh (part of) a page?
I want to refrech a part of my page (or the whole page) using PHP. Periodically, using a time delay. Should I use frames? Also I tried to use header (...) calling the same page with different name (and then back to the same page) but I got the warning: header already send. I tried also Location and pagename.php,FALSE but also with no results. I want to refresh some pictures (jpg) but I don't want to use multi picture jpg as the page will be to large. Makis Savaidis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Augmenting an old date
Thanks Tom, for the excellent help! Seems like 'strtotime' function was what was needed! Regards, Andre On Sunday 19 May 2002 01:06 am, you wrote: Hi A slightly more efficeint way :) ? $start = 2002-01-01; $expire = date(Y-m-d,strtotime($start +30 days)); echo $expire.br; ? Tom At 02:03 PM 19/05/2002, Andre Dubuc wrote: Two columns in my PostgreSQL db are type 'date' (formatted '-mm-dd'): 'start_date' and 'expiry_date'. What I cannot seem to figure out is how to augment the 'expiry_date' either by 30 days, 60 days, or 1 year. I've tried the date function in PHP (getdate) but the problem is that it appears to need a timestamp of today. The dates that I'm trying to augment are sometimes a year or two ago. This doesn't work: $new_expiry_date = $expiry_date(Y-m-d, mktime(0,0,0, date(Y), date(m), date(d) + 60))); I assume it's because the '$expiry_date' should be simply 'date', but that would give the current date which is not what is wanted. Is there anyway to set 'date' as '$expiry_date'? Suggestions, admonitions, and general advice will be greatly appreciated. Btw, I've searched the archives, and haven't found anything quite on this topic. Tia, Andre -- Please pray the Holy Rosary to end the holocaust of abortion. Remember in your prayers the Holy Souls in Purgatory. May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Please pray the Holy Rosary to end the holocaust of abortion. Remember in your prayers the Holy Souls in Purgatory. May God bless you abundantly in His love! For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with file read
Can someone look and help I have a function that returns the date in this format [10/Apr/2002:01:17:27 +1000] but I'm having trouble returning the last date in the file. $totalhits = count($fcontents); $filename = (combined_log); //open file $fcontents = file($filename); //read into array //print_r($fcontents); $limit = 1; for ($i = 0; $i $limit; $i++) //loop { $line = $fcontents[$i]; if (!empty($line)) { $currentdate = getmydate($line); //call function that returns first date. This is OK $currentdate = substr($currentdate, 1); $currentdate= substr_replace($currentdate, , -15); echo First day of access .$currentdate; $lastdate = getmydate($fcontents[count($fcontents)-1]); //**This is returning nothing? $lastdate = substr($lastdate, 1); $lastdate= substr_replace($lastdate, , -15); echo brLast day of access .$lastdate; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to encode e-mail attachments, work with MIME
Though I use php quite a bit for non-web scripting, for incoming e-mail you may be better off using perl. Check the MailTools modules @ CPAN: http://search.cpan.org/search?dist=MailTools Specifically at Mail::Internet http://search.cpan.org/doc/MARKOV/MailTools-1.44/Mail/Internet.pm Good luck, -J On Sun, 19 May 2002 19:33:41 +1200, Carlos Fernando Scheidecker Antunes wrote: Hello all, I'm trying to write an script to fetch e-mail and save whatever attachments there are. Are there any articles or anywhere I can read about it? Thanks, Carlos Fernando Scheidecker Antunes Linux User #207984 -- Jason Morehouse ([EMAIL PROTECTED]) Netconcepts LTD, Auckland, New Zealand * Linux: because rebooting is for adding hardware. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to encode e-mail attachments, work with MIME
Hello, On 05/19/2002 04:33 AM, Carlos Fernando Scheidecker Antunes wrote: Hello all, I'm trying to write an script to fetch e-mail and save whatever attachments there are. Are there any articles or anywhere I can read about it? You may find here these two classes that seem to do what you need: http://www.phpclasses.org/browse.html/package/347.html http://www.phpclasses.org/browse.html/package/64.html -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to encode e-mail attachments, work with MIME
Hello, On 05/19/2002 08:52 AM, Jason Morehouse wrote: Though I use php quite a bit for non-web scripting, for incoming e-mail you may be better off using perl. Check the MailTools modules CPAN: http://search.cpan.org/search?dist=MailTools Specifically at Mail::Internet http://search.cpan.org/doc/MARKOV/MailTools-1.44/Mail/Internet.pm And why do you think anybody would come to a PHP list to know about a Perl solution? It is not that there are no PHP solutions for that purpose. Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh (part of) a page?
On Sunday 19 May 2002 18:03, savaidis wrote: I want to refrech a part of my page (or the whole page) using PHP. Periodically, using a time delay. Should I use frames? You cannot refresh part of a page without resending the whole page. You can use frames. Also I tried to use header (...) calling the same page with different name (and then back to the same page) but I got the warning: header already send. *Read* the manual and see what it says about header() and header already send. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A great many people think they are thinking when they are merely rearranging their prejudices. -- William James */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with file read
On Sunday 19 May 2002 18:21, Josh Edwards wrote: Can someone look and help I have a function that returns the date in this format [10/Apr/2002:01:17:27 +1000] but I'm having trouble returning the last date in the file. [snip] $lastdate = getmydate($fcontents[count($fcontents)-1]); //**This is returning nothing? If that's not returning anything, did you you try breaking down in smaller statements? Build it up step by step and when it breaks you'll know what the problem is. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Flourescent lights are generating negative ions. If turning them off doesn't work, take them out and put tin foil on the ends. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A new GUI client for mySQL
greetings... Webyog has released mySQLyog, a win32 based Query analyzer. Its FREE and gives all the features that a mysql developer can ask for by a query analyzer. please visit www.webyog.com you can execute query of results of more than 10 records, supports multiple query execution and you can export your data into XML, HTML and CSV and can also import form a text file. It also allows you to excute last query and lets you add your favourite query in a personal folder with one click of mouse. So you dont have to save it and open it. Please take a look at it and feel free to send your suggestions to [EMAIL PROTECTED] Ritesh __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trouble with recocnizing jpeg files. Some work, some do not
Hi there, I do have trouble with finding out if a file is a jpeg or not. This is the command I am using: $_FILES[picture_location][type] works fine exept in one case: With Photoshop 6.0 I do open the jpeg (which workes fine) an save as jpeg as another file name. Then upload the new file. This returns a type called: application/octet-stream So what is this type anyway. I do know jpeg and jpg and pjpeg but octed-stream?! Thanx for any help on that, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 19 May 2002 14:18:19 -0000 Issue 1354
php-general Digest 19 May 2002 14:18:19 - Issue 1354 Topics (messages 98309 through 98363): Re: random quote script with flat file? (PHP Vault: Random Quote Script) 98309 by: Evan Nemerson 98311 by: Timothy J. Luoma Re: PHPBB2 98310 by: Ashley M. Kirchner 98351 by: Justin French file upload problem 98312 by: Rodney Davis 98332 by: Miguel Cruz 98343 by: Rodney Davis Classifieds Program 98313 by: Andrés de la Varga 98317 by: David Freeman xml parsing 98314 by: Gerard Samuel Re: Register_Shutdown_Function ?? 98315 by: CC Zona 98321 by: Jason Caldwell 98341 by: Jason Caldwell Read a var from stdin 98316 by: Rafael Perazzo 98337 by: Miguel Cruz Problem with 98318 by: webmaster.tececo.com 98319 by: Richard Baskett Re: date functions 98320 by: Tom Rogers 98328 by: Miguel Cruz Augmenting an old date 98322 by: Andre Dubuc 98324 by: SP 98325 by: Tom Rogers 98326 by: Tom Rogers 98330 by: SP 98355 by: Andre Dubuc bug in SLEEP() function... 98323 by: Jason Caldwell Re: Confused about which function to use with forms/database 98327 by: Dennis Gearon regex (preg_replace) 98329 by: Gerard Samuel 98335 by: Gerard Samuel Sessions 98331 by: Navid Y. 98334 by: Miguel Cruz php.net sl 98333 by: Jason Caldwell 98336 by: Miguel Cruz 98338 by: mike 98339 by: Jason Caldwell 98340 by: CC Zona Compressing my web pages? 98342 by: Jason Caldwell 98352 by: Jason Wong Output_Buffering ?? 98344 by: Jason Caldwell 98345 by: Jason Caldwell ob_gzhandler? (compression) 98346 by: Jason Caldwell 98347 by: Gerard Samuel 98348 by: Miguel Cruz How to encode e-mail attachments, work with MIME 98349 by: Carlos Fernando Scheidecker Antunes 98357 by: Jason Morehouse 98358 by: Manuel Lemos 98359 by: Manuel Lemos Non cachable php for use as an img src 98350 by: Henry PFDLib Function Problem 98353 by: Maurice Kevenaar refresh (part of) a page? 98354 by: savaidis 98360 by: Jason Wong Help with file read 98356 by: Josh Edwards 98361 by: Jason Wong A new GUI client for mySQL 98362 by: Ritesh Nadhani Trouble with recocnizing jpeg files. Some work, some do not 98363 by: andy 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--- list($usec,$sec)=explode( ,microtime()); mt_srand($sec * $usec); $quotes = file(quotes); echo $quotes[mt_rand(0, (sizeof($quotes)-1))]; Should do the trick nicely. -Evan -- All religions are founded on the fear of the many and the cleverness of the few. Stendhal ---End Message--- ---BeginMessage--- list($usec,$sec)=explode( ,microtime()); mt_srand($sec * $usec); $quotes = file(quotes); echo $quotes[mt_rand(0, (sizeof($quotes)-1))]; Yes!!! That works exactly! I love PHP! I love this list and look forward to the day when I can contribute something more than fascinating questions ;-) Thank you! TjL ---End Message--- ---BeginMessage--- r wrote: Does anybody have any ideas on how i can make PHPBB's width a bit shorter? Use PHPBB2's forums for these kind of questions. -- H | Life is the art of drawing without an eraser. - John Gardner + Ashley M. Kirchner mailto:[EMAIL PROTECTED] . 303.442.6410 x130 Director of Internet Operations / SysAdmin. 800.441.3873 x130 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6 http://www.pcraft.com . . .. Boulder, CO 80303, U.S.A. ---End Message--- ---BeginMessage--- Clearly the BB is designed to fill a page... it seems to have a minimum width, given the colums, images, etc etc that you can't really avoid... I'm not clear on the terms/licensing of the BB, but I'd try a mixture of: 1. editing the table code(s) it looks like the forums column can be shrunk down, which would reduce the overall size. 2. replacing some of the images and larger items with smaller ones 3. reducing the font size BTW - it's fine at 1024x768, so maybe it's *okay* for a certain % of your user base it wouldn't be for my target market tho. Justin French on 19/05/02 10:29 PM, r ([EMAIL PROTECTED]) wrote: Hi Guys and Girls, I have reciently set up PHPbb2 on our site, its great and no problems with the software but I am using frames so that a person can at any time jump out of the forum and came right back to the site but because
[PHP] Re: Non cachable php for use as an img src
Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello All, I want to return a gif from a php script. I want it to not be cachable anywhere not browsers, proxys etc. Actualy what I want to do is pass an existing .gif file as the output and do some database manipulation whilst I do so. Add a randomized cache-killer parameter, ie img src='counter.php?site=1k={insert random number here}' / Your script can ignore it, but the cache is unable to guarantee it doesn't mean something important, so it will force a reload. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regex: string begins with NEITER http NOR cid NOR mailto
Hello! I have got a big problem: I have html content in $html variable, which contains href, src and background tags. Those tags may contain relative adressess and absolute addressess which begin with http(s): or cid: (mail inline attachements) and mailto: I have also variable $basewwwservername, which contains servername of current server. I have to insert this $basewwwservername into all href,src and background tags which are relative and NOT into absolute. In other words I must preg_replace with some pattern that match for example (src)=(\|)..and not following WORDS: http|cid|mailto and correct rest of string. Does anybody relief my pain?;-) I've lost at least 3 days (almost 3x24hrs;-) Regards Konrad -- e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] regex: string begins with NEITER http NOR cid NOR mailto
Show some code... Thanks, Ray BigDog Hunter -Original Message- From: kras [mailto:[EMAIL PROTECTED]] Sent: Sunday, May 19, 2002 9:53 AM To: [EMAIL PROTECTED] Subject: [PHP] regex: string begins with NEITER http NOR cid NOR mailto Hello! I have got a big problem: I have html content in $html variable, which contains href, src and background tags. Those tags may contain relative adressess and absolute addressess which begin with http(s): or cid: (mail inline attachements) and mailto: I have also variable $basewwwservername, which contains servername of current server. I have to insert this $basewwwservername into all href,src and background tags which are relative and NOT into absolute. In other words I must preg_replace with some pattern that match for example (src)=(\|)..and not following WORDS: http|cid|mailto and correct rest of string. Does anybody relief my pain?;-) I've lost at least 3 days (almost 3x24hrs;-) Regards Konrad -- e-mail: [EMAIL PROTECTED] -- 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
Re: [PHP] regex: string begins with NEITER http NOR cid NOR mailto
There you are $html = preg_replace ('href=(\|)(?!mailto)([.]*?[^\]*?)(\| )'si, href=\.$bejsnejm.\\2\, $html); $html = preg_replace ('(src|background|href)=(\|)(?!http)([.]*?[^\]*?)(\| )'si, \\1=\.$bejsnejm./\\3\, $html); of course it fails. kras Show some code... Thanks, Ray BigDog Hunter -Original Message- From: kras [mailto:[EMAIL PROTECTED]] Sent: Sunday, May 19, 2002 9:53 AM To: [EMAIL PROTECTED] Subject: [PHP] regex: string begins with NEITER http NOR cid NOR mailto Hello! I have got a big problem: I have html content in $html variable, which contains href, src and background tags. Those tags may contain relative adressess and absolute addressess which begin with http(s): or cid: (mail inline attachements) and mailto: I have also variable $basewwwservername, which contains servername of current server. I have to insert this $basewwwservername into all href,src and background tags which are relative and NOT into absolute. In other words I must preg_replace with some pattern that match for example (src)=(\|)..and not following WORDS: http|cid|mailto and correct rest of string. Does anybody relief my pain?;-) I've lost at least 3 days (almost 3x24hrs;-) Regards Konrad -- e-mail: [EMAIL PROTECTED] -- 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] copy after upload pblm (?path?)
Hi all, I' m trying to copy an uploaded file: if(!empty($fichier)) { $nom = $HTTP_POST_FILES[fichier][name]; $type = $HTTP_POST_FILES[fichier][type]; $taille = $HTTP_POST_FILES[fichier][size]; $nom_tmp = $HTTP_POST_FILES[fichier][tmp_name]; echo nom : $nom br type : $type br taille : $taille p nom temporaire : $nom_tmp/p; if(!strpos($nom, .gif) === FALSE || !(strpos($nom, .jpg) === FALSE)){ ---$res = copy($fichier,$nom); if ($res != 0) { $msg = p File save /p; }else{ $msg = p saving Error /p; } }else{ $msg = p wrong type /p; } ? and i get the error Warning: open_basedir restriction in effect. File is in wrong directory in d:\tsunami\zeg\9\exo4upload.php on line 5 so is there any wrong path for $res = copy($fichier,$nom); should i use an absolute path? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble with recocnizing jpeg files. Some work, some donot
On Sun, 19 May 2002, andy wrote: I do have trouble with finding out if a file is a jpeg or not. This is the command I am using: $_FILES[picture_location][type] works fine exept in one case: With Photoshop 6.0 I do open the jpeg (which workes fine) an save as jpeg as another file name. Then upload the new file. This returns a type called: application/octet-stream So what is this type anyway. I do know jpeg and jpg and pjpeg but octed-stream?! application/octet-stream just means a generic binary file. I don't think that $_FILES[]['type'] is really all that useful for getting reliable information about a file, since it just trusts the browser/user, which could be uninformed, misinformed, or deliberately dishonest. Either pass the temp file to the unix 'file' command or peek inside it on your own (check the 'magic' file that comes with the unix 'file' command for details on what to look for). miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] copy after upload pblm (?path?)
1) You probably need to move the file from the temporary directory to somewhere in your own personal directory hierarchy. 2) http://php.net/move_uploaded_file miguel On Sun, 19 May 2002, arnaud gonzales wrote: Hi all, I' m trying to copy an uploaded file: if(!empty($fichier)) { $nom = $HTTP_POST_FILES[fichier][name]; $type = $HTTP_POST_FILES[fichier][type]; $taille = $HTTP_POST_FILES[fichier][size]; $nom_tmp = $HTTP_POST_FILES[fichier][tmp_name]; echo nom : $nom br type : $type br taille : $taille p nom temporaire : $nom_tmp/p; if(!strpos($nom, .gif) === FALSE || !(strpos($nom, .jpg) === FALSE)){ --- $res = copy($fichier,$nom); if ($res != 0) { $msg = p File save /p; }else{ $msg = p saving Error /p; } }else{ $msg = p wrong type /p; } ? and i get the error Warning: open_basedir restriction in effect. File is in wrong directory in d:\tsunami\zeg\9\exo4upload.php on line 5 so is there any wrong path for $res = copy($fichier,$nom); should i use an absolute path? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ob_gzhandler encoding ???
Does anyone know how I can test (and see) if my ob_gzhandler() is working? I've written the following script, and run it from the command line to see the output -- hoping it's encoded -- it isn't -- so I want to make sure I'm doing it right. ? header(Accept-Encoding: gzip, deflate); ob_start(ob_gzhandler); ? some HTML code ? ob_end_flush(); ob_end_clean(); ? I save then run the file: C:php test.php Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_gzhandler encoding ???
I doubt that'll work, as I don't think the gzhandler code will send gzipped data without a successful negotiation with the client (which can't happen at the command line). As others have suggested, the easiest way is probably to use lynx's --mime_header option. miguel On Sun, 19 May 2002, Jason Caldwell wrote: Does anyone know how I can test (and see) if my ob_gzhandler() is working? I've written the following script, and run it from the command line to see the output -- hoping it's encoded -- it isn't -- so I want to make sure I'm doing it right. ? header(Accept-Encoding: gzip, deflate); ob_start(ob_gzhandler); ? some HTML code ? ob_end_flush(); ob_end_clean(); ? I save then run the file: C:php test.php Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] finding postion of any chat occur first
Hello I have a string like $str=Hello World ; and i want to find the first occurance of any one of the char in or $sp=strpos($str,) Did not work, beacuse in this I can give only one char Can i give filter in this as [ ] If yes then how? Or any other idea to get this ... -- Bye, and Have a nice day. Prachait Saxena If you do for other's ! Other's will do for you !! Visit me at http://www.sitesontesting.com/prachait -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] finding postion of any one char occur first
Hello I have a string like $str=Hello World ; and i want to find the first occurance of any one of the char in or $sp=strpos($str,) Did not work, beacuse in this I can give only one char Can i give filter in this as [ ] If yes then how? Or any other idea to get this ... -- Bye, and Have a nice day. Prachait Saxena If you do for other's ! Other's will do for you !! Visit me at http://www.sitesontesting.com/prachait -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP parsing XML from Shoutcast
Anyone that has knowledge about this program, regarding it's XML output and php fetching that info and placing it on a php-page for user's to view? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I feel so stupid asking this question....LOL
How do i alternate the row color again. You get so used to dreamweaver doing everything for you and now when dreamweaver doesn't want to work back to notepage. But to remember how to alternate row colors... I'm lost. PLZ PLZ PLZ PLZ LOL :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Shoutcast
Anyone that has knowledge about this program, regarding it's XML output and php fetching that info and placing it on a php-page for user's to view? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble with recocnizing jpeg files. Some work, some do not
I thought this is a secure way to find out if the file is a jpeg or not. So you are suggesting to passit to the unix command file? How does that work. Maybe you can make a small example or give a small hint on what to look for on google. Sound interesting! I tryed to to perform a createfromjpeg command to that file and it did not work. So the magic is to save it in photoshop for web and then as jpeg and not with save as (jpeg). But this gives me a headache, because how do user know the difference? The file extension is jpeg and all programms can display it. Maybe there is a way in php as well to do a kind of createfromjpeg commmand?! Thanx, Andy Miguel Cruz [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Sun, 19 May 2002, andy wrote: I do have trouble with finding out if a file is a jpeg or not. This is the command I am using: $_FILES[picture_location][type] works fine exept in one case: With Photoshop 6.0 I do open the jpeg (which workes fine) an save as jpeg as another file name. Then upload the new file. This returns a type called: application/octet-stream So what is this type anyway. I do know jpeg and jpg and pjpeg but octed-stream?! application/octet-stream just means a generic binary file. I don't think that $_FILES[]['type'] is really all that useful for getting reliable information about a file, since it just trusts the browser/user, which could be uninformed, misinformed, or deliberately dishonest. Either pass the temp file to the unix 'file' command or peek inside it on your own (check the 'magic' file that comes with the unix 'file' command for details on what to look for). miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I feel so stupid asking this question....LOL
Well within a loop you can do something like this: tr bgcolor=?=($i%2 == 0) ? '#C0' : '#FFF00O';? Just make sure that $i is being incremented each time through the loop and there you go! :) Rick Be kind. Everyone you meet is fighting a hard battle - John Watson From: vins [EMAIL PROTECTED] Organization: Personal Reply-To: vins [EMAIL PROTECTED] Date: Sun, 19 May 2002 21:08:28 +0200 To: [EMAIL PROTECTED] Subject: [PHP] I feel so stupid asking this questionLOL How do i alternate the row color again. You get so used to dreamweaver doing everything for you and now when dreamweaver doesn't want to work back to notepage. But to remember how to alternate row colors... I'm lost. PLZ PLZ PLZ PLZ LOL :) -- 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
Re: [PHP] I feel so stupid asking this question....LOL
On Monday 20 May 2002 03:08, vins wrote: How do i alternate the row color again. You get so used to dreamweaver doing everything for you and now when dreamweaver doesn't want to work back to notepage. But to remember how to alternate row colors... Search the archives, this was discussed *extensively* during the past week or two. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I have a theory that it's impossible to prove anything, but I can't prove it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ob_gzhandler encoding ???
Will browsers that receive gzip encoded pages, transmit gzip encoded POST or GET data back? Jason Jason Caldwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anyone know how I can test (and see) if my ob_gzhandler() is working? I've written the following script, and run it from the command line to see the output -- hoping it's encoded -- it isn't -- so I want to make sure I'm doing it right. ? header(Accept-Encoding: gzip, deflate); ob_start(ob_gzhandler); ? some HTML code ? ob_end_flush(); ob_end_clean(); ? I save then run the file: C:php test.php Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions and Arrays
Hello Everyone, How do I send a single array, with many values, through sessions? For example, I might have the following: ?php session_start(); session_register(product); $product['category'] = appetizer; $product['name'] = Miso Soup; $product['desc'] = Some Description; $product['price'] = 4.95; ? By registering just the product array, will I have all of the values of that array available to me throughout the entire session? Or will I have to register each array variable-value pair separately, like so: session_register(product['category'], product['name'], product['description'], product['price'], ); Any help and suggestions on sending arrays through sessions will be greatful, thanks! :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] job payment.
Hey guys, I got an offer to do some php/mysql design for a local company, basically what it's going to be is to take the current Access DB and make it acessible through a webpage (that's the basic info they gave me). How much should i except to get paid for this, and what is an acceptable amount, for the completion of this project, or per hour? Jule -- |\/\__/\/| | Jule Slootbeek | | [EMAIL PROTECTED]| | http://blindtheory.cjb.net | | __ | |/\/ \/\| --- -- |\/\__/\/| | Jule Slootbeek | | [EMAIL PROTECTED]| | http://blindtheory.cjb.net | | __ | |/\/ \/\| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can someone check this mysql code
My code below don't want to insert the code into the database what am I doing wrong? ?php $answers=$band, $middlename, $pot; $date=date (l dS of F Y h:i:s A); $sql = INSERT INTO `prizeline` (`id`, `email`, `name`, `address`, `answers`, `date`) VALUES ('', 'email', 'name', 'address', 'answers', 'date');; $result = mysql_query($sql); ?
Re: [PHP] Sessions and Arrays
On Monday 20 May 2002 04:31, Navid Y. wrote: Hello Everyone, How do I send a single array, with many values, through sessions? For example, I might have the following: [snip] Why? don't you just try it? Surely it's quicker to write some simple test code than to ask on the list? By registering just the product array, will I have all of the values of that array available to me throughout the entire session? Yes Or will I have to register each array variable-value pair separately, like so: No -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Maybe we can get together and show off to each other sometimes. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone check this mysql code
On Mon, 20 May 2002 08:57:16 +1200 PhilipNZ Staff [EMAIL PROTECTED] wrote: My code below don't want to insert the code into the database what am I doing wrong? ?php $answers=$band, $middlename, $pot; $date=date (l dS of F Y h:i:s A); $sql = INSERT INTO `prizeline` (`id`, `email`, `name`, `address`, `answers`, `date`) VALUES ('', 'email', 'name', 'address', 'answers', 'date');; $result = mysql_query($sql); ? $sql = INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '$email', '$name', '$address', '$answers', '$date'); echo $sql; $result=mysql_query($sql) or die (mysql_error()); Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and Arrays
Jason, I did try it before asking, else I wouldn't have any reason to ask. It didn't work for me, but I thought that maybe I was missing something. So your answer is yes, it is possible? I guess I'll have to keep testing my application. Thanks for your time, I really appreciate it. Navid -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Sunday, May 19, 2002 4:17 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Sessions and Arrays On Monday 20 May 2002 04:31, Navid Y. wrote: Hello Everyone, How do I send a single array, with many values, through sessions? For example, I might have the following: [snip] Why? don't you just try it? Surely it's quicker to write some simple test code than to ask on the list? By registering just the product array, will I have all of the values of that array available to me throughout the entire session? Yes Or will I have to register each array variable-value pair separately, like so: No -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Maybe we can get together and show off to each other sometimes. */ -- 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] Why would this command just Die!
This command just dies! I have checked sql connection ... ok the insert into line ... ok Pfft it just don't wanna work ?php $answers=$band, $middlename, $pot; $date=date (l dS of F Y h:i:s A); $sql = INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '$email', '$name', '$address', '$answers', '$date'); echo $sql; mysql_query($sql) or die (There has been an error); ? ## Out put on page ## INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '[EMAIL PROTECTED]', 'newman', '12 Newman ave Auckland', 'In Season, James, John', 'Monday 20th of May 2002 10:22:05 AM')There has been an error
[PHP] MSIE GZIP problem?
I have several browsers installed; NS4.x, NS6.02, Opera 6.x, and MSIE 6.0 -- I'm using gzip compression on my site through the ob_gzhandler. My pages seem to load fine, however, ONLY in MSIE when I REFRESH (i.e.. with the Refresh Button) the page seems to lose it's table or table format, and everything looks all jacked up. This ONLY happens on a page reload. The other browsers don't seem to have this problem -- I went to MS's Windows Update, and installed several updates, mostly Security updates -- there were no updates that spoke of a gzip / reload problem -- nonetheless, I applied all I could. After rebooting (again) -- I went back to my site with MSIE 6 -- hit reload and now the problem has gone away. Has anyone heard of the problem with MSIE 6? If this is a known problem; I'll have to perform some browser check to make sure I can gzip to that MSIE version 6 build (whatever) -- kind of a hassle. I just did a search on Technet, and could find no mention of it. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why would this command just Die!
PD ?php PD $answers=$band, $middlename, $pot; PD $date=date (l dS of F Y h:i:s A); PD $sql = INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '$email', '$name', '$address', '$answers', '$date'); PD echo $sql; PD mysql_query($sql) or die (There has been an error); PD ? If this is all of your script, then you are missing those pesky connect to server and select database functions. If you replace your die message with die(mysql_error()) you will probably see a very helpful error message such as no database selected or hey buddy, not connected. - Julie -- Julie Meloni -- [EMAIL PROTECTED] -- www.thickbook.com Find Sams Teach Yourself MySQL in 24 Hours at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why would this command just Die!
To see the actual error try: or die (mysql_error()). On Mon, 20 May 2002 10:27:20 +1200, Php Developers wrote: This command just dies! I have checked sql connection ... ok the insert into line ... ok Pfft it just don't wanna work ?php $answers=$band, $middlename, $pot; $date=date (l dS of F Y h:i:s A); $sql = INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '$email', '$name', '$address', '$answers', '$date'); echo $sql; mysql_query($sql) or die (There has been an error); ? ## Out put on page ## INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '[EMAIL PROTECTED]', 'newman', '12 Newman ave Auckland', 'In Season, James, John', 'Monday 20th of May 2002 10:22:05 AM')There has been an error -- Jason Morehouse ([EMAIL PROTECTED]) Netconcepts LTD - Auckland, New Zealand Linux: because rebooting is for adding hardware -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Arrays and Forms
Hello Everyone, I'm having trouble sending array values through forms. Will the following syntax create a variable called $product['desc'] on the next page? If not, what am I doing wrong here? Note: I tried this but it didn't work! When I tried doing it without using an array, but rather with a regular variable, it sent through just fine and created a variable of the name attribute in the input tag. menu_add.php - form method=post action=menu_list.php input type=text name=product[desc] /form menu_list.php - echo $product['desc']; Result output - no output -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Skinning Problem
Can some one please tell me why this PHP command brings back an Undefined variable: QUERY_STRING on line 1. The script is below, by the way it is PHP on windows not unix. ?php SetCookie(skin, $QUERY_STRING, time()+3600); ? Also can some one please tell me why this is bringing back a problem on a windows server. ?php if($skin==black) { $skin=#00; $text=#FF; }; if($skin==white) { $skin=#FF; $text=#00; }; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why would this command just Die!
INSERT INTO prizeline (id, email, name, address, answers, date) VALUES ('', '[EMAIL PROTECTED]', 'newman', '12 Newman ave Auckland', 'In Season, James, John', 'Monday 20th of May 2002 10:22:05 AM')There has been an error If you want 'id' to be assigned by the database (I'm assuming you have an auto_increment on that field) then don't put it in your insert at all. The database will figure it out. As it is you're trying to assing the id to '' (or nothing) which may well be why you're getting the error. (and this relates to php in what way? Perhaps an sql mailing list would have been a more appropriate place...) CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] while loop question - problem (new set of eyes needed)
Hi, I wonder if someone could have a quick look at this for me? It's a simple while loop, but it's not acting the way (I think) it should. If I break down the while loop, it reads: // $result contains 3 rows while($row = mysql_fetch_array($result)) { echo xxx ; } = xxx xxx xxx is displayed (as expected) If I add the following code to the loop, it only seems to iterate through it *once*: while($row = mysql_fetch_array($result)) { $pri = $row['pri']; $fg = $row['fg']; $molw = $row['molw']; $density = $row['density']; $denstype = $row['denstype']; $pctd = $row['pctd']; $maxpctd = $row['maxpctd']; $compid = $row['compid']; $sql = select * from compounds where compid = \$compid\; $result = mysql_query($sql,$conn); $row = mysql_fetch_array($result); $compname = $row['compname']; $concentration = $row['concentration']; $concunit = $row['concunit']; $type = $row['type']; $composition = $row['composition']; if ($fg==Y) $html .= b$concentration $concunit $compname/bbr; else if ($pri==Y) $html .= font color=\#66\ $concentration $concunit $compname/fontbr; else $html .= $concentration $concunit $compnamebr; } Expected results: Actin #2543: Description here. 1 mol AEBSF 1.3 mol Calcium Chloride 1.4 mol Potassium Chloride Actual results: Actin #2543: Description here. 1 mol AEBSF i.e the last two compounds are not displayed. I can't for the life of me see the problem. A new set of eyes looking at this would be GREATLY appreciated. Thanks very much in advance. - Best regards, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: while loop question - problem (new set of eyes needed)
I see the problem. No reply neccessary. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays and Forms
Try: input type=text name=product[] ? foreach ($product as $p) { print $p; } ? On Mon, 20 May 2002 11:05:07 +1200, Navid Y. wrote: Hello Everyone, I'm having trouble sending array values through forms. Will the following syntax create a variable called $product['desc'] on the next page? If not, what am I doing wrong here? Note: I tried this but it didn't work! When I tried doing it without using an array, but rather with a regular variable, it sent through just fine and created a variable of the name attribute in the input tag. menu_add.php - form method=post action=menu_list.php input type=text name=product[desc] /form menu_list.php - echo $product['desc']; Result output - no output -- Jason Morehouse ([EMAIL PROTECTED]) Netconcepts LTD - Auckland, New Zealand Linux: because rebooting is for adding hardware -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] while loop question - problem (new set of eyes needed)
LPR LPR while($row = mysql_fetch_array($result)) LPR { LPR $pri = $row['pri']; LPR $fg = $row['fg']; LPR $molw = $row['molw']; LPR $density = $row['density']; LPR $denstype = $row['denstype']; LPR $pctd = $row['pctd']; LPR $maxpctd = $row['maxpctd']; LPR $compid = $row['compid']; LPR $sql = select * from compounds where compid = \$compid\; LPR $result = mysql_query($sql,$conn); LPR $row = mysql_fetch_array($result); LPR $compname = $row['compname']; LPR $concentration = $row['concentration']; LPR $concunit = $row['concunit']; LPR $type = $row['type']; LPR $composition = $row['composition']; LPR if ($fg==Y) LPR$html .= b$concentration $concunit $compname/bbr; LPR else if ($pri==Y) LPR$html .= font color=\#66\ $concentration $concunit LPR $compname/fontbr; LPR else LPR$html .= $concentration $concunit $compnamebr; LPR } LPR You are re-assigning the value of $row within the while construct. When you get to your query within the while chunk, use different variable names than the master. - Julie -- Julie Meloni -- [EMAIL PROTECTED] -- www.thickbook.com Find Sams Teach Yourself MySQL in 24 Hours at http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Skinning Problem
Not sure about the query string thing... what version are you running? If you have register_globals Off in your php.ini (as discussed MANY times on this list), $skin won't be set... it'll be $_SESSION['skin']. Simple changes: ?php // use session var, or if not found, use defauly if(isset($_SESSION['skin'])) { $skin = $_SESSION['skin']; } else { $skin = black; } // set colours if($skin==black) { $skin=#00; $text=#FF; }; elseif($skin==white) { $skin=#FF; $text=#00; }; ? Justin French Indent.com.au on 20/05/02 9:08 AM, Darren Edwards ([EMAIL PROTECTED]) wrote: Can some one please tell me why this PHP command brings back an Undefined variable: QUERY_STRING on line 1. The script is below, by the way it is PHP on windows not unix. ?php SetCookie(skin, $QUERY_STRING, time()+3600); ? Also can some one please tell me why this is bringing back a problem on a windows server. ?php if($skin==black) { $skin=#00; $text=#FF; }; if($skin==white) { $skin=#FF; $text=#00; }; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] while loop question - problem (new set of eyes needed)
Line 13 is re-assigning $result, the save variable you're using in line 1! 1 while($row = mysql_fetch_array($result)) 2 { 3$pri = $row['pri']; 4$fg = $row['fg']; 5$molw = $row['molw']; 6$density = $row['density']; 7$denstype = $row['denstype']; 8$pctd = $row['pctd']; 9$maxpctd = $row['maxpctd']; 10$compid = $row['compid']; 11 12$sql = select * from compounds where compid = \$compid\; 13$result = mysql_query($sql,$conn); 14$row = mysql_fetch_array($result); 15 16$compname = $row['compname']; 17$concentration = $row['concentration']; 18$concunit = $row['concunit']; 19$type = $row['type']; 20$composition = $row['composition']; 21 22if ($fg==Y) 23 $html .= b$concentration $concunit $compname/bbr; 24else if ($pri==Y) 25 $html .= font color=\#66\ $concentration $concunit $compname/fontbr; 26else 27 $html .= $concentration $concunit $compnamebr; 28 } -Original Message- From: Lee P Reilly [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 9:24 AM To: PHP List Subject: [PHP] while loop question - problem (new set of eyes needed) Hi, I wonder if someone could have a quick look at this for me? It's a simple while loop, but it's not acting the way (I think) it should. If I break down the while loop, it reads: // $result contains 3 rows while($row = mysql_fetch_array($result)) { echo xxx ; } = xxx xxx xxx is displayed (as expected) If I add the following code to the loop, it only seems to iterate through it *once*: while($row = mysql_fetch_array($result)) { $pri = $row['pri']; $fg = $row['fg']; $molw = $row['molw']; $density = $row['density']; $denstype = $row['denstype']; $pctd = $row['pctd']; $maxpctd = $row['maxpctd']; $compid = $row['compid']; $sql = select * from compounds where compid = \$compid\; $result = mysql_query($sql,$conn); $row = mysql_fetch_array($result); $compname = $row['compname']; $concentration = $row['concentration']; $concunit = $row['concunit']; $type = $row['type']; $composition = $row['composition']; if ($fg==Y) $html .= b$concentration $concunit $compname/bbr; else if ($pri==Y) $html .= font color=\#66\ $concentration $concunit $compname/fontbr; else $html .= $concentration $concunit $compnamebr; } Expected results: Actin #2543: Description here. 1 mol AEBSF 1.3 mol Calcium Chloride 1.4 mol Potassium Chloride Actual results: Actin #2543: Description here. 1 mol AEBSF i.e the last two compounds are not displayed. I can't for the life of me see the problem. A new set of eyes looking at this would be GREATLY appreciated. Thanks very much in advance. - Best regards, Lee -- 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
RE: [PHP] while loop question - problem (new set of eyes needed)
while($row = mysql_fetch_array($result)) { So, your while loop is based on values of $row. $row = mysql_fetch_array($result); Now within your while loop you've altered the value of $row - poor thing is probably a tad confused. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fopen thru proxy problem
howdy, using the script below can see why I am getting the following error? Warning: fopen(Resource id #1, http://www.phpbuilder.com/rss_feed.php?type=generallimit=10;) - No error in c:\phpdev\www\test.php on line 46 file could not be opened print( H1HTTP/H1\n); $prox = proxy_number $datei = fsockopen($prox, 3128, $errno, $errstr); if (!($myFile = fopen($datei, http://www.phpbuilder.com/rss_feed.php?type=generallimit=10;, r))) { print (file could not be opened); exit; } while (!feof($myFile)) { //read a line from file $myLine = fgetss($myFile); print ($myLine BR\n); } //close the file fclose($myFile); any help is apreciated Cheers Peter the only dumb question is the one that wasn't asked -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: job payment.
Jule [EMAIL PROTECTED] wrote in message 02051916383210.28871@localhost">news:02051916383210.28871@localhost... I got an offer to do some php/mysql design for a local company, basically what it's going to be is to take the current Access DB and make it acessible through a webpage (that's the basic info they gave me). How much should i except to get paid for this, and what is an acceptable amount, for the completion of this project, or per hour? Depends drastically on how complex the database is, and on what their idea of making it 'accessible' is. Are you porting the database to mySQL, or mirroring it? How many tables/records/pages? How much 'design' do you do, and how much is just fill-in-the-blanks? Is this 'view-edit- delete record' accessibility, or 'view-edit- authorize-track changes-sign off on a form filled from a six-table-join query', or what? Is it in-house only, or for authorized clients too, or for the public? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why not working
This should send me an e-mail with the form info then send a thank you letter to the subscriber. It does the first, but not second, any ideas? ? $MailToAddress = [EMAIL PROTECTED]; $MailSubject = Joine-mail list; if (!$MailFromAddress) { $MailFromAddress = $email; } $Header = ; $Footer = ; ? ? if (!is_array($HTTP_POST_VARS)) return; reset($HTTP_POST_VARS); while(list($key, $val) = each($HTTP_POST_VARS)) { $GLOBALS[$key] = $val; $val=stripslashes($val); $Message .= $key = $val\n; } if ($Header) { $Message = $Header.\n\n.$Message; } if ($Footer) { $Message .= \n\n.$Footer; } mail( $MailToAddress, $MailSubject, $Message, From: $MailFromAddress); ? ?php if(isset($Submit)) { $subject = Thank You; $MailFromAddress = [EMAIL PROTECTED]; while(list($key, $value) = each($HTTP_POST_VARS)) { $$key = $value; $msg .= $key = $value\n; } $comment = The thank you letter goes here; // Send reply to them mail( $email, $subject, $comment, From: $MailFromAddress); } ?
[PHP] mysql_fetch_array errors
I am trying to clone my webserver because I am switching ISPs. So I copied the MySQL database, and then I copied the php pages. But my new server insists that any query I do is not a valid result resource when I try to use it in a mysql_fetch_array command. I know that both php and the database are functional (to an extent) because all other commands work. I'm using PHP 4.something over MySQL 3.2.3 running RedHat 7.0. Thanks Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Shoutcast
Johan EkströM [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Anyone that has knowledge about this program, regarding it's XML output and php fetching that info and placing it on a php-page for user's to view? Take a look at some of the scripts from http://www.casterclub.com/downloads.php you should be able to figure out what you need. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_fetch_array errors
At 9:38 PM -0400 19/5/02, Justin Latham wrote: insists that any query I do is not a valid result resource when I try to use it in a mysql_fetch_array command. I know that both php and the database So what errors are being returned by all the mysql_* calls? Error messages are their to help the programmer find problems... not as an annoyance to be turned off and/or ignored. ...R. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: finding postion of any chat occur first
Prachait Saxena [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I have a string like $str=Hello World ; and i want to find the first occurance of any one of the char in or $sp=strpos($str,) Did not work, beacuse in this I can give only one char function strpos_multi($str, $chars) { $firstpos = $badvalue = $strlen($str); $numchars = strlen($chars); for ($i = 0; $i $numchars; $i++) { $ch = substr($chars, $i, 1); $pos = strpos($str, $ch); if ($pos !== false) // NOTE: op is bang-equals-equals $firstpos = min($pos, $firstpos); } if ($firstpos == $badvalue) return -1; else return $firstpos; } $charpos = strpos_multi($str, ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: job payment.
Hey everybody, thanks a lot for all the info i got, i know it's kindof a stragne question, but i really had no idea to expect what to earn or to be offered in a situation like the one i'm in now. Now i know what to compare with and how to deal with everything and i think i'm set on job-instructions for the rest of my life. thanks a lot i really appreciate it. Jule On Sunday 19 May 2002 20:46, Doug Riddle wrote: --- Jule [EMAIL PROTECTED] wrote: Hey guys, I got an offer to do some php/mysql design for a local company, basically what it's going to be is to take the current Access DB and make it acessible through a webpage (that's the basic info they gave me). How much should i except to get paid for this, and what is an acceptable amount, for the completion of this project, or per hour? Jule -- Jule: I cannot guess what the going rate in New England is for DB programming. A few years ago I was getting $20.00 US for work like it. I have made a lot more too, it sort of depends on what the market will bear. I suspect they are not sure themselves. I can offer a few things to think about... Things to consider: 1) Task Creep/Function creep/add-in bloat/design creep/ etc. Get it clear up front what it is they expect and what constitutes a completed project. If there is not a clear design and task list, then even they are not sure what they want. They want someone to figure that out for them, and are probably not fully aware of the effort involved, or the cost. In that case I would ask for hourly wages. That way, changes to the project in mid-stream do not require negotiations about cost and pay. 2) Deliverables. Make sure you get a schedule of when they want what. You will need time to figure out the DB, and work with them on the front-end the client will see, not to mention the nuts and bolts of the job. Break the project into bite-sized pieces and get their buy-in on each stage. Get the guidlines in writing and a firm definition of what they consider a completed project in the contract. 3) Coordination. If at all possible, get one, or at the most two, people to act as coordinators. These should be people able to approve designs, make decisions and preferably write checks. Avoid designing by committee wherever possible. 4) Contract. Get it in writing. Unless they are offering you a position with their company, they will expect a contract. It doesn't have to be a complicated formal affair. Just discuss the job, write down their expectations and convert that into a for the completion of this project as outlined herein, the company of I've-got-your-wallet agrees to pay my company, and-all-your-money, X dollars per hour for the building of this web site. The company agrees to provide ample opportunity to discuss the deliverables as outlined and tender approval in a timely basis, etc. That's it, save your receipts and keep good notes. That will allow you to be sure you own any code you write, not them. They are buying the use of the code, not the code. Make sure you work that in somewhere. After that, just enjoy yourself. = Warmest Regards, Doug Riddle http://www.dougriddle.com ## If they do discover life on other planets, who will get to them first, The Democrats, the Republicans, Avon, or the Latter Day Saints? ## __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- |\/\__/\/| | Jule Slootbeek | | [EMAIL PROTECTED]| | http://blindtheory.cjb.net | | __ | |/\/ \/\| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why not working
In article 001c01c1ff9a$0e4369b0$b700a8c0@yoda, [EMAIL PROTECTED] says... This should send me an e-mail with the form info then send a thank you letter to the subscriber. It does the first, but not second, any ideas? ? $MailToAddress = [EMAIL PROTECTED]; $MailSubject = Joine-mail list; if (!$MailFromAddress) { $MailFromAddress = $email; } $Header = ; $Footer = ; ? ? if (!is_array($HTTP_POST_VARS)) return; reset($HTTP_POST_VARS); while(list($key, $val) = each($HTTP_POST_VARS)) { $GLOBALS[$key] = $val; $val=stripslashes($val); $Message .= $key = $val\n; } if ($Header) { $Message = $Header.\n\n.$Message; } if ($Footer) { $Message .= \n\n.$Footer; } mail( $MailToAddress, $MailSubject, $Message, From: $MailFromAddress); ? ?php if(isset($Submit)) { $subject = Thank You; $MailFromAddress = [EMAIL PROTECTED]; while(list($key, $value) = each($HTTP_POST_VARS)) { $$key = $value; $msg .= $key = $value\n; } Probably the first thing you could check is whether $Submit is set; there seems to be nothing there that would do so. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 20 May 2002 03:20:44 -0000 Issue 1355
php-general Digest 20 May 2002 03:20:44 - Issue 1355 Topics (messages 98364 through 98410): Re: Non cachable php for use as an img src 98364 by: Hugh Bothwell regex: string begins with NEITER http NOR cid NOR mailto 98365 by: kras 98366 by: Ray Hunter 98367 by: kras copy after upload pblm (?path?) 98368 by: arnaud gonzales 98370 by: Miguel Cruz Re: Trouble with recocnizing jpeg files. Some work, some do not 98369 by: Miguel Cruz 98378 by: andy ob_gzhandler encoding ??? 98371 by: Jason Caldwell 98372 by: Miguel Cruz 98381 by: Jason Caldwell finding postion of any chat occur first 98373 by: Prachait Saxena 98408 by: Hugh Bothwell finding postion of any one char occur first 98374 by: Prachait Saxena PHP parsing XML from Shoutcast 98375 by: Johan Ekström I feel so stupid asking this questionLOL 98376 by: vins 98379 by: Richard Baskett 98380 by: Jason Wong Shoutcast 98377 by: Johan Ekström 98406 by: Hugh Bothwell Sessions and Arrays 98382 by: Navid Y. 98385 by: Jason Wong 98387 by: Navid Y. job payment. 98383 by: Jule 98403 by: Hugh Bothwell 98409 by: Jule Can someone check this mysql code 98384 by: PhilipNZ Staff 98386 by: Kevin Waterson Why would this command just Die! 98388 by: PhilipNZ Staff 98390 by: Julie Meloni 98391 by: Jason Morehouse 98394 by: David Freeman MSIE GZIP problem? 98389 by: Jason Caldwell Arrays and Forms 98392 by: Navid Y. 98397 by: Jason Morehouse PHP Skinning Problem 98393 by: Darren Edwards 98399 by: Justin French while loop question - problem (new set of eyes needed) 98395 by: Lee P Reilly 98396 by: Lee P Reilly 98398 by: Julie Meloni 98400 by: Martin Towell 98401 by: David Freeman fopen thru proxy problem 98402 by: Peter Why not working 98404 by: dean 98410 by: David Robley mysql_fetch_array errors 98405 by: Justin Latham 98407 by: Richard Archer 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--- Henry [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello All, I want to return a gif from a php script. I want it to not be cachable anywhere not browsers, proxys etc. Actualy what I want to do is pass an existing .gif file as the output and do some database manipulation whilst I do so. Add a randomized cache-killer parameter, ie img src='counter.php?site=1k={insert random number here}' / Your script can ignore it, but the cache is unable to guarantee it doesn't mean something important, so it will force a reload. ---End Message--- ---BeginMessage--- Hello! I have got a big problem: I have html content in $html variable, which contains href, src and background tags. Those tags may contain relative adressess and absolute addressess which begin with http(s): or cid: (mail inline attachements) and mailto: I have also variable $basewwwservername, which contains servername of current server. I have to insert this $basewwwservername into all href,src and background tags which are relative and NOT into absolute. In other words I must preg_replace with some pattern that match for example (src)=(\|)..and not following WORDS: http|cid|mailto and correct rest of string. Does anybody relief my pain?;-) I've lost at least 3 days (almost 3x24hrs;-) Regards Konrad -- e-mail: [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- Show some code... Thanks, Ray BigDog Hunter -Original Message- From: kras [mailto:[EMAIL PROTECTED]] Sent: Sunday, May 19, 2002 9:53 AM To: [EMAIL PROTECTED] Subject: [PHP] regex: string begins with NEITER http NOR cid NOR mailto Hello! I have got a big problem: I have html content in $html variable, which contains href, src and background tags. Those tags may contain relative adressess and absolute addressess which begin with http(s): or cid: (mail inline attachements) and mailto: I have also variable $basewwwservername, which contains servername of current server. I have to insert this $basewwwservername into all href,src and background tags which are relative and NOT into absolute. In other words I must preg_replace with some pattern that match for example (src)=(\|)..and not following WORDS: http|cid|mailto and correct rest of string. Does anybody relief my pain?;-) I've lost at least 3 days (almost 3x24hrs;-) Regards Konrad -- e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
[PHP] Running php program when mail received
Hello all. I am trying to write a small program that will run everytime an email is received at a certain mailbox on my sever. I had this running at one time, but for some reason, it will not run. I am not getting any errors and I can't figure out what is going on. Below is the code that I am trying to run. #!/usr/bin/php -q ### CHANGE VALUES OF THE FOLLOWING VARIABLES ### $to = [EMAIL PROTECTED]; $subj = message; $hdrs = From: [EMAIL PROTECTED]\n; $msg = This is going out; mail($to, $subj, $msg, $hdrs); This is what is returned in the maillog file. May 19 22:29:07 server1 sendmail[3502]: WAA03501: to=|/path/to/file/imap.php, delay=00:00:00, xdelay=00:00:00, mailer=prog, stat=Sent Can anyone point me in the right direction? The script has been chmod 755. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Arrays and Forms
On Monday 20 May 2002 07:05, Navid Y. wrote: Hello Everyone, I'm having trouble sending array values through forms. Will the following syntax create a variable called $product['desc'] on the next page? If not, what am I doing wrong here? Note: I tried this but it didn't work! When I tried doing it without using an array, but rather with a regular variable, it sent through just fine and created a variable of the name attribute in the input tag. I don't see anything wrong with the code below. You're saying ... input type=text name=product and echo $product; ... works (on the same server without any other changes)? menu_add.php - form method=post action=menu_list.php input type=text name=product[desc] /form menu_list.php - echo $product['desc']; Result output - no output -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* As far as the laws of mathematics refer to reality, they are not certain, and as far as they are certain, they do not refer to reality. -- Albert Einstein */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] multiply by 2
I was doing some timing of a function on the weekend and in one of the loops, I had to multiply a variable by 2 - easy enough - $i*2 but then I remembered that in C, it's quicker to do a left shift - so $i1 but this actually took longer to execute in php than the $i*2 - can anyone confirm my test? I iterated ~28,000 times. Each time, there was 2 places where I was doing the left shift. The time (including all the other stuff I was doing in the function) for $i*2 was ~12secs, and $i1 was ~19secs. I am running PHP4.0.6 (download cgi version from php.net) on a win98 system (500MHz Celeron if that changes anything) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Running php program when mail received
On 05/20/2002 12:38 AM, Cditty wrote: Hello all. I am trying to write a small program that will run everytime an email is received at a certain mailbox on my sever. I had this running at one time, but for some reason, it will not run. I am not getting any errors and I can't figure out what is going on. Below is the code that I am trying to run. #!/usr/bin/php -q ### CHANGE VALUES OF THE FOLLOWING VARIABLES ### $to = [EMAIL PROTECTED]; $subj = message; $hdrs = From: [EMAIL PROTECTED]\n; $msg = This is going out; mail($to, $subj, $msg, $hdrs); This is what is returned in the maillog file. May 19 22:29:07 server1 sendmail[3502]: WAA03501: to=|/path/to/file/imap.php, delay=00:00:00, xdelay=00:00:00, mailer=prog, stat=Sent Can anyone point me in the right direction? The script has been chmod 755. What happens when you do /usr/bin/php -q /path/to/file/imap.php ? -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Running php program when mail received
I get this error and the program code outputted to the screen. Failed loading /usr/local/Zend/lib/ZendOptimiser.so: /usr/local/Zend/lib/ZendOptimiser.so: cannot open shared object file: No such file or directory I just looked in that directory and there is a ZendOptimizer.so file. I copied it to ZendOptimiser.so and ran it again. No error, but still getting the code output. Chris At 11:17 PM 5/19/2002, you wrote: On 05/20/2002 12:38 AM, Cditty wrote: Hello all. I am trying to write a small program that will run everytime an email is received at a certain mailbox on my sever. I had this running at one time, but for some reason, it will not run. I am not getting any errors and I can't figure out what is going on. Below is the code that I am trying to run. #!/usr/bin/php -q ### CHANGE VALUES OF THE FOLLOWING VARIABLES ### $to = [EMAIL PROTECTED]; $subj = message; $hdrs = From: [EMAIL PROTECTED]\n; $msg = This is going out; mail($to, $subj, $msg, $hdrs); This is what is returned in the maillog file. May 19 22:29:07 server1 sendmail[3502]: WAA03501: to=|/path/to/file/imap.php, delay=00:00:00, xdelay=00:00:00, mailer=prog, stat=Sent Can anyone point me in the right direction? The script has been chmod 755. What happens when you do /usr/bin/php -q /path/to/file/imap.php ? -- Regards, Manuel Lemos -- 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] Variable won't work in function, even when I global it?
On my website, I open my header (and footer) file with fileopen and then eval() it. I know I should include them, but I knew nothing about php when I did this. Anyway, I'm working on groups for my website. They will be a kind of club. At the top of every group page, I include a group function file. Among those functions is one that checks if the user trying to go to the group is a member of it. If not, it gives them an error message and exits. It is also supposed to eval() the footer before exiting. My code is as follows: function checkmember(){ global $groupid; global $userinfo; global $footertext; if($groupid != $userinfo['groupid']){ print bError:/b you're not a member of this group.; eval($footertext); exit; } return; } The thing is, it doesn't seem to eval() the footer. I've even tried getting $footertext out of the $GLOBALS array. I have also tried printing $footertext to make sure it wasn't a problem with evel(). Nothing has worked. When I did isset() on $GLOBALS['footertext'], it worked however. Thanks to anybody who can help.
Re: [PHP] MSIE GZIP problem?
On Sun, 19 May 2002, Jason Caldwell wrote: I have several browsers installed; NS4.x, NS6.02, Opera 6.x, and MSIE 6.0 -- I'm using gzip compression on my site through the ob_gzhandler. My pages seem to load fine, however, ONLY in MSIE when I REFRESH (i.e.. with the Refresh Button) the page seems to lose it's table or table format, and everything looks all jacked up. This ONLY happens on a page reload. The other browsers don't seem to have this problem -- I see something similar with Windows IE 5, 5.5, and 6 all the time, particularly when I have a combination of absolute and relative table/table cell widths. Sometimes it'll be messed up the first time through, sometimes after a refresh. Never consistent, never predictable. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable won't work in function, even when I global it?
I don't know what $footertext looks like, but I can tell you that just eval()ing a chunk of text won't have any apparent effect. When you eval() code in a string, that code has to either return() something, or have direct effects on its own (such as calling functions or setting values). eval() != echo. miguel On Mon, 20 May 2002, Leif K-Brooks wrote: On my website, I open my header (and footer) file with fileopen and then eval() it. I know I should include them, but I knew nothing about php when I did this. Anyway, I'm working on groups for my website. They will be a kind of club. At the top of every group page, I include a group function file. Among those functions is one that checks if the user trying to go to the group is a member of it. If not, it gives them an error message and exits. It is also supposed to eval() the footer before exiting. My code is as follows: function checkmember(){ global $groupid; global $userinfo; global $footertext; if($groupid != $userinfo['groupid']){ print bError:/b you're not a member of this group.; eval($footertext); exit; } return; } The thing is, it doesn't seem to eval() the footer. I've even tried getting $footertext out of the $GLOBALS array. I have also tried printing $footertext to make sure it wasn't a problem with evel(). Nothing has worked. When I did isset() on $GLOBALS['footertext'], it worked however. Thanks to anybody who can help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Variable won't work in function, even when I global it?
what's that value of $footertext? is it the actual contents of the footer file? have you tried displaying the contents of $footertext just before you call checkmember()? does it contain what you're expecting? -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 3:23 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable won't work in function, even when I global it? On my website, I open my header (and footer) file with fileopen and then eval() it. I know I should include them, but I knew nothing about php when I did this. Anyway, I'm working on groups for my website. They will be a kind of club. At the top of every group page, I include a group function file. Among those functions is one that checks if the user trying to go to the group is a member of it. If not, it gives them an error message and exits. It is also supposed to eval() the footer before exiting. My code is as follows: function checkmember(){ global $groupid; global $userinfo; global $footertext; if($groupid != $userinfo['groupid']){ print bError:/b you're not a member of this group.; eval($footertext); exit; } return; } The thing is, it doesn't seem to eval() the footer. I've even tried getting $footertext out of the $GLOBALS array. I have also tried printing $footertext to make sure it wasn't a problem with evel(). Nothing has worked. When I did isset() on $GLOBALS['footertext'], it worked however. Thanks to anybody who can help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable won't work in function, even when I global it?
I know that. Footertext prints out the footer for my site. The bottom of my layout. Also, as I said, I even tried printing $footertext. Thanks for trying to help, though. Miguel Cruz wrote: I don't know what $footertext looks like, but I can tell you that just eval()ing a chunk of text won't have any apparent effect. When you eval() code in a string, that code has to either return() something, or have direct effects on its own (such as calling functions or setting values). eval() != echo. miguel On Mon, 20 May 2002, Leif K-Brooks wrote: On my website, I open my header (and footer) file with fileopen and then eval() it. I know I should include them, but I knew nothing about php when I did this. Anyway, I'm working on groups for my website. They will be a kind of club. At the top of every group page, I include a group function file. Among those functions is one that checks if the user trying to go to the group is a member of it. If not, it gives them an error message and exits. It is also supposed to eval() the footer before exiting. My code is as follows: function checkmember(){ global $groupid; global $userinfo; global $footertext; if($groupid != $userinfo['groupid']){ print bError:/b you're not a member of this group.; eval($footertext); exit; } return; } The thing is, it doesn't seem to eval() the footer. I've even tried getting $footertext out of the $GLOBALS array. I have also tried printing $footertext to make sure it wasn't a problem with evel(). Nothing has worked. When I did isset() on $GLOBALS['footertext'], it worked however. Thanks to anybody who can help.
Re: [PHP] Arrays and Forms
Your code looks fine. Are you sure you haven't edited away significant parts of it when posting to the list? Maybe a input name=product somewhere? miguel On Sun, 19 May 2002, Navid Y. wrote: I'm having trouble sending array values through forms. Will the following syntax create a variable called $product['desc'] on the next page? If not, what am I doing wrong here? Note: I tried this but it didn't work! When I tried doing it without using an array, but rather with a regular variable, it sent through just fine and created a variable of the name attribute in the input tag. menu_add.php - form method=post action=menu_list.php input type=text name=product[desc] /form menu_list.php - echo $product['desc']; Result output - no output -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can someone check this mysql code
On Mon, 20 May 2002, PhilipNZ Staff wrote: My code below don't want to insert the code into the database what am I doing wrong? ?php $answers=$band, $middlename, $pot; $date=date (l dS of F Y h:i:s A); $sql = INSERT INTO `prizeline` (`id`, `email`, `name`, `address`, `answers`, `date`) VALUES ('', 'email', 'name', 'address', 'answers', 'date');; What is the error message shown when you printed mysql_error() ? And you probably don't want the semicolon at the end of the query string (the one inside the double quotes). miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable won't work in function, even when I global it?
I won't send the whole value of $footertext, it's too long. Yes, it contains the contents of the footer file. I have tried displaying it before the function and it works fine. Martin Towell wrote: what's that value of $footertext? is it the actual contents of the footer file? have you tried displaying the contents of $footertext just before you call checkmember()? does it contain what you're expecting? -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 3:23 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable won't work in function, even when I global it? On my website, I open my header (and footer) file with fileopen and then eval() it. I know I should include them, but I knew nothing about php when I did this. Anyway, I'm working on groups for my website. They will be a kind of club. At the top of every group page, I include a group function file. Among those functions is one that checks if the user trying to go to the group is a member of it. If not, it gives them an error message and exits. It is also supposed to eval() the footer before exiting. My code is as follows: function checkmember(){ global $groupid; global $userinfo; global $footertext; if($groupid != $userinfo['groupid']){ print bError:/b you're not a member of this group.; eval($footertext); exit; } return; } The thing is, it doesn't seem to eval() the footer. I've even tried getting $footertext out of the $GLOBALS array. I have also tried printing $footertext to make sure it wasn't a problem with evel(). Nothing has worked. When I did isset() on $GLOBALS['footertext'], it worked however. Thanks to anybody who can help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable won't work in function, even when I global it?
Rather than continuing to shroud this in mystery, could you at least give us a taste of what is in $footertext? miguel On Mon, 20 May 2002, Leif K-Brooks wrote: I won't send the whole value of $footertext, it's too long. Yes, it contains the contents of the footer file. I have tried displaying it before the function and it works fine. Martin Towell wrote: what's that value of $footertext? is it the actual contents of the footer file? have you tried displaying the contents of $footertext just before you call checkmember()? does it contain what you're expecting? -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 3:23 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable won't work in function, even when I global it? On my website, I open my header (and footer) file with fileopen and then eval() it. I know I should include them, but I knew nothing about php when I did this. Anyway, I'm working on groups for my website. They will be a kind of club. At the top of every group page, I include a group function file. Among those functions is one that checks if the user trying to go to the group is a member of it. If not, it gives them an error message and exits. It is also supposed to eval() the footer before exiting. My code is as follows: function checkmember(){ global $groupid; global $userinfo; global $footertext; if($groupid != $userinfo['groupid']){ print bError:/b you're not a member of this group.; eval($footertext); exit; } return; } The thing is, it doesn't seem to eval() the footer. I've even tried getting $footertext out of the $GLOBALS array. I have also tried printing $footertext to make sure it wasn't a problem with evel(). Nothing has worked. When I did isset() on $GLOBALS['footertext'], it worked however. Thanks to anybody who can help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can someone check this mysql code
Try this.. ?php $answers=$band, $middlename, $pot; $date=date (l dS of F Y h:i:s A); $sql = INSERT INTO prizeline VALUES ('', 'email', 'name', 'address', 'answers', 'date');; -Balaji -Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 11:12 AM To: PhilipNZ Staff Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Can someone check this mysql code On Mon, 20 May 2002, PhilipNZ Staff wrote: My code below don't want to insert the code into the database what am I doing wrong? ?php $answers=$band, $middlename, $pot; $date=date (l dS of F Y h:i:s A); $sql = INSERT INTO `prizeline` (`id`, `email`, `name`, `address`, `answers`, `date`) VALUES ('', 'email', 'name', 'address', 'answers', 'date');; What is the error message shown when you printed mysql_error() ? And you probably don't want the semicolon at the end of the query string (the one inside the double quotes). miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php **Disclaimer** Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable won't work in function, even when I global it?
Ok, I guess I'll send it. Thanks for trying to help. Here it is: $ip = $REMOTE_ADDR; $query = mysql_query(select COUNT(*) as rowexists from ips where ip = '$ip'); $result = mysql_fetch_array($query); if(($result['rowexists'] == 0) ($loggedin)){ mysql_query(INSERT INTO `ips` (ip,username) VALUES ('$ip','$userinfo[username]')) or print Error: .mysql_error(); } $time_end = getmicrotime(); $time_taken = $time_end - $time_start; $query = mysql_query(select COUNT(*) as cnt from ips); $result = mysql_fetch_array($query); $visits = $result['cnt'] + 2800; eval($getlayout['footer']); Miguel Cruz wrote: Rather than continuing to shroud this in mystery, could you at least give us a taste of what is in $footertext?
Re: [PHP] Variable won't work in function, even when I global it?
Okay, I'm pretty sure your problem is this: All those variables referenced in $footertext ($REMOTE_ADDR, $userinfo, etc.) need to be brought into the local context in the function calling eval(), using the global keyword. Otherwise they won't be available. miguel On Mon, 20 May 2002, Leif K-Brooks wrote: Ok, I guess I'll send it. Thanks for trying to help. Here it is: $ip = $REMOTE_ADDR; $query = mysql_query(select COUNT(*) as rowexists from ips where ip = '$ip'); $result = mysql_fetch_array($query); if(($result['rowexists'] == 0) ($loggedin)){ mysql_query(INSERT INTO `ips` (ip,username) VALUES ('$ip','$userinfo[username]')) or print Error: .mysql_error(); } $time_end = getmicrotime(); $time_taken = $time_end - $time_start; $query = mysql_query(select COUNT(*) as cnt from ips); $result = mysql_fetch_array($query); $visits = $result['cnt'] + 2800; eval($getlayout['footer']); Miguel Cruz wrote: Rather than continuing to shroud this in mystery, could you at least give us a taste of what is in $footertext? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable won't work in function, even when I global it?
No good. :-( Miguel Cruz wrote: Okay, I'm pretty sure your problem is this: All those variables referenced in $footertext ($REMOTE_ADDR, $userinfo, etc.) need to be brought into the local context in the function calling eval(), using the global keyword. Otherwise they won't be available. miguel On Mon, 20 May 2002, Leif K-Brooks wrote: Ok, I guess I'll send it. Thanks for trying to help. Here it is: $ip = $REMOTE_ADDR; $query = mysql_query(select COUNT(*) as rowexists from ips where ip = '$ip'); $result = mysql_fetch_array($query); if(($result['rowexists'] == 0) ($loggedin)){ mysql_query(INSERT INTO `ips` (ip,username) VALUES ('$ip','$userinfo[username]')) or print Error: .mysql_error(); } $time_end = getmicrotime(); $time_taken = $time_end - $time_start; $query = mysql_query(select COUNT(*) as cnt from ips); $result = mysql_fetch_array($query); $visits = $result['cnt'] + 2800; eval($getlayout['footer']); Miguel Cruz wrote: Rather than continuing to shroud this in mystery, could you at least give us a taste of what is in $footertext?