[PHP] PHP-MySQL?!
Hello people: I'm building a Site which contains this: Escolha uma espécie -- "; $db = mysql_connect("localhost","user","pass"); mysql_select_db("listing"); $list = mysql_query("SELECT nome FROM listagem"); while ($list_especies = mysql_fetch_row($list)) { for ($i=0;$i<1;$i++) { echo " $list_especies[$i] "; } } echo""; mysql_close($db); ?> where: localhost -> it's my server name user -> my mysql username pass -> my mysql password listing -> my table, which contains one only column, with more than 3877 lines (named nome). Problem is, when I try to execute the .PHP page with this stuff, it keeps blinking until it tells me that the page could not be found. NOTE: If I use in the query: "... LIMIT 1000", it show the 1000 lines with no problem. Thanks people, bsantos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help on OOP
> if anyone can suggest the best tutorial on OBJECTS and CLASSES, I'll be grateful. for a very well written treatment (albeit no tutorials) of most things PHP (including OOP) I'd recommend O'Reilly's book Programming PHP (by Rasmus Lerdorf and Kevin Tatroe). David Eisenhart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Justin, Jumping in late... > >> Daylight Savings Time? > > John, I think "Daylight Saving Time" creates a difference of 1 hour and not > > 1 day :) > True... but I checked it anyway -- by adding just one and two hours to the > stamp... which made no difference... but when I added 86400 to the stamp, it > all worked. =depends upon the time of day! (its a logic 'twister', like saying even a stopped clock is correct twice per day) > > Justin, it depends how you got your "timestamp" in the first place, I > > think... > > I could be wrong again here but aren't these different? > > mktime() > > gmmktime() =absolutely! One just 'works', the other relates everything back to GMT before performing the same calcs. > Actually, they were created with strtotime(). Note, I don't believe there's > anything wrong with the stamp itself. The point is, the stamp is displaying > as two different dates using date() on two different servers, and I believe > this is not what date() is supposed to do. > Shouldn't the stamp for 12-09-2002 22:13:09 be the same on every server? =yes, no, not necessarily! > My rationale for this is that no matter where you are in the world, it is > always a certain number of seconds since 01-01-1970 00:00:00. =yes, no..., watch out for the interpretations that are applied EVERY time you call a function! > Perhaps strtotime() is NOT running off GMT, and perhaps date() is... there > has to be SOME confusion there -- either on my side, or in my choice of > functions, or SOMETHING :) =any call to system time will get you the time that has been set on the SERVER (although there is a PHP function for local-time, somewhere - have never used it). So the first question is, where is the server? The second question is, what time zone (TZ) has it been set to run within? (NB you can run a server in Sydney, but set its clock so that it 'appears' to be in Perth - if you really want to...) =now let's take a look at the UNIX Epoch. Various 'quotations' have surfaced in this email, and I don't recall that it is well discussed within the PHP manual (it being a UNIX definition after all...). The epoch 'began' 1Jan1970, sure enough (exactly as quoted). HOWEVER it is defined as beginning at Greenwich: 1Jan1970 at midnight UTC in Greenwich... =So a timestamp of 'zero' in London (UTC) would see the east coast of Australia at 39600 local (TZ of +1100 (hours)). =if at that very time I was in London and you in TZ+1100 and we waited one hour, the asked for the current timestamp: I would get 3600 and you 43200. So whereas I can subtract zero from current time and get one hour, you must subtract 39600 from 43200 to get the correct answer - in other words, don't use "zero", but 'Epoch-zero' adjusted for TZ. =as soon as you start to twist your mind around all this, you realise why Dr Who was a bit loopy about the size of telephone boxes, etc! Time travel is not for the faint-hearted (nor the mathematically-challenged/regular lottery ticket purchasers)! =PHP provides a solution in the gm*() series. The best/only solution is to find a common timebase. I've worked with American (and one Japanese) companies who (initially) insisted on time-basing everything to HEAD OFFICE (caps to demonstrate scale of self-importance, eg "this report must be in by 1700 in ..."), and usually they end up tripping themselves up, and thus provide me with the 'proof' of the illustrations/arguments I made at the design stage (that they chose not to listen to...) =The reality is that everyone works off UTC (NB "GMT" whilst widely used/terminology within PHP is not the "internationally PC term") - including the (alert) Americans - the US military refers/referred to UTC/GMT as "Zulu time" (which has more to do with the alphabet than warriors). So if I'm in Germany and I'm phoning you early/late in the day, to avoid holding our conversation in a less socially-acceptable climate I would first compare my time against UTC (+0100) and then compare your time against UTC (+1100), do the math to get a difference of +10 hours, add that to my local time, and thereafter place/delay the call... (try doing this calculation based upon something like Indian Standard Time, and add a Daylight Saving/Summer-Time adjustment into the mix, just for 'fun'!?) =In conclusion, (based upon my, cough, cough, many years of wrestling with this sort of thing) make all stored times UTC (gm*()) - the RDBMS should not 'filter' timestamps - MySQL does not (for example), and then if you want 'local' times you can 'do the math' for either the server's TZ or (if you're really masochistic (?is that the word?)) the browser-client's local time. The 'silver lining' is that you can now easily accommodate temporal input/presentations to/from anyone, anywhere in the world - it is also easy to produce code to calculate the server's local time (for example), so that the same routine works regardless of where the server is located - where next year's new 'mirror' is to be located, anywhere
Re: [PHP] date() on two diff. servers
Thanks heaps -- very reassuring :) Justin on 09/12/02 9:49 PM, DL Neil ([EMAIL PROTECTED]) wrote: > Justin, > Jumping in late... > Daylight Savings Time? >>> John, I think "Daylight Saving Time" creates a difference of 1 hour and > not >>> 1 day :) >> True... but I checked it anyway -- by adding just one and two hours to the >> stamp... which made no difference... but when I added 86400 to the stamp, > it >> all worked. > > =depends upon the time of day! > (its a logic 'twister', like saying even a stopped clock is correct twice > per day) > >>> Justin, it depends how you got your "timestamp" in the first place, I >>> think... >>> I could be wrong again here but aren't these different? >>> mktime() >>> gmmktime() > > =absolutely! One just 'works', the other relates everything back to GMT > before performing the same calcs. > >> Actually, they were created with strtotime(). Note, I don't believe > there's >> anything wrong with the stamp itself. The point is, the stamp is > displaying >> as two different dates using date() on two different servers, and I > believe >> this is not what date() is supposed to do. >> Shouldn't the stamp for 12-09-2002 22:13:09 be the same on every server? > > =yes, no, not necessarily! > >> My rationale for this is that no matter where you are in the world, it is >> always a certain number of seconds since 01-01-1970 00:00:00. > > =yes, no..., watch out for the interpretations that are applied EVERY time > you call a function! > >> Perhaps strtotime() is NOT running off GMT, and perhaps date() is... there >> has to be SOME confusion there -- either on my side, or in my choice of >> functions, or SOMETHING :) > > =any call to system time will get you the time that has been set on the > SERVER (although there is a PHP function for local-time, somewhere - have > never used it). So the first question is, where is the server? The second > question is, what time zone (TZ) has it been set to run within? (NB you can > run a server in Sydney, but set its clock so that it 'appears' to be in > Perth - if you really want to...) > > =now let's take a look at the UNIX Epoch. Various 'quotations' have surfaced > in this email, and I don't recall that it is well discussed within the PHP > manual (it being a UNIX definition after all...). The epoch 'began' > 1Jan1970, sure enough (exactly as quoted). HOWEVER it is defined as > beginning at Greenwich: 1Jan1970 at midnight UTC in Greenwich... > > =So a timestamp of 'zero' in London (UTC) would see the east coast of > Australia at 39600 local (TZ of +1100 (hours)). > > =if at that very time I was in London and you in TZ+1100 and we waited one > hour, the asked for the current timestamp: I would get 3600 and you 43200. > So whereas I can subtract zero from current time and get one hour, you must > subtract 39600 from 43200 to get the correct answer - in other words, don't > use "zero", but 'Epoch-zero' adjusted for TZ. > > =as soon as you start to twist your mind around all this, you realise why Dr > Who was a bit loopy about the size of telephone boxes, etc! Time travel is > not for the faint-hearted (nor the mathematically-challenged/regular lottery > ticket purchasers)! > > =PHP provides a solution in the gm*() series. The best/only solution is to > find a common timebase. I've worked with American (and one Japanese) > companies who (initially) insisted on time-basing everything to HEAD OFFICE > (caps to demonstrate scale of self-importance, eg "this report must be in by > 1700 in ..."), and usually they end up tripping themselves up, and thus > provide me with the 'proof' of the illustrations/arguments I made at the > design stage (that they chose not to listen to...) > > =The reality is that everyone works off UTC (NB "GMT" whilst widely > used/terminology within PHP is not the "internationally PC term") - > including the (alert) Americans - the US military refers/referred to UTC/GMT > as "Zulu time" (which has more to do with the alphabet than warriors). So if > I'm in Germany and I'm phoning you early/late in the day, to avoid holding > our conversation in a less socially-acceptable climate I would first compare > my time against UTC (+0100) and then compare your time against UTC (+1100), > do the math to get a difference of +10 hours, add that to my local time, and > thereafter place/delay the call... (try doing this calculation based upon > something like Indian Standard Time, and add a Daylight Saving/Summer-Time > adjustment into the mix, just for 'fun'!?) > > =In conclusion, (based upon my, cough, cough, many years of wrestling with > this sort of thing) make all stored times UTC (gm*()) - the RDBMS should not > 'filter' timestamps - MySQL does not (for example), and then if you want > 'local' times you can 'do the math' for either the server's TZ or (if you're > really masochistic (?is that the word?)) the browser-client's local time. > The 'silver lining' is that you can now easily accommodate temporal > inp
[PHP] PHP WSDL Generator??
Hello: I'm looking for a WSDL generator for PHP, it must parse the PHP code and generate WSDL file from the functions on a source file. Do you know of any? Regards. -- XPde :: XP-like desktop environment (developed with Kylix ;-) http://www.xpde.com signature.asc Description: This is a digitally signed message part
Re: [PHP] PHP-MySQL?!
Bsantos PHP wrote: for ($i=0;$i<1;$i++) { Your "for" loop appears not needed, it only gets executed once. Problem is, when I try to execute the .PHP page with this stuff, it keeps blinking until it tells me that the page could not be found. NOTE: If I use in the query: "... LIMIT 1000", it show the 1000 lines with no problem. 1000 lines on a web page is a lot, particularly 1000 items for someone to select from. Does your application really need 3877 items for the user to select from (in one select list)? Depending upon your browser and OS, I feel you may be hitting memory problems. I found some limits similar to this under Win98 which were not there under NT. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading images to MySQL BLOB column
Hi everyone, i don't have any experience with uploading images through PHP so i'd like to ask you? I' starting one server where we have some articles added by users through PHP script and i want to also every article to has its own image showed above. I thought that it could be a could to upload the image to the blob column in database. Can anyone help how to save uploaded image in blob and how to retrieve it from the database and show in web page. Thank you very much Milan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] date() on two diff. servers
> -Original Message- > From: DL Neil [mailto:[EMAIL PROTECTED]] > Sent: 09 December 2002 10:50 [snip...] > =now let's take a look at the UNIX Epoch. Various > 'quotations' have surfaced > in this email, and I don't recall that it is well discussed > within the PHP > manual (it being a UNIX definition after all...). The epoch 'began' > 1Jan1970, sure enough (exactly as quoted). HOWEVER it is defined as > beginning at Greenwich: 1Jan1970 at midnight UTC in Greenwich... > > =So a timestamp of 'zero' in London (UTC) would see the east coast of > Australia at 39600 local (TZ of +1100 (hours)). Er -- no, I think you've got that backwards. Unix timestamps are, as you rightly say, seconds since 00:00 1-Jan-1970 GMT, so, at any instant, the Unix timestamp is the same at every point on the globe. It's only the *local* *times* (on the server, of course) that change. So, the Unix timestamp of 0 represents: 00:00 1-Jan-1970 GMT 19:00 31-Dec-1969 on the east coast of Canada/USA (5 hours behind GMT) 09:30 1-Jan-1970 in Australia's Northern Territory (9.5 hour ahead of GMT -- I know this one 'cos my sister lives there!) >From this, you can see why the same time stamp might give you different dates if your servers are in different timezones -- espacially ones as widely different as Australia and Canada! > =if at that very time I was in London and you in TZ+1100 and > we waited one > hour, the asked for the current timestamp: I would get 3600 > and you 43200. Again, no: if I, at 01:00 local in GMT, and he at 12:00 local in a GMT+1100 timezone -- that is, the very same instant -- both asked for the current UNIX timestamp, we would both get the same answer. > =The reality is that everyone works off UTC (NB "GMT" whilst widely > used/terminology within PHP is not the "internationally PC term") - > including the (alert) Americans - the US military > refers/referred to UTC/GMT > as "Zulu time" (which has more to do with the alphabet than > warriors). So if > I'm in Germany and I'm phoning you early/late in the day, to > avoid holding > our conversation in a less socially-acceptable climate I > would first compare > my time against UTC (+0100) and then compare your time > against UTC (+1100), > do the math to get a difference of +10 hours, add that to my > local time, and > thereafter place/delay the call... (try doing this > calculation based upon > something like Indian Standard Time, and add a Daylight > Saving/Summer-Time > adjustment into the mix, just for 'fun'!?) Well, the time/date functions provided in PHP can do all this for you. > =In conclusion, (based upon my, cough, cough, many years of > wrestling with > this sort of thing) make all stored times UTC (gm*()) Yes -- as the Unix timestamp is an *absolute*, always expressed in GMT regardless of where you are (or, rather, where your server is!), this is the one to use as your base. > - the > RDBMS should not > 'filter' timestamps - MySQL does not (for example), and then > if you want > 'local' times you can 'do the math' for either the server's > TZ or (if you're > really masochistic (?is that the word?)) the browser-client's > local time. > The 'silver lining' is that you can now easily accommodate temporal > input/presentations to/from anyone, anywhere in the world - > it is also easy > to produce code to calculate the server's local time (for > example), so that > the same routine works regardless of where the server is > located - where > next year's new 'mirror' is to be located, anywhere in the world! To amplify on this: Doing a strtotime() or a mktime() will assume you are expressing the date/time in the local (to the server) timezone, and do necessary adjustments to produce your GMT-based Unix timestamp (unless, that is, you pass a string to strtotime() which contains a timezone expression such as EST or -0500!); gmmktime will assume you are providing a GMT date/time and make no such adjustment. Similarly, in the reverse direction, date() will take the GMT-based timestamp, adjust it for local timezone and DST, if any, and then format the result; gmdate simply formats the timestamp, thus expressing it in GMT. I, too have wrestled with this quite a lot before eventually coming to this understanding -- not helped by my location, which means that for half the year I'm in GMT and so can't see the local effect of any corrections I'm applying!!! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can I check MYSQL version
> -Original Message- > From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]] > Sent: 08 December 2002 19:57 > > mysql> SELECT VERSION(); > -> '3.23.13-log' > > Ok, how do I PHP it for greater than or equals version 4 :? Simplistic: if ($mysql_version[0]>="4") ... More sophisticated: $mysql_ver_parts = explode('.', $mysql_version); if ($mysql_ver_parts[0]>=4) ... Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Move Database
Hi, I am moving my site from one server to another, how can i copy all the data in my datbase to my new server? Also is it possibel to do this one table at a time? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading images to MySQL BLOB column
On Monday 09 December 2002 19:43, [EMAIL PROTECTED] wrote: > Hi everyone, > i don't have any experience with uploading images through PHP so > i'd like to ask you? > I' starting one server where we have some articles added by users > through PHP script and i want to also every article to has its own > image showed above. I thought that it could be a could to upload the > image to the blob column in database. > Can anyone help how to save uploaded image in blob and how to > retrieve it from the database and show in web page. google > php insert blob mysql -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Minnie Mouse is a slow maze learner. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Move Database
> Hi, > I am moving my site from one server to another, how can i copy all the data > in my datbase to my new server? Also is it possibel to do this one table at > a time? Backup from command line: mysqldump -h -u -p > backup.sql or mysqldump -h -u -p ... > backup.sql In backup.sql you get CREATE and INSERT syntax. In new server you can execute: mysql -h -u -p < backup.sql Of course in new server you must create DATABASE before. -- Krzysztof Dziekiewicz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ioctl() in PHP
Hello PHP'ers! We wish to control a hardware device (a GPIB card) using a web interface. This device is normally controlled using either: 1. simple ioctl() calls to the linux kernel 2. by a higher level C-library which inturn calls these ioctl()s. Does PHP support system calls like ioctl()? I was unable to find it in the PHP manual. Or even better, can I use the high-level C library functions for this card from within PHP, without _too_ much of hacking into the internals of PHP ? best regards, Lokesh Setia. -- University of Applied Sciences, Offenburg, Germany. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] re-compiling php4
Hello List, Even though I´d compiled and installed my source php4.3 sucessfull I will get the following compiling information by php.info: Configure Command './configure' '--with-gd' '--with-zlib' and nothing else. Even though I´d compiled it with the following flags with removed config.cache: ./configure --prefix=/usr/local/php_stable7 --enable-exif --enable-track-vars --with-calendar=shared --enable-magic-quotes --enable-trans-sid --enable-wddx --enable-ftp --enable-inline-optimization --enable-memory-limit --with-gd=/usr/local/gd2 --with-zlib-dir=/usr --enable-gd-native-tt --with-t1lib=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-ttf --with-freetype-dir=/usr --with-unixodbc --with-tiff-dir=/usr --with-jpeg-dir=/usr --with-snmp --with-openssl --enable-sysvshm --enable-bcmath --with-gettext --with-mysql --with-pgsql --with-ldap --with-config-file-path=/etc --enable-force-cgi-redirect --enable-dio --enable-mime-magic --with-ncurses --enable-pcntl --with-pgsql --enable-sockets Anybody knows? Oliver
[PHP] variable scope in nested functions
Is there a way to access a variable defined in a function from a nested function, without putting the variable in the global scope? Perhaps some code will make my question clearer: function enclosing() { $variable1; function enclosed() { can I access $variable1 from here? } } Thanks, fbv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Different output on two different servers
Hi all, I have set-up a production server and a live server. The problem is with the production server. I am using PHP version 4.2.3 and MySQL 3.23.39 on both servers. We have just configured the production server to mimick the live server (which incidentally works fine) and the code from both servers is identical. I dumped all the data into the production MySQL database then copied the code from the live server to our production one and there didn't seem to be any problems. However today my boss asked for a new category to go into our webshop with a new product. I went into MySQL and updated the database fine then when I went to check the section of the site to see if the extra category and product are there I get my own PHP encoded error 'No categories currently available'. It fails on the first function: function display_categories($cat_array) { //display all categories in the array passed in if (!is_array($cat_array)) { echo "No categories currently available."; } else { //create table echo ""; etc. Now it works superbly on my live server and did work fine until I tried adding another field to the database on the production server. Where should I start looking to de-bug this? Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Just Curious
On Sun, 2002-12-08 at 04:31, conbud wrote: > I was just curious, but what program or website do you all use to view and > reply to the newsgroups with ? Ximian Evolution 1.0.8 -- Dan Field Systems Development Officer - Social Services Dept. Ceredigion County Council. Mae'r neges ebost hon, ynghyd ag unrhyw ffeiliau sydd ynghlwm wrthi, yn gyfrinachol ac at ddefnydd yr unigolyn neu sefydliad y cyfeiriwyd hi ato. Pe dderbynioch y neges hon mewn camgymeriad, byddwch mor garedig a rhoi gwybod i'r rheolwr system. Mae'r nodyn hwn hefyd yn cadarnhau bod y neges ebost hon wedi cael ei archwilio am bresenoldeb feirws cyfrifiadurol gan MIMEsweeper. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ioctl() in PHP
On Mon, 2002-12-09 at 13:41, Lokesh Setia wrote: > > > Hello PHP'ers! > > We wish to control a hardware device (a GPIB card) using a web > interface. This device is normally controlled using either: > > 1. simple ioctl() calls to the linux kernel > 2. by a higher level C-library which inturn calls these ioctl()s. > > Does PHP support system calls like ioctl()? I was unable to find it in > the PHP manual. Or even better, can I use the high-level C library > functions for this card from within PHP, without _too_ much of hacking > into the internals of PHP ? > I'm not an expert, but I think that your best bet is to write an external module for php that creates the necessary bindings for your high level API. Check the docs for the details: http://www.php.net/manual/en/zend.php bye, fbv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help on OOP
I found this to be a good beginners tutorial on the subject http://www.onlamp.com/pub/a/php/2002/07/18/php_foundations.html Craig "Mohd_q" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I can't distinguish between objects, classes, and functions. Here is a question - sorry if appear to be rediculous : -- Can we have a function inside another function? if anyone can suggest the best tutorial on OBJECTS and CLASSES, I'll be grateful. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Different output on two different servers
Steve Not quite clear on your problem - did you run an ALTER TABLE on your MySQL table or just an INSERT of a new row? Assuming it was the former, all I can say is look at the code that populates the $cat_array variable to see if the underlying query would have been affected by the alter table command... Does the query that populates $cat_array run OK if executed directly in MySQL? Rich -Original Message- From: Steve Jackson [mailto:[EMAIL PROTECTED]] Sent: 09 December 2002 13:11 To: PHP General Subject: [PHP] Different output on two different servers Hi all, I have set-up a production server and a live server. The problem is with the production server. I am using PHP version 4.2.3 and MySQL 3.23.39 on both servers. We have just configured the production server to mimick the live server (which incidentally works fine) and the code from both servers is identical. I dumped all the data into the production MySQL database then copied the code from the live server to our production one and there didn't seem to be any problems. However today my boss asked for a new category to go into our webshop with a new product. I went into MySQL and updated the database fine then when I went to check the section of the site to see if the extra category and product are there I get my own PHP encoded error 'No categories currently available'. It fails on the first function: function display_categories($cat_array) { //display all categories in the array passed in if (!is_array($cat_array)) { echo "No categories currently available."; } else { //create table echo ""; etc. Now it works superbly on my live server and did work fine until I tried adding another field to the database on the production server. Where should I start looking to de-bug this? Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] make error
Hi PHP-List, after re-compiling my new and stable version of php-4.3.0-dev on a redhat 7.3 box I compilied this version in order to use the benefits of gd with the following compiling options: ./configure --prefix=/usr/local/php_stable7 ... --with-gd=/usr ... and when I run make I will get the following error report: ext/gd/gd.o: In function `zif_imagecolormatch': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:751: undefined reference to `gdImageColorMatch' ext/gd/gd.o: In function `zif_imagerotate': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1022: undefined reference to `gdImageRotate' ext/gd/gd.o: In function `zif_imagecreatefromstring': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1237: undefined reference to `gdImageCreateFromGifCtx' ext/gd/gd.o: In function `zif_imagecreatefromgif': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined reference to `gdImageCreateFromGifCtx' /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined reference to `gdImageCreateFromGif' ext/gd/gd.o: In function `_php_image_convert': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:3602: undefined reference to `gdImageCreateFromGif' collect2: ld returned 1 exit status How can I govern this? Oliver
[PHP] PHP with JSP
Hello, I hava to develop a solution that use PHP and JSP. But the system has to use the same session. I´ve already installed the PHP integration with Java and it works. But I can´t find the class to call a session? Regards Rodrigo Rezende PHP Developer
[PHP] Re: make error
Hi there, Just a question, Have you actually run phpinfo() to see if your vendor supplied PHP rpms come with gd support or not??? On my SuSe 8.1, phpinfo() contains the following bits about gd: __gd__ GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with freetype T1Lib Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled Chances are that you already have what you are looking for. loki# [EMAIL PROTECTED] wrote: Hi PHP-List, after re-compiling my new and stable version of php-4.3.0-dev on a redhat 7.3 box I compilied this version in order to use the benefits of gd with the following compiling options: ./configure --prefix=/usr/local/php_stable7 ... --with-gd=/usr ... and when I run make I will get the following error report: ext/gd/gd.o: In function `zif_imagecolormatch': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:751: undefined reference to `gdImageColorMatch' ext/gd/gd.o: In function `zif_imagerotate': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1022: undefined reference to `gdImageRotate' ext/gd/gd.o: In function `zif_imagecreatefromstring': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1237: undefined reference to `gdImageCreateFromGifCtx' ext/gd/gd.o: In function `zif_imagecreatefromgif': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined reference to `gdImageCreateFromGifCtx' /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined reference to `gdImageCreateFromGif' ext/gd/gd.o: In function `_php_image_convert': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:3602: undefined reference to `gdImageCreateFromGif' collect2: ld returned 1 exit status How can I govern this? Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Snoopy Class
A tutorial to help you do *what* exactly? The readme provides plenty of examples: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/snoopy/Snoopy/README?rev=1.6&; content-type=text/vnd.viewcvs-markup "Dl Neil" <[EMAIL PROTECTED]> wrote in message 112b01c29eb6$cf239f90$c900a8c0@jrbrown">news:112b01c29eb6$cf239f90$c900a8c0@jrbrown... > (pardon the pun) > > Please recommend a Snoopy tutorial, > =dn > > PS Google has not been my friend! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Output page cut off after 7000 characters
No, it is not output from a DB, just a simple static text file with some PHP functions in it, but even if I remove them, the error remains the same. I have now upgraded to Apache 1.3.17 and php4.2.3 no change. One idea which cam into my mind: might an error much later on in the page generation interrupt the output? It takes a few seconds to after the page starts to loud until the server closes the connection. Regards Fritz At 05:48 07.12.2002, Tom Rogers wrote: Hi, Thursday, December 5, 2002, 9:40:20 PM, you wrote: FW> Hi All, FW> i have to migrate a website from WNT/IIS to Solaris/Apache. FW> Some stuff seems to work, but now I am stuck with a page which gets cut FW> off in the middle of the out put. It is a template system with a chain FW> of includes and requires (4 files involved, no fancy stuff, just some FW> variable assignements and selection of templates based on the HTTP_HOST FW> header). The last file contains the HTML code for the browser, the FW> server starts to send the output to the client, but stops in the middle FW> of this file. The cut appears after a certain constant number of FW> characters (7728 characters, cr's not counted). FW> CR/LFs are not an issue, I verified all invioved files, they are just FW> plain text, even in vi ;-) FW> I have Apache/1.3.14 (Unix) PHP/4.0.6 tomcat/1.0 (tomcat is not used for FW> this pages) FW> Has anybodey an idea whre to look for the cause? FW> Thanks FW> Fritz If the data is coming from an odbc connected database you may need to take a look at odbc_longreadlen() -- regards, Tom Ascom AG Ascom Informatik Fritz Wittwer Internet Services (SING) Belpstrasse 37, CH-3000 Bern 14 Phone: +41 31 999 4285 [EMAIL PROTECTED] _
Re: [PHP] date() on two diff. servers
Hello gurus, "Ford, Mike [LSS]" <[EMAIL PROTECTED]> wrote: [snip] > To amplify on this: > ... [/snip] Interesting comments! ...not sure if I understood everything though :( Anyway, for Justin's original problem, I think it'll be solve by "simply" doing two things: 1. Add " GMT" to the end of the string being passed to strtotime(). 2. Use gmdate() instead of date(). Ex. 1039558389 // without it, echo $my_stamp --> 1039525989 $my_stamp = strtotime($my_date); echo "$my_stamp"; echo gmdate('D, d M Y G:i:s', $my_stamp); // Conclusion: Using strtotime() with GMT will create // a timestamp that if used with gmdate() will produce // desired result whichever timezone you run the script. ?> That should work. If not, tell me about it later--I'm more than happy to be corrected. But for now, I'll be taking some rest :) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [bob@elitegroup.on.ca: image resize error still happening]
Why is the below occuring?? I am using the most current libraries available. - Forwarded message from Bob Federer <[EMAIL PROTECTED]> - Resent-Message-Id: <[EMAIL PROTECTED]> Reply-To: <[EMAIL PROTECTED]> From: "Bob Federer" <[EMAIL PROTECTED]> To: "Dave Y" <[EMAIL PROTECTED]> Subject: image resize error still happening Date: Sun, 8 Dec 2002 11:42:29 -0500 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Resent-From: [EMAIL PROTECTED] Resent-Date: Mon, 9 Dec 2002 07:47:47 -0700 Resent-To: The Doctor <[EMAIL PROTECTED]> Hi Dave, Im still getting the following error when trying to run any of the scripts for resizing jpgs: Fatal error: Call to undefined function: imagecreatefromjpeg() in /usr/home/swp/html/php/thumbtest.php on line 20 The source for thumbtest.php is as follows if it helps (the file is in the php folder in swp): $old_y) { $thumb_w=$new_w; $thumb_h=$old_y*($new_h/$old_x); } if ($old_x < $old_y) { $thumb_w=$old_x*($new_w/$old_y); $thumb_h=$new_h; } if ($old_x == $old_y) { $thumb_w=$new_w; $thumb_h=$new_h; } if ($gd2==""){ $dst_img=ImageCreate($thumb_w,$thumb_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); }else{ $dst_img=ImageCreateTrueColor($thumb_w,$thumb_h); imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y ); } if (preg_match("/png/",$system[1])){ imagepng($dst_img,$filename); } else { imagejpeg($dst_img,$filename); } imagedestroy($dst_img); imagedestroy($src_img); } $gd2=checkgd(); print ( $gd2 ); $p="pic1.jpg"; createthumb("pics/".$p,"thumbs/tn_".$p,100,100); ?> - End forwarded message - -- Member - Liberal International On 11 Sept 2001 the WORLD was violated. This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] Society MUST be saved! Extremists must dissolve. Merry Christmas 2002 and Happy 2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating a report in PHP
I have a DB that the users maintain of usual address information. I would like to create a report from the current data so that any user can download it. Is there a "report generator" that will give me the flexibility to use fonts and fontfaces that works with PHP and MySQL? Many thanks.. Todd --
Re[2]: [PHP] Output page cut off after 7000 characters
Hi, Tuesday, December 10, 2002, 12:09:46 AM, you wrote: FW> No, it is not output from a DB, just a simple static text file with some FW> PHP functions in it, but even if I remove them, the error remains the same. FW> I have now upgraded to Apache 1.3.17 and php4.2.3 no change. FW> One idea which cam into my mind: might an error much later on in the page FW> generation interrupt the output? It takes a few seconds to after the page FW> starts to loud until the server closes the connection. FW> Regards FW> Fritz Does the apache error_log give any clues? -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Table backup
Hi, I am trying to backup my database can someone please tell me why the following commande wont work? mysqldump -h localhost -u username -p databasename > backup.sql thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Table backup
Take off the " > backup.sql" and see if you get any error's that might explain it. On Mon, 2002-12-09 at 10:07, Shaun wrote: Hi, I am trying to backup my database can someone please tell me why the following commande wont work? mysqldump -h localhost -u username -p databasename > backup.sql thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] Re: make error
Hi Lokesh, And I did run php.info >On my SuSe 8.1, phpinfo() contains the Did you ever compile php? - Original Message - From: Lokesh Setia To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, December 09, 2002 3:03 PM Subject: [PHP] Re: make error Hi there, Just a question, Have you actually run phpinfo() to see if your vendor supplied PHP rpms come with gd support or not??? On my SuSe 8.1, phpinfo() contains the following bits about gd: __gd__ GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with freetype T1Lib Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled Chances are that you already have what you are looking for. loki# [EMAIL PROTECTED] wrote: > Hi PHP-List, > > > after re-compiling my new and stable version of php-4.3.0-dev on a redhat 7.3 box > I compilied this version in order to use the benefits of gd with the following compiling options: > > ./configure --prefix=/usr/local/php_stable7 ... --with-gd=/usr ... > > and when I run make I will get the following error report: > > > ext/gd/gd.o: In function `zif_imagecolormatch': > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:751: undefined reference to `gdImageColorMatch' > ext/gd/gd.o: In function `zif_imagerotate': > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1022: undefined reference to `gdImageRotate' > ext/gd/gd.o: In function `zif_imagecreatefromstring': > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1237: undefined reference to `gdImageCreateFromGifCtx' > ext/gd/gd.o: In function `zif_imagecreatefromgif': > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined reference to `gdImageCreateFromGifCtx' > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined reference to `gdImageCreateFromGif' > ext/gd/gd.o: In function `_php_image_convert': > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:3602: undefined reference to `gdImageCreateFromGif' > collect2: ld returned 1 exit status > > How can I govern this? > > Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] error on make
Hi PHP-List, after re-compiling my new and stable version of php-4.3.0-dev on a redhat 7.3 box I compilied this version in order to use the benefits of gd with the following compiling options: ./configure --prefix=/usr/local/php_stable7 ... --with-gd=/usr ... and when I run make I will get the following error report: ext/gd/gd.o: In function `zif_imagecolormatch': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:751: undefined reference to `gdImageColorMatch' ext/gd/gd.o: In function `zif_imagerotate': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1022: undefined reference to `gdImageRotate' ext/gd/gd.o: In function `zif_imagecreatefromstring': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1237: undefined reference to `gdImageCreateFromGifCtx' ext/gd/gd.o: In function `zif_imagecreatefromgif': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined reference to `gdImageCreateFromGifCtx' /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined reference to `gdImageCreateFromGif' ext/gd/gd.o: In function `_php_image_convert': /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:3602: undefined reference to `gdImageCreateFromGif' collect2: ld returned 1 exit status How can I govern this? Oliver
Re: [PHP] MySQL Table backup
thanks for the reply, but that didn't help ERROR 1064: You have an error in your SQL syntax near 'mysqldump -h localhost -u xxx -p xxx backup.sql' at line 1 any ideas? "Adam Voigt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Take off the " > backup.sql" and see if you get any error's that might explain it. On Mon, 2002-12-09 at 10:07, Shaun wrote: Hi, I am trying to backup my database can someone please tell me why the following commande wont work? mysqldump -h localhost -u username -p databasename > backup.sql thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Table backup
Shaun wrote: I am trying to backup my database can someone please tell me why the following commande wont work? mysqldump -h localhost -u username -p databasename > backup.sql Changing "username" and "databasename" to valid values on my database, I get this line to work here. What error are you getting? HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: make error
Hi Lokesch, Output is for gd gd GD Support => enabled GD Version => bundled (2.0 compatible) GIF Read Support => enabled PNG Support => enabled WBMP Support => enabled Any Hints? Oliver - Original Message - From: Lokesh Setia To: [EMAIL PROTECTED] Sent: Monday, December 09, 2002 4:28 PM Subject: Re: [PHP] Re: make error And how did you run it? one way is to give this command on the shell: echo "" | php > /tmp/output.html and then looking at the file /tmp/output.html with a web browser. loki On Monday 09 December 2002 16:19, you wrote: > Hi Lokesh, > > And I did run php.info > > >On my SuSe 8.1, phpinfo() contains the > > Did you ever compile php? > > - Original Message - > From: Lokesh Setia > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Sent: Monday, December 09, 2002 3:03 PM > Subject: [PHP] Re: make error > > > > Hi there, > > Just a question, > > Have you actually run phpinfo() to see if your vendor supplied PHP > rpms come with gd support or not??? On my SuSe 8.1, phpinfo() > contains the following bits about gd: > > __gd__ > GD Support enabled > GD Version 1.6.2 or higher > FreeType Support enabled > FreeType Linkage with freetype > T1Lib Support enabled > JPG Support enabled > PNG Support enabled > WBMP Support enabled > > Chances are that you already have what you are looking for. > > loki# > > [EMAIL PROTECTED] wrote: > > Hi PHP-List, > > > > > > after re-compiling my new and stable version of php-4.3.0-dev on > > a redhat 7.3 box I compilied this version in order to use the > > benefits of gd with the following compiling options: > > > > ./configure --prefix=/usr/local/php_stable7 ... --with-gd=/usr > > ... > > > > and when I run make I will get the following error report: > > > > > > ext/gd/gd.o: In function `zif_imagecolormatch': > > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:751: undefined > > reference to `gdImageColorMatch' ext/gd/gd.o: In function > > `zif_imagerotate': > > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1022: undefined > > reference to `gdImageRotate' ext/gd/gd.o: In function > > `zif_imagecreatefromstring': > > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1237: undefined > > reference to `gdImageCreateFromGifCtx' ext/gd/gd.o: In function > > `zif_imagecreatefromgif': > > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined > > reference to `gdImageCreateFromGifCtx' > > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:1393: undefined > > reference to `gdImageCreateFromGif' ext/gd/gd.o: In function > > `_php_image_convert': > > /usr/src/php4-STABLE-200212061230/ext/gd/gd.c:3602: undefined > > reference to `gdImageCreateFromGif' collect2: ld returned 1 exit > > status > > > > How can I govern this? > > > > Oliver > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re-compiling php4
On Monday 09 December 2002 20:58, [EMAIL PROTECTED] wrote: > Hello List, > Even though I´d compiled and installed my source php4.3 sucessfull I will > get the following compiling information by php.info: > > Configure Command './configure' '--with-gd' '--with-zlib' > > and nothing else. > > Even though I´d compiled it with the following flags with removed > config.cache: > > ./configure --prefix=/usr/local/php_stable7 --enable-exif > --enable-track-vars --with-calendar=shared --enable-magic-quotes > --enable-trans-sid --enable-wddx --enable-ftp --enable-inline-optimization > --enable-memory-limit --with-gd=/usr/local/gd2 --with-zlib-dir=/usr > --enable-gd-native-tt --with-t1lib=/usr --with-jpeg-dir=/usr > --with-png-dir=/usr --with-ttf --with-freetype-dir=/usr --with-unixodbc > --with-tiff-dir=/usr --with-jpeg-dir=/usr --with-snmp --with-openssl > --enable-sysvshm --enable-bcmath --with-gettext --with-mysql --with-pgsql > --with-ldap --with-config-file-path=/etc --enable-force-cgi-redirect > --enable-dio --enable-mime-magic --with-ncurses --enable-pcntl --with-pgsql > --enable-sockets For best results when recompling. Completely remove the old source directory then untar a fresh new copy. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Root nameservers are out of sync */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Table backup
Your not trying to run that from within MySQL are you? You do know that mysqldump is an entirely seperate command then the mysql console (where you would for instance type, USE DB; SELECT blah FROM table) right? On Mon, 2002-12-09 at 10:26, Shaun wrote: thanks for the reply, but that didn't help ERROR 1064: You have an error in your SQL syntax near 'mysqldump -h localhost -u xxx -p xxx backup.sql' at line 1 any ideas? "Adam Voigt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Take off the " > backup.sql" and see if you get any error's that might explain it. On Mon, 2002-12-09 at 10:07, Shaun wrote: Hi, I am trying to backup my database can someone please tell me why the following commande wont work? mysqldump -h localhost -u username -p databasename > backup.sql thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP] Creating a report in PHP
Hi Todd, > Is there a "report generator" that will give me the > flexibility to use fonts and fontfaces that works with > PHP and MySQL? I don't know of a PHP-based report generator (although a hunt round sourceforge might turn something up), but you can: 1. use PHP scripts to output your reports in HTML, with CSS for styling and layout 2. use a standalone reports package like Crystal Reports which will talk to MySQL directly 3. build an MS Access front-end to your MySQL tables and use its native reporting functions At $WORKPLACE we have a number of reports generated as HTML pages by PHP scripts - these are the ones that get run many times on a daily basis and always look the same - and Crystal installed on the managers' PCs for ad hoc reporting. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] save file from outside url
Ok. I stripped the needed code out of the image creation script and inserted it into my update script. It works great as long as I hard code in the filename of the file that is being saved to the server. When I pass the image creation function a variable for the filename it tells me "invalid filename", although I am echoing it out right before and it looks perfect. Any thoughts? Jason Wong wrote: > > On Sunday 08 December 2002 00:47, Jeremiah Breindel wrote: > > Thanks for responing Jason! > > > > There is other code in there for updating some database entries and > > producing a confirmation page, but I had them working perfectly before I > > added the image code below. Only when acessing the outside script and > > saving to file did it start doing the odd things. I didn't write the image > > creation script, only hard coded in some values for font and bg colors in > > it. I have attached that script at the bottom of this, away from > > everything else. Maybe a header problem from that script? Any idea what > > 427 is from? Thanks for all your help! > > > The $image_url is like this - "$rollover_image_url = > > "http://www.anysite.com//pngmake.php?msg="; . $rollover . > > "&rot=0&size=12&font=fonts/ARIAL.TTF"; > > Two things you need to do: > > 1) Plug the value of $rollover_image_url into a browser and satisfy yourself > that the resulting URL does indeed return a valid image, and hence said URL > is valid. > > 2) Plug in a known, static, valid URL (of an image -- actually it can be > anything it doesn't really matter) into your code below, and satisfy yourself > that the your code does work. > > > > > local file on my server using the code below: > > > > > > > > $fc = fopen($image_filename, "wb"); > > > > $file = fopen ($image_url, "rb"); > > > > > > > > if (!$file) { > > > > echo "Unable to open remote file.\n"; > > > > exit; > > > > }else{ > > > > while (!feof ($file)) { > > > >$line = fread ($file, 1028); > > > >fwrite($fc,$line); > > > > } > > > > } > > > > fclose($fc); > > > > fclose($file); > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Chicago law prohibits eating in a place that is on fire. > */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Creating a report in PHP
El lun, 09-12-2002 a las 16:39, Jon Haworth escribió: > Hi Todd, > > > Is there a "report generator" that will give me the > > flexibility to use fonts and fontfaces that works with > > PHP and MySQL? > > I don't know of a PHP-based report generator (although a hunt round > sourceforge might turn something up), but you can: After are long, long, long search on the inet, I came to the conclusion that there is no *decent* report generator for PHP. So I started to write my own. You can find it at: http://developer.berlios.de/projects/phpgrid/ I recommend you to use the CVS version, basically is a powerful grid to make easier the table management and after that, you can use the data dictionary generated (field names, calculated fields, etc) to generate a report both in HTML and PDF. It works for my and the company I work for, I don't know if it will fit your needs, feel free to contact with me for any question. Regards. -- XPde :: XP-like desktop environment (developed with Kylix ;-) http://www.xpde.com QaDRAM Studio :: RAD development for the Web http://studio.qadram.com signature.asc Description: This is a digitally signed message part
[PHP] Using odbc_pconnect function
Hi, Trying to use persistant connections to reduce general access times on my tables, I have the following problem. When creating my connection with: $connectionstring = odbc_pconnect("prov","username","pass"); I'm able to use it on the current page but how do I resuse the variable $connectionstring on other pages since I make calls like: $queryexe = odbc_do($connectionstring, $query); Hope this is not confusing. Also, can I make the persistant connection expire after there have been no calls to the DB for a certain time? Many Thanks, -Luc
Re: [PHP] Using odbc_pconnect function
I believe everything you have mentioned is automatic. You don't need to pass $connectionstring since PHP detects it's the same info and just sends you the same connection. Also, I believe PHP auto-closes after a certain amount of time (might be configurable, check the php.ini). On Mon, 2002-12-09 at 10:48, Luc Roettgers wrote: Hi, Trying to use persistant connections to reduce general access times on my tables, I have the following problem. When creating my connection with: $connectionstring = odbc_pconnect("prov","username","pass"); I'm able to use it on the current page but how do I resuse the variable $connectionstring on other pages since I make calls like: $queryexe = odbc_do($connectionstring, $query); Hope this is not confusing. Also, can I make the persistant connection expire after there have been no calls to the DB for a certain time? Many Thanks, -Luc -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] MySQL Table backup
Shaun wrote: ERROR 1064: You have an error in your SQL syntax near 'mysqldump -h localhost -u xxx -p xxx backup.sql' at line 1 It sounds like you are not running it from the command prompt but from within mysql. Unless the omission of the redirection sign ">" but not "backup.sql" was intentional, in which case you have too many parameters. Adam's reply implied removing both. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Table backup
Quote: It sounds like you are not running it from the command prompt but from within mysql. Reponse: I suspect as much. On Mon, 2002-12-09 at 11:15, Chris Hewitt wrote: Shaun wrote: >ERROR 1064: You have an error in your SQL syntax near 'mysqldump -h >localhost -u xxx -p xxx backup.sql' at line 1 > It sounds like you are not running it from the command prompt but from within mysql. Unless the omission of the redirection sign ">" but not "backup.sql" was intentional, in which case you have too many parameters. Adam's reply implied removing both. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] save file from outside url
On Monday 09 December 2002 23:44, Jeremiah Breindel wrote: > Ok. I stripped the needed code out of the image creation script and > inserted it into my update script. It works great as long as I hard > code in the filename of the file that is being saved to the server. > When I pass the image creation function a variable for the filename it > tells me "invalid filename", although I am echoing it out right before > and it looks perfect. Any thoughts? Could you show the (relevant) parts of your updated code? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Put your brain in gear before starting your mouth in motion. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] save file from outside url
image output code is close to the bottom *** $image_filename = "../images/tsroll_" . $id . ".png"; //dynamic file name $msg = $rollover; class textPNG { var $font = 'fonts/ARIAL.TTF'; //default font. put in full path. var $msg = "undefined"; // default text to display. var $size = 11; var $rot = 0; // rotation in degrees. var $pad = 0; // padding. var $transparent = 1; // transparency set to on. var $red = 0; // white text... var $grn = 0; var $blu = 0; var $bg_red = 255; // on black background. var $bg_grn = 255; var $bg_blu = 255; function draw() { $width = 499; $height = 14; $offset_x = 0; $offset_y = 0; $bounds = array(); $image = ""; //$this->msg = date ("h:i:s"); // determine font height. $bounds = ImageTTFBBox($this->size, $this->rot, $this->font, "W"); if ($this->rot < 0) { $font_height = abs($bounds[7]-$bounds[1]); } else if ($this->rot > 0) { $font_height = abs($bounds[1]-$bounds[7]); } else { $font_height = abs($bounds[7]-$bounds[1]); } // determine bounding box. $bounds = ImageTTFBBox($this->size, $this->rot, $this->font, $this->msg); if ($this->rot < 0) { //$width = abs($bounds[4]-$bounds[0]); //$height = abs($bounds[3]-$bounds[7]); $offset_y = $font_height; $offset_x = 0; } else if ($this->rot > 0) { //$width = abs($bounds[2]-$bounds[6]); //$height = abs($bounds[1]-$bounds[5]); $offset_y = abs($bounds[7]-$bounds[5])+$font_height; $offset_x = abs($bounds[0]-$bounds[6]); } else { //$width = abs($bounds[4]-$bounds[6]); //$height = abs($bounds[7]-$bounds[1]); $offset_y = $font_height;; $offset_x = 0; } $image = imagecreate($width+($this->pad*2)+1,$height+($this->pad*2)+1); $background = ImageColorAllocate($image, $this->bg_red, $this->bg_grn, $this->bg_blu); $foreground = ImageColorAllocate($image, $this->red, $this->grn, $this->blu); if ($this->transparent) ImageColorTransparent($image, $background); ImageInterlace($image, false); // render it. ImageTTFText($image, $this->size, $this->rot, $offset_x+$this->pad, $offset_y+$this->pad, $foreground, $this->font, $this->msg); // output PNG object. imagePNG($image, $image_filename); } } $text = new textPNG; // instantiate new textPNG class. if (isset($msg)) $text->msg = $msg; // text to display if (isset($font)) $text->font = $font; // font to use (include directory if needed). if (isset($size)) $text->size = $size; // size in points if (isset($rot)) $text->rot = $rot; // rotation if (isset($pad)) $text->pad = $pad; // padding in pixels around text. if (isset($tr)) $text->transparent = $tr; // transparency flag (boolean). if (isset($clr)) { // text colour $text->red = hexdec(substr($clr, 0, 2)); $text->grn = hexdec(substr($clr, 2, 2)); $text->blu = hexdec(substr($clr, 4, 2)); } if (isset($bg)) { // background colour $text->bg_red = hexdec(substr($bg, 0, 2)); $text->bg_grn = hexdec(substr($bg, 2, 2)); $text->bg_blu = hexdec(substr($bg, 4, 2)); } $text->draw(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Output page cut off after 7000 characters
At 16:04 09.12.2002, Tom Rogers wrote: Hi, Tuesday, December 10, 2002, 12:09:46 AM, you wrote: FW> No, it is not output from a DB, just a simple static text file with some FW> PHP functions in it, but even if I remove them, the error remains the same. FW> I have now upgraded to Apache 1.3.17 and php4.2.3 no change. FW> One idea which cam into my mind: might an error much later on in the page FW> generation interrupt the output? It takes a few seconds to after the page FW> starts to loud until the server closes the connection. FW> Regards FW> Fritz Does the apache error_log give any clues? Hi Tom, I had this checked out before, but I did only check the errorlog for this virtual host, there is an entry in the error log of the main server for each request to the page in question: [Mon Dec 9 17:27:05 2002] [notice] child pid 10998 exit signal Segmentation Fault (11) Well, it does not say much to me... Regards and Thanks for your help Fritz -- regards, Tom Ascom AG Ascom Informatik Fritz Wittwer Internet Services (SING) Belpstrasse 37, CH-3000 Bern 14 Phone: +41 31 999 4285 [EMAIL PROTECTED] _
Re: [PHP] Script not working from one computer
> Have you checked: > > Browser versions? (is the browser the same type/version as on the other > machines) > Is it a laptop? If so, are you using the internal keyboard with Numlock on? > Is the machine in question set-up on the network correctly, i.e. has it got > domain, gateway addresses etc setup - this would only affect it if the > Intranet server is set-up to only allow a certain range of IP addresses or > doamin/hostnames etc. Browser's are the same (128bit). It's not a laptop. The web page can pull up any other external web page correctly. What gets me is that the computer can pull up the log in page. It can pull up another, unprotected page from that web server. But, no matter who tries to log in from that machine, I get a bad username and password, even though they are right. It's like the browser is sending bad data to a script that works fine from every other computer. Anyone else have any other ideas? ---John Holmes... > -Original Message- > From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] > Sent: 05 December 2002 14:10 > To: php-general > Cc: heflinaw > Subject: [PHP] Script not working from one computer > > > I know, PHP is executed server side, so it shouldn't matter about the > computer, but... > > I've got a basic log in script that takes username and password and does the > typical SELECT to find a match. If it's good, it sets some session variables > and redirects to a main page, otherwise redirects back to the login page > with an error message. > > The script works from all computers but one. The login page will come up, > but no matter what, it says the username and password are bad. They are > correct though, caps lock isn't on, etc. I've cleared the cookies and cache > and it still does the same thing. > > The script is on an intranet. One computer that had this issue was fixed by > using https://computername.company.army.mil instead of just > https://computername. But for this computer, both addresses give the same > result. > > So, I'm sure it's not the PHP script, so I'm looking for ideas of what I > should check, settings wise, on the client computer? Any help is greatly > appreciated. > > ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Script not working from one computer
Does a print_r() of the superglobal arrays differ in any significant way when posting the username/password from the troublesome client when compared to the superglobals for a well behaved machine? -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: 09 December 2002 16:32 To: M.A.Bond; php-general Cc: heflinaw Subject: Re: [PHP] Script not working from one computer > Have you checked: > > Browser versions? (is the browser the same type/version as on the other > machines) > Is it a laptop? If so, are you using the internal keyboard with Numlock on? > Is the machine in question set-up on the network correctly, i.e. has it got > domain, gateway addresses etc setup - this would only affect it if the > Intranet server is set-up to only allow a certain range of IP addresses or > doamin/hostnames etc. Browser's are the same (128bit). It's not a laptop. The web page can pull up any other external web page correctly. What gets me is that the computer can pull up the log in page. It can pull up another, unprotected page from that web server. But, no matter who tries to log in from that machine, I get a bad username and password, even though they are right. It's like the browser is sending bad data to a script that works fine from every other computer. Anyone else have any other ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] # of lines in a file
Hey guys, I've been searching the manual for a way to grab the number of lines in a file and read a particular line from it, however I found no solution to my problem so I'm wondering if any of you out there could help me :-) - CS
RE: [PHP] PHP with JSP
> I hava to develop a solution that use PHP and JSP. But the system has to > use the same session. > > I´ve already installed the PHP integration with Java and it works. But I > can´t find the class to call a session? Well, your JSP script should receive the same cookie as your PHP script with the session ID. You can have it search the session.save_path and open up the file itself and create the session variables (plus implement your own method to "save" them again). Or save your data in a database that both PHP and JSP access in their own ways to get/save session variables. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] # of lines in a file
You could try... $file = ( "/path/file.ext" ); $lines = sizeof ( $file ); [EMAIL PROTECTED] wrote: Hey guys, I've been searching the manual for a way to grab the number of lines in a file and read a particular line from it, however I found no solution to my problem so I'm wondering if any of you out there could help me :-) - CS -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Find Next Integer
I have yet another math question. How could you find the next integer of a number specified? Then how could you tell it to go up or down depending on if the greater then or less tehn sign was chosen by the user? Thanks, Stephen Craton http://www.melchior.us "What is a dreamer that cannot persevere?" -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] # of lines in a file
$f = fopen("filename","r"); $data = "" fclose($f); $data = "" $lines = count($data); $certainline = $data[linenumberyouwant]; Replace filename in both places, and linenumberyouwant. On Mon, 2002-12-09 at 11:58, [EMAIL PROTECTED] wrote: Hey guys, I've been searching the manual for a way to grab the number of lines in a file and read a particular line from it, however I found no solution to my problem so I'm wondering if any of you out there could help me :-) - CS -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
RE: [PHP] # of lines in a file
> Hey guys, I've been searching the manual for a way to grab the number of > lines in a file and read a particular line from it, however I found no > solution to my problem so I'm wondering if any of you out there could help > me file() will read the file into an array, one line per element, so... $line_to_read = 55; $file_array = file('file.txt'); echo $file_array[$line_to_read]; Remember that arrays are zero based. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header gives different results with post
When I submit a post to the following page rather than a get the download screen in IE 5.5SP2 appears twice. Is there any way around this? I definitely need to use post since the length of the string being sent is fairly long. header("Content-type: application/octet-stream"); header('Content-Disposition: attachment;filename="results.csv"');// Try to name the output file header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: '.gmdate("D, d M Y H:i:s").' GMT'); // always modified header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); // HTTP/1.0 /*$nocache = 'Cache-Control: no-cache'; */ // HTTP/1.1 //header($nocache); header('Content-Transfer-Encoding: binary'); // Binary data echo "test"; ?> Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] # of lines in a file
Might not be the most secure way, but very fast... $lines = `cat file.txt | wc -l` That will give you the number of lines...but again not the best method... On Mon, 2002-12-09 at 09:58, [EMAIL PROTECTED] wrote: > Hey guys, I've been searching the manual for a way to grab the number of > lines in a file and read a particular line from it, however I found no > solution to my problem so I'm wondering if any of you out there could help me > :-) > > - CS -- Ray Hunter email: [EMAIL PROTECTED] www:http://venticon.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: save file from outside url
I figured it out! Variable scope problem! Thanks for all your help! "Jeremiah Breindel" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to save a dynamically generated image on an outside server to a > local file on my server using the code below: > > $fc = fopen($image_filename, "wb"); > $file = fopen ($image_url, "rb"); > > if (!$file) { > echo "Unable to open remote file.\n"; > exit; > }else{ > while (!feof ($file)) { >$line = fread ($file, 1028); >fwrite($fc,$line); > } > } > fclose($fc); > fclose($file); > > > $image_filename is a locally referred to file, such as "../images/file1.png" > and $image_url is an absolute address, such as > "http://www.whatever.com/imagecreate.php";. > > Instead of saving when I run the script through a browser, the image > displays within the browser, and the script creates a file containing only > "427" on the server. Any ideas why or what I can do to correct this? > > Jeremiah > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Not able to connect to FTP server
Have you tried passive mode? Vinod wrote: > Hi friends, > > I am having a DSL Internet connectivity in our office and my PC is > connected to Internet using a HTTP/FTP Proxy(192.168.0.10) and the > browser(Mozilla) in my PC is configured to connect to net through the > proxy > > When I tried to connect to our ftp site using the following script, I > have received the message that Unable to connect. But the same script > is working fine with a direct modem connection. > > The script is > > // connect to ftp server > > if(!($ftp=ftp_connect("ftp.dirw.net"))) > { > print("Unable to connect"); > exit; > } > > Please suggest me on how to connect to the ftp site using the proxy > server. > > Regards, > > Vinod.B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Not able to connect to FTP server
Umm, try this: $ftp = ftp_connect("ftp.direw.net") or die("Couldn't connect."); See if you get "Couldn't connect". I suspect it's cause your both checking the variable and setting it in the same clause. On Mon, 2002-12-09 at 12:34, bill wrote: Have you tried passive mode? Vinod wrote: > Hi friends, > > I am having a DSL Internet connectivity in our office and my PC is > connected to Internet using a HTTP/FTP Proxy(192.168.0.10) and the > browser(Mozilla) in my PC is configured to connect to net through the > proxy > > When I tried to connect to our ftp site using the following script, I > have received the message that Unable to connect. But the same script > is working fine with a direct modem connection. > > The script is > > // connect to ftp server > > if(!($ftp=ftp_connect("ftp.dirw.net"))) > { > print("Unable to connect"); > exit; > } > > Please suggest me on how to connect to the ftp site using the proxy > server. > > Regards, > > Vinod.B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re: [PHP] re-compiling php4
Hi Jason, Hi all, >> Even though I´d compiled and installed my source php4.3 sucessfull I will >> get the following compiling information by php.info: >For best results when recompling. Completely remove the old source directory >then untar a fresh new copy. Did it. Yes - working fine. This tip was of gold. Oliver Etzel .eu domains are coming soon www.t-host.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] re-compiling php4
Did it and was working fine . Thank u Jason - Original Message - From: Jason Wong To: [EMAIL PROTECTED] Sent: Monday, December 09, 2002 4:37 PM Subject: Re: [PHP] re-compiling php4 On Monday 09 December 2002 20:58, [EMAIL PROTECTED] wrote: > Hello List, > Even though I´d compiled and installed my source php4.3 sucessfull I will > get the following compiling information by php.info: > > Configure Command './configure' '--with-gd' '--with-zlib' > > and nothing else. > > Even though I´d compiled it with the following flags with removed > config.cache: > > ./configure --prefix=/usr/local/php_stable7 --enable-exif > --enable-track-vars --with-calendar=shared --enable-magic-quotes > --enable-trans-sid --enable-wddx --enable-ftp --enable-inline-optimization > --enable-memory-limit --with-gd=/usr/local/gd2 --with-zlib-dir=/usr > --enable-gd-native-tt --with-t1lib=/usr --with-jpeg-dir=/usr > --with-png-dir=/usr --with-ttf --with-freetype-dir=/usr --with-unixodbc > --with-tiff-dir=/usr --with-jpeg-dir=/usr --with-snmp --with-openssl > --enable-sysvshm --enable-bcmath --with-gettext --with-mysql --with-pgsql > --with-ldap --with-config-file-path=/etc --enable-force-cgi-redirect > --enable-dio --enable-mime-magic --with-ncurses --enable-pcntl --with-pgsql > --enable-sockets For best results when recompling. Completely remove the old source directory then untar a fresh new copy. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Root nameservers are out of sync */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to test php.info from command line
Hello All, >How to test php.info from command line: #echo "" | php to the standard output (screen) - or if you want to a file like this way: #echo "" | php > /tmp/test_php.txt Oliver Etzel .eu - domain are coming soon www.t-host.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.2.3, Apache 2.0.40, gettext(), and web don't work
PHP 4.2.3 compiled with gettext(), with Apache 2.0.40. A call to bindtexdomain() when viewed through the web generates PHP Fatal error: Call to undefined function: bindtextdomain() in ... When I run the same script from the command line, as in php -f index.php, it works fine. Any ideas? DUBRAVKO KAKARIGI, P.O. Box 1742, Tallahassee, Florida 32302 850-222-2211 (H&W) http://www.kakarigi.net/dubravko/ === seek, appreciate, and create beauty -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Output page cut off after 7000 characters
On Tuesday 10 December 2002 00:31, Fritz Wittwer wrote: > >FW> I have now upgraded to Apache 1.3.17 and php4.2.3 no change. Did you mean 1.3.27? 1.3.17 is pretty old. > >Does the apache error_log give any clues? > I had this checked out before, but I did only check the errorlog for this > virtual host, there is an entry in the error log of the main server for > each request to the page in question: > > > > [Mon Dec 9 17:27:05 2002] [notice] child pid 10998 exit signal > Segmentation Fault (11) > > > > Well, it does not say much to me... Well that's a pretty serious error. Basically, what it means is that httpd process that was running your script dieded (and under normal circumstances it shouldn't happen). If it's a repeatable bug then you should consider filing a bug report --> http://bugs.php.net. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Disclose classified information only when a NEED TO KNOW exists. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to test php.info from command line
On Tuesday 10 December 2002 02:39, [EMAIL PROTECTED] wrote: > Hello All, > > >How to test php.info from command line: > > #echo "" | php > > to the standard output (screen) - or if you want to a file like this way: > #echo "" | php > /tmp/test_php.txt > > Oliver Etzel > > .eu - domain are coming soon > www.t-host.com Or simply #php -i It would be nice if there was a text-only version without all the HTML gunge. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Happiness isn't something you experience; it's something you remember. -- Oscar Levant */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header gives different results with post
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Are you trying to attach an additional results.csv, or are you trying to name the output (ie "test")??? If you're trying to name the output, changing Content-Disposition: attachment;filename="results.csv" to Content-Disposition: inline;filename="results.csv" If that doesn't work, peruse RFC 2183. On Monday 09 December 2002 08:18 am, Ellen Cyran wrote: > When I submit a post to the following page rather than a get > the download screen in IE 5.5SP2 appears twice. Is there > any way around this? I definitely need to use post since the > length of the string being sent is fairly long. > > > header("Content-type: application/octet-stream"); > header('Content-Disposition: attachment;filename="results.csv"');// Try > to name the output file > header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past > header('Last-Modified: '.gmdate("D, d M Y H:i:s").' GMT'); // always > modified > header("Cache-Control: no-store, no-cache, must-revalidate"); // > HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); > header("Pragma: no-cache"); // HTTP/1.0 > /*$nocache = 'Cache-Control: no-cache'; */ // HTTP/1.1 > //header($nocache); > header('Content-Transfer-Encoding: binary'); // Binary data > > echo "test"; > > ?> > > Thanks. - -- Sell a man a fish, he eats for a day, teach a man how to fish, you ruin a wonderful business opportunity. - -Karl Marx -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE99O8A/rncFku1MdIRAo24AKCy/2Swq6lb6iIOQO96cZWl2lSdvwCdEOBZ ydQE/q/JZ9CIQNLRoSW3YOE= =ItM0 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP 4.2.3, Apache 2.0.40, gettext(), and web don't work
Are you *sure* your Apache module and commandline interpreter were both compiled with the same set of options? Does a phpinfo() call to the Apache module indicate that gettext is enabled there? --- Mark Roedel | "Blessed is he who has learned to laugh Systems Programmer| at himself, for he shall never cease LeTourneau University | to be entertained." Longview, Texas, USA | -- John Powell > -Original Message- > From: Dubravko Kakarigi [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 09, 2002 1:01 PM > To: [EMAIL PROTECTED] > Subject: [PHP] PHP 4.2.3, Apache 2.0.40, gettext(), and web don't work > > > PHP 4.2.3 compiled with gettext(), with Apache 2.0.40. > > A call to bindtextdomain() when viewed through the web generates > PHP Fatal error: Call to undefined function: bindtextdomain() in ... > > When I run the same script from the command line, as in php > -f index.php, it works fine. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic vs. Static
When you compile php for apache using the dynamic module example used in the documentation, do you not get an exacutable php to use from the command line? Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dynamic vs. Static
No. To get the binary executable, compile it without the apache switch. [EMAIL PROTECTED] wrote: When you compile php for apache using the dynamic module example used in the documentation, do you not get an exacutable php to use from the command line? Ed -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] writing to mysql using php
If there were no more replies... you can use it by means of BUCLES, isn't it? BR, Enrique -Mensaje original- De: Shams [mailto:[EMAIL PROTECTED]] Enviado el: Martes, 03 de Diciembre de 2002 04:32 a.m. Para: [EMAIL PROTECTED] Asunto: [PHP] writing to mysql using php Hi, I'm relatively new to PHP and mySQL. I currently have a simple table created within a MySQL database. And I have a php script that connects to the database, presents a form for the user to fill in, and then writes that record to the table. Instead... is it possible, to write to multiple records at once using a tabular view rather than one record at a time with a columnar view ? Many Thanks, Shams -- 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] a simple test script for testing gd
Hello list, Anybody here who knows a simple php-script for the puspose of testing gd-related tasks eg like dynamic construction of buttons??? Oliver Etzel
[PHP] Linux and Graphics
I am running PHP in a RedHat 7.3 environment and I notice that the graphic functions are not present. Since I am quite new to Linux, I would appreciate it if someone could explain to me what I need to do to have graphic functions. Many thanks. Todd --
Re: [PHP] Dynamic vs. Static
Can I do that using the same src I used to create the dynamic module and both would work hapilly together? Thanks, Ed On Mon, 9 Dec 2002, John Nichel wrote: > No. To get the binary executable, compile it without the apache switch. > > [EMAIL PROTECTED] wrote: > > When you compile php for apache using the dynamic module example used in > > the documentation, do you not get an exacutable php to use from the > > command line? > > > > Ed > > > > > > > > > -- > By-Tor.com > It's all about the Rush > http://www.by-tor.com > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookie handling, NS 4.x?
I am having a fairly confusing problem with setcookie() in NS 4.x. My script: nscookie.php: setcookie("NSUSERNAME", 'cday', time()+2592000, '/', ".mydomain.com"); Header("Location: nscookie2.php"); exit(); nscookie2.php: echo $_COOKIE[NSUSERNAME]; In IE (all versions I have tested), this works fine. In NS 7, this works fine. In NS 4.7 and 4.8 .. nothing is returned. No cookie is set in the cookies.txt file at all. Can anyone tell me why? I've been poking around the PHP manual pages but haven't come across anything let. Thanks, Chad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Find Next Integer
But the problem is, the user may type in a decimal.. I guess I could round then add or subtract.. Would that work too? - Original Message - From: "Andrew Brampton" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 1:14 PM Subject: Re: [PHP] Find Next Integer > if ($sign = ">") > $number++; > else > $number--; > > ??? > - Original Message - > From: "Stephen" <[EMAIL PROTECTED]> > To: "PHP List" <[EMAIL PROTECTED]> > Sent: Monday, December 09, 2002 5:05 PM > Subject: [PHP] Find Next Integer > > > > I have yet another math question. How could you find the next integer of a > > number specified? Then how could you tell it to go up or down depending on > > if the greater then or less tehn sign was chosen by the user? > > > > Thanks, > > Stephen Craton > > http://www.melchior.us > > > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us > > > > > > > -- -- > > > > > -- > > 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] external program execution error
Hi there, I am having problems with passthru, exec, etc. on Red Hat 8 (w/ PHP 4.2.3; Apache 1.3.27). When I use passthru / exec to execute "pwd" or "ls-al" I have no problems executing & viewing the output. However, when I try and execute a program using the command line e.g "./lee54 < GNOM_FILE_g4Dxx4.args" using passthru, the value "127" is returned. What is this? An error code of some sort? I'm 99.9% sure that the external program itself isn't returning this. All the files are chmodded to 777. I don't know if there are there any configuration directives that I need to set or something..? If anyone has any idea as to what the problem could be, I'd be glad to gear it! Cheers, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux and Graphics
What functions do you want to use? You can review the functions in the manual and it will tell you how to configure php with them... On Mon, 2002-12-09 at 13:31, Todd Cary wrote: > I am running PHP in a RedHat 7.3 environment and I notice that the > graphic functions are not present. Since I am quite new to Linux, I > would appreciate it if someone could explain to me what I need to do > to have graphic functions. > > Many thanks. > > Todd > -- > Ariste Software, Petaluma, CA 94952 -- Ray Hunter email: [EMAIL PROTECTED] www:http://venticon.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header gives different results with post
The actual code echoes a buffer of comma separated values. I just shorten it since it doesn't work for post even with these few headers and the word test echoed. At 11:28 AM 12/9/2002 -0800, Evan Nemerson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Are you trying to attach an additional results.csv, or are you trying to name the output (ie "test")??? If you're trying to name the output, changing Content-Disposition: attachment;filename="results.csv" to Content-Disposition: inline;filename="results.csv" If that doesn't work, peruse RFC 2183. On Monday 09 December 2002 08:18 am, Ellen Cyran wrote: > When I submit a post to the following page rather than a get > the download screen in IE 5.5SP2 appears twice. Is there > any way around this? I definitely need to use post since the > length of the string being sent is fairly long. > > > header("Content-type: application/octet-stream"); > header('Content-Disposition: attachment;filename="results.csv"');// Try > to name the output file > header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past > header('Last-Modified: '.gmdate("D, d M Y H:i:s").' GMT'); // always > modified > header("Cache-Control: no-store, no-cache, must-revalidate"); // > HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); > header("Pragma: no-cache"); // HTTP/1.0 > /*$nocache = 'Cache-Control: no-cache'; */ // HTTP/1.1 > //header($nocache); > header('Content-Transfer-Encoding: binary'); // Binary data > > echo "test"; > > ?> > > Thanks. - -- Sell a man a fish, he eats for a day, teach a man how to fish, you ruin a wonderful business opportunity. - -Karl Marx -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE99O8A/rncFku1MdIRAo24AKCy/2Swq6lb6iIOQO96cZWl2lSdvwCdEOBZ ydQE/q/JZ9CIQNLRoSW3YOE= =ItM0 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] a simple test script for testing gd
There are some test scripts in the tests directory of the src. However, i do not know if there are any script for the testing of gd functions... On Mon, 2002-12-09 at 13:12, [EMAIL PROTECTED] wrote: > Hello list, > > Anybody here who knows a simple php-script for the puspose of testing gd-related >tasks eg like > dynamic construction of buttons??? > > Oliver Etzel -- Ray Hunter email: [EMAIL PROTECTED] www:http://venticon.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Find Next Integer
Well that case then if ($sign = ">") ceil($number); else floor($number); Is that nearer to what you mean? Andrew - Original Message - From: "Stephen" <[EMAIL PROTECTED]> To: "Andrew Brampton" <[EMAIL PROTECTED]> Cc: "PHP List" <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 8:19 PM Subject: Re: [PHP] Find Next Integer > But the problem is, the user may type in a decimal.. I guess I could round > then add or subtract.. Would that work too? > > > - Original Message - > From: "Andrew Brampton" <[EMAIL PROTECTED]> > To: "Stephen" <[EMAIL PROTECTED]> > Sent: Monday, December 09, 2002 1:14 PM > Subject: Re: [PHP] Find Next Integer > > > > if ($sign = ">") > > $number++; > > else > > $number--; > > > > ??? > > - Original Message - > > From: "Stephen" <[EMAIL PROTECTED]> > > To: "PHP List" <[EMAIL PROTECTED]> > > Sent: Monday, December 09, 2002 5:05 PM > > Subject: [PHP] Find Next Integer > > > > > > > I have yet another math question. How could you find the next integer of > a > > > number specified? Then how could you tell it to go up or down depending > on > > > if the greater then or less tehn sign was chosen by the user? > > > > > > Thanks, > > > Stephen Craton > > > http://www.melchior.us > > > > > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us > > > > > > > > > > > > -- > -- > > > > > > > > > -- > > > 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] writing to mysql using php
Shams, Most database actions you want your user to do should be limited to them writing to one record and/or updating that one record. If instead you want to update information on several records, then you'd need a statement like: $table="your_table_name"; $query=mysql_query("update $table set column_name='what ever' where other_column_name='something else'"); Hope this helps, Hugh - Original Message - From: "Enrique Garcia Briones" <[EMAIL PROTECTED]> To: "Shams" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 12:10 PM Subject: RE: [PHP] writing to mysql using php > If there were no more replies... you can use it by means of BUCLES, isn't > it? > > BR, Enrique > > -Mensaje original- > De: Shams [mailto:[EMAIL PROTECTED]] > Enviado el: Martes, 03 de Diciembre de 2002 04:32 a.m. > Para: [EMAIL PROTECTED] > Asunto: [PHP] writing to mysql using php > > > Hi, > > I'm relatively new to PHP and mySQL. > > I currently have a simple table created within a MySQL database. And I have > a php script that connects to the database, presents a form for the user to > fill in, and then writes that record to the table. > > Instead... is it possible, to write to multiple records at once using a > tabular view rather than one record at a time with a columnar view ? > > Many Thanks, > > Shams > > > > -- > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Spaces
I have a article submission thing where the user types in whatever they want. I've already made it so that when the user pushes enter, it saves it as a for HTML but how would I do this for spaces also? I'm storing the contents in a MySQL database... Thanks,Stephen Cratonhttp://www.melchior.us "What is a dreamer that cannot persevere?" -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cookie handling, NS 4.x?
--- Chad Day <[EMAIL PROTECTED]> wrote: > I am having a fairly confusing problem with setcookie() > in NS 4.x. > > My script: > > nscookie.php: > > setcookie("NSUSERNAME", 'cday', time()+2592000, '/', > ".mydomain.com"); > Header("Location: nscookie2.php"); > exit(); > > nscookie2.php: > > echo $_COOKIE[NSUSERNAME]; > > In IE (all versions I have tested), this works fine. > > In NS 7, this works fine. > > In NS 4.7 and 4.8 .. nothing is returned. No cookie is > set in the > cookies.txt file at all. > > Can anyone tell me why? I believe this has something to do with the fact that the HTTP response status code is no longer a 200 when you send a Location header, as PHP will automatically change it to a 302 for you. Thus, in some browsers, the result is that the browser will submit a GET request for the URL identified in the Location header, but it will ignore the HTTP headers sent in the 302 response. To see if this is in fact the trouble with Netscape 4.x, try using a meta tag redirect instead. Even though the W3C dislikes this use of http-equiv, it is very consistently supported, and I know many Web sites that use it (SourceForge, for example). Good luck. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Spaces
replace more than 1 space in a row with a OR, when outputing their text place a tag around it Andrew - Original Message - From: Stephen To: PHP List Sent: Monday, December 09, 2002 9:25 PM Subject: [PHP] Spaces I have a article submission thing where the user types in whatever they want. I've already made it so that when the user pushes enter, it saves it as a for HTML but how would I do this for spaces also? I'm storing the contents in a MySQL database... Thanks, Stephen Craton http://www.melchior.us "What is a dreamer that cannot persevere?" -- http://www.melchior.us -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookie handling, NS 4.x?
I'm not sure how this would matter since the cookie is never set at all.. it's not an issue of it reading the cookie, as it can't read what is never set. I'll give it a shot when I get home though anyway. -Original Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 4:31 PM To: Chad Day; php general Subject: Re: [PHP] Cookie handling, NS 4.x? --- Chad Day <[EMAIL PROTECTED]> wrote: > I am having a fairly confusing problem with setcookie() > in NS 4.x. > > My script: > > nscookie.php: > > setcookie("NSUSERNAME", 'cday', time()+2592000, '/', > ".mydomain.com"); > Header("Location: nscookie2.php"); > exit(); > > nscookie2.php: > > echo $_COOKIE[NSUSERNAME]; > > In IE (all versions I have tested), this works fine. > > In NS 7, this works fine. > > In NS 4.7 and 4.8 .. nothing is returned. No cookie is > set in the > cookies.txt file at all. > > Can anyone tell me why? I believe this has something to do with the fact that the HTTP response status code is no longer a 200 when you send a Location header, as PHP will automatically change it to a 302 for you. Thus, in some browsers, the result is that the browser will submit a GET request for the URL identified in the Location header, but it will ignore the HTTP headers sent in the 302 response. To see if this is in fact the trouble with Netscape 4.x, try using a meta tag redirect instead. Even though the W3C dislikes this use of http-equiv, it is very consistently supported, and I know many Web sites that use it (SourceForge, for example). Good luck. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Find Next Integer
Ah, yes, thanks! - Original Message - From: "Andrew Brampton" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 4:08 PM Subject: Re: [PHP] Find Next Integer > Well that case then > if ($sign = ">") > ceil($number); > else > floor($number); > > Is that nearer to what you mean? > > Andrew > - Original Message - > From: "Stephen" <[EMAIL PROTECTED]> > To: "Andrew Brampton" <[EMAIL PROTECTED]> > Cc: "PHP List" <[EMAIL PROTECTED]> > Sent: Monday, December 09, 2002 8:19 PM > Subject: Re: [PHP] Find Next Integer > > > > But the problem is, the user may type in a decimal.. I guess I could round > > then add or subtract.. Would that work too? > > > > > > - Original Message - > > From: "Andrew Brampton" <[EMAIL PROTECTED]> > > To: "Stephen" <[EMAIL PROTECTED]> > > Sent: Monday, December 09, 2002 1:14 PM > > Subject: Re: [PHP] Find Next Integer > > > > > > > if ($sign = ">") > > > $number++; > > > else > > > $number--; > > > > > > ??? > > > - Original Message - > > > From: "Stephen" <[EMAIL PROTECTED]> > > > To: "PHP List" <[EMAIL PROTECTED]> > > > Sent: Monday, December 09, 2002 5:05 PM > > > Subject: [PHP] Find Next Integer > > > > > > > > > > I have yet another math question. How could you find the next integer > of > > a > > > > number specified? Then how could you tell it to go up or down > depending > > on > > > > if the greater then or less tehn sign was chosen by the user? > > > > > > > > Thanks, > > > > Stephen Craton > > > > http://www.melchior.us > > > > > > > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us > > > > > > > > > > > > > > > > > > -- > > -- > > > > > > > > > > > > > -- > > > > 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] Spaces
So would I just do this? $text = str_replace(" ", " ", $_POST['input']); - Original Message - From: "Andrew Brampton" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 4:30 PM Subject: Re: [PHP] Spaces replace more than 1 space in a row with a OR, when outputing their text place a tag around it Andrew - Original Message - From: Stephen To: PHP List Sent: Monday, December 09, 2002 9:25 PM Subject: [PHP] Spaces I have a article submission thing where the user types in whatever they want. I've already made it so that when the user pushes enter, it saves it as a for HTML but how would I do this for spaces also? I'm storing the contents in a MySQL database... Thanks, Stephen Craton http://www.melchior.us "What is a dreamer that cannot persevere?" -- http://www.melchior.us -- -- 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] Please help - uploading multiple files
Hi, I am very new to PHP, but it looks like it can do quite a bit. I am impressed by the number of array functions there are. I have a question. I am trying to create a php program that will allow for multiple file uploads. I already have the HTML working for enctype="multipart/form-data". I can upload 5 files at a time now. The problem is, I have to click "Browse" for each file. I want to be able to access the functionality to allow for Shift-Click series picker that everyone probably knows about. I need to be able to slurp in 514 files at a time into an array, then parse the array in a for loop. Are there any PHP functions that will do that? The way I understand it right now, HTML actually creates the browse button which allows me to grab the file with the tag. But that is only for 1 file. Anyway, if anyone could help me, I would appreciate it. If there is a HTML tag I don't know about that accomplishes the same, please let me know. Thank you, Mark Allred [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cookie handling, NS 4.x?
--- Chad Day <[EMAIL PROTECTED]> wrote: > I'm not sure how this would matter since the cookie is > never set at all.. it's not an issue of it reading the > cookie, as it can't read what is never set. I'll give > it a shot when I get home though anyway. Read my response again, and you'll see that what you are saying here does not conflict. The cookie is indeed not getting set, and that is likely because the browser does not take action on the Set-Cookie header when it is contained within a 302 response. If you use a meta redirect rather than a header("Location: ...") call, the response status will be 200 instead of 302, so the browser might accept the cookie. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please help - uploading multiple files
At 23:10 09.12.2002, Allred, Mark said: [snip] >The problem is, I have to click "Browse" for each file. > >I want to be able to access the functionality to allow for Shift-Click >series picker that everyone probably knows about. I need to be able to >slurp in 514 files at a time into an array, then parse the array in a for >loop. > >Are there any PHP functions that will do that? [snip] This has nothing to do with PHP - it's a client (browser) issue. AFAIK there's no tag defined in HTML, or XHTML, that would do what you need. -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Spaces
One more problem I could see is that if the user types in an odd number of spaces like 5 or 7. Wouldn't this replace string only replace spaces all the even spaces like 2, 4, 6, 8, and so on? - Original Message - From: "Andrew Brampton" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 5:36 PM Subject: Re: [PHP] Spaces > $text = str_replace(" ", " ", $_POST['input']); > > would be better, since each is a space > > $text = str_replace(" ", " ", $_POST['input']); > > might work also, but I'm unsure how browsers handle > . > > Andrew > > - Original Message - > From: "Stephen" <[EMAIL PROTECTED]> > To: "Andrew Brampton" <[EMAIL PROTECTED]> > Cc: "PHP List" <[EMAIL PROTECTED]> > Sent: Monday, December 09, 2002 10:01 PM > Subject: Re: [PHP] Spaces > > > > So would I just do this? > > > > $text = str_replace(" ", " ", $_POST['input']); > > > > > > - Original Message - > > From: "Andrew Brampton" <[EMAIL PROTECTED]> > > To: "Stephen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > Sent: Monday, December 09, 2002 4:30 PM > > Subject: Re: [PHP] Spaces > > > > > > replace more than 1 space in a row with a > > OR, when outputing their text place a tag around it > > > > Andrew > > - Original Message - > > From: Stephen > > To: PHP List > > Sent: Monday, December 09, 2002 9:25 PM > > Subject: [PHP] Spaces > > > > > > I have a article submission thing where the user types in whatever they > > want. I've already made it so that when the user pushes enter, it saves it > > as a for HTML but how would I do this for spaces also? I'm storing > the > > contents in a MySQL database... > > > > Thanks, > > Stephen Craton > > http://www.melchior.us > > > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us > > > > > > -- > -- > > -- > > > > > > -- > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fractions
I know for a fact that you're all going to think, "What the heck does he want fractions for!?" I have a reason...I just won't tell you. :-P My problem is this. I want to simplify a fraction to simplest form but if I divide, I'll get a decimal which I can't use. How could I put it in simplest form without displaying a decimal to the user and if one does come up, a mixed number? Thanks,Stephen Cratonhttp://www.melchior.us "What is a dreamer that cannot persevere?" -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] update query based on array
I am displaying a list of data (from an sql query) and some of the fields in that list are editable through a form. If the user chooses to edit one or more of the rows of data, they must click on a checkbox to add that row to an "update array". The problem is that when I read that array to pass to an UPDATE sql statement, it only passes the last entry of the array. Here's an example of the data being passed: 13 - 4 - UPDATE ranking SET category='Prep School', rank='30' WHERE pid=4 14 - 169 - UPDATE ranking SET category='Prep School', rank='30' WHERE pid=169 15 - 166 - UPDATE ranking SET category='Prep School', rank='30' WHERE pid=166 The above is created based on the following html code: //the last row So as you can see, its only reading the last row and assigning its values to the data above as well. Here's what I'm using for the sql query: while(list($key,$val)=each($rankid)) { $upd=mysql_query("UPDATE ranking SET category='$category', rank='$rank' WHERE pid=$val"); } If anyone has any suggestions for fixing this problem, please let me know :) THanks __ Jason Dulberg Extreme MTB http://extreme.nas.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fractions
Just like math...find the greatest common denominator of the numerator and denominator and then divide each (numerator and denominator) by that number... ie: numerator = 8 and denominator = 12 so we have 8/12 then greatest common denominator is 4... so 8/4 = 2 and 12/4 = 3 thus, 8/12 => 2/3 On Mon, 2002-12-09 at 15:55, Stephen wrote: > I know for a fact that you're all going to think, "What the heck does > he want fractions for!?" I have a reason...I just won't tell you. :-P > > My problem is this. I want to simplify a fraction to simplest form but > if I divide, I'll get a decimal which I can't use. How could I put it > in simplest form without displaying a decimal to the user and if one > does come up, a mixed number? > Thanks, > Stephen Craton > http://www.melchior.us > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us > > __ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Ray Hunter email: [EMAIL PROTECTED] www:http://venticon.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fractions
But how do you find it in PHP? - Original Message - From: "Ray Hunter" <[EMAIL PROTECTED]> To: "Stephen" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, December 09, 2002 6:12 PM Subject: Re: [PHP] Fractions > Just like math...find the greatest common denominator of the numerator > and denominator and then divide each (numerator and denominator) by that > number... > > ie: numerator = 8 and denominator = 12 > > so we have 8/12 > > then greatest common denominator is 4... > > so 8/4 = 2 and 12/4 = 3 > > thus, 8/12 => 2/3 > > > On Mon, 2002-12-09 at 15:55, Stephen wrote: > > I know for a fact that you're all going to think, "What the heck does > > he want fractions for!?" I have a reason...I just won't tell you. :-P > > > > My problem is this. I want to simplify a fraction to simplest form but > > if I divide, I'll get a decimal which I can't use. How could I put it > > in simplest form without displaying a decimal to the user and if one > > does come up, a mixed number? > > Thanks, > > Stephen Craton > > http://www.melchior.us > > > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us > > > > __ > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > -- > > Ray Hunter > email: [EMAIL PROTECTED] > www: http://venticon.com > > > -- > 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] update query based on array
not real sure of the setup of the form but if you have mutiple groups of items to be updated then you should make the rank an array -- rank[pid#] you should make all the items -- that are related part of the same group -- by using [] On Mon, 2002-12-09 at 15:06, Jason Dulberg wrote: > I am displaying a list of data (from an sql query) and some of the fields in > that list are editable through a form. If the user chooses to edit one or > more of the rows of data, they must click on a checkbox to add that row to > an "update array". The problem is that when I read that array to pass to an > UPDATE sql statement, it only passes the last entry of the array. > > Here's an example of the data being passed: > 13 - 4 - UPDATE ranking SET category='Prep School', rank='30' WHERE pid=4 > 14 - 169 - UPDATE ranking SET category='Prep School', rank='30' WHERE > pid=169 > 15 - 166 - UPDATE ranking SET category='Prep School', rank='30' WHERE > pid=166 > > The above is created based on the following html code: > //the last row > > > > > So as you can see, its only reading the last row and assigning its values to > the data above as well. > > Here's what I'm using for the sql query: > > while(list($key,$val)=each($rankid)) { >$upd=mysql_query("UPDATE ranking SET category='$category', rank='$rank' > WHERE pid=$val"); > } > > If anyone has any suggestions for fixing this problem, please let me know :) > THanks > > > __ > Jason Dulberg > Extreme MTB > http://extreme.nas.net -- Jimmy Brake <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Odd Strpos Behavior
I'm getting a really weird return from Strpos. What I'm doing is this, and anyone familiar with any of the table-runner programs for RPG's will know what I'm getting at here, I have a fields, like [adjective], [noun], etc., which I need to pull out and replace with values from included php files. Ok, so I have a string with those fields in it, and I have a loop that scans through the string for the first occurence of ]. On the first pass, strpos returns the first instance of where ] shows up in the string. Beautiful. I cut out the field, I create a filename, and it works just fine. However, on the second run through the loop, instead of returning where ] is in the string, it returns where ] is +1. Huh? It's throwing off my script. Obviously, I could compensate by keeping a counter, but really, I shouldn't have to. Anyone know why I'm getting this? Here's the code. I echoed the values so I could see what was going wrong. $a = "[adjective] [beginning]"; $e = strpos($a,"]"); while ($e) { echo "A: ".$a.""; echo "E: ".$e.""; $f = strpos($a, "["); echo "F: ".$f.""; $tmp = substr($a, 0, $f); $table=substr($a, $f+1, $e-1); echo "Table: ".$table.""; $a = substr($a, $e+1, strlen($a)); $dataFile = $table.".php"; $tmp .= $dataFile; $tmp .= $a; $a = $tmp; $e = strpos($a,"]"); } # echo $a; ?> This is running on Apache, php4.2.3 -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fractions
If there are none in the math functions then you need to create your own or do a search at google to see if anyone has created some functions like that... On Mon, 2002-12-09 at 16:20, Stephen wrote: > But how do you find it in PHP? > > > - Original Message - > From: "Ray Hunter" <[EMAIL PROTECTED]> > To: "Stephen" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, December 09, 2002 6:12 PM > Subject: Re: [PHP] Fractions > > > > Just like math...find the greatest common denominator of the numerator > > and denominator and then divide each (numerator and denominator) by that > > number... > > > > ie: numerator = 8 and denominator = 12 > > > > so we have 8/12 > > > > then greatest common denominator is 4... > > > > so 8/4 = 2 and 12/4 = 3 > > > > thus, 8/12 => 2/3 > > > > > > On Mon, 2002-12-09 at 15:55, Stephen wrote: > > > I know for a fact that you're all going to think, "What the heck does > > > he want fractions for!?" I have a reason...I just won't tell you. :-P > > > > > > My problem is this. I want to simplify a fraction to simplest form but > > > if I divide, I'll get a decimal which I can't use. How could I put it > > > in simplest form without displaying a decimal to the user and if one > > > does come up, a mixed number? > > > Thanks, > > > Stephen Craton > > > http://www.melchior.us > > > > > > "What is a dreamer that cannot persevere?" -- http://www.melchior.us > > > > > > __ > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > > > > Ray Hunter > > email: [EMAIL PROTECTED] > > www: http://venticon.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- Ray Hunter email: [EMAIL PROTECTED] www:http://venticon.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php