Re: [PHP] mixing HTML and PHP code
>http://www.binarycloud.com/code_standard.html >> http://marc.theaimsgroup.com/?l=php-pear&m=97603413001842&w=2 >> Best Practices: PHP Coding Style : >> http://phpbuilder.com/columns/tim20010101.php3 >> Smart Architectures in PHP : >> http://phpbuilder.com/columns/tim20001010.php3 These are all just opinions, none of these are official Php style guidelines, so there's no real reason to follow them. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] on style (was mixing PHP and HTML code)
>i do think that the code standard has some good elements to it, but >it goes >too far to specify a 4-space indent and to specify no spaces within >if >(condition) statements. I don't think it goes too far (I think it should be 3 spaces tho), but until the php guys publish some official style guidelines, I'll do it my own way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mixing HTML and PHP code
I think you missed something: tell me that's not easier on your eyes :) Another nice thing about doing it this way is you can work with a web designer who uses a visual tool like dreamweaver. On Fri, 12 Jan 2001 22:10:08 +0100, MR ([EMAIL PROTECTED]) wrote: >Alex Black ... >> >> >> is really not that much harder to write. >> >> html people can ignore it, php can find their code, and those that >>know both >> can reap the benefits. >> >> what about loops? > >You mean that this code > > >connect_to_database(); >parse_query(); >execute_query(); > >echo ""; > >while (fetch_row_from_query()) >{ >$output = data_from_fetched_row(); >$more_output = more_data_from_fetched_row(); > >echo " $output $more_output "; > >} >echo ""; >?> > > > >would be better if it were written this way? : > > >connect_to_database(); >parse_query(); >execute_query(); >?> > > > >$more_output = more_data_from_fetched_row();?> > > > > > > > > >I _personally_ prefer the upper implementation, as all my web >developing team (that is, only me :-) know both PHP and HTML and >don't >like the code to be *plagued* ofas in above >example. > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] gif vs png using gd
On Mon, 15 Jan 2001 19:52:29 GMT, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: >Hey folks, > >I've been experimenting with creating some graphics on the fly with >GD. So >far, so good. However, I've switched ISP's, and their gd doesn't >support >gifs. I've tried changing the header syntax header("content-Type: >image/gif") >to header("content-Type: image/png"); and the imagegif to imagepng, >and all I >get when I try to view the image is a broken quicktime icon. > >Is there some browser setting I need to change? > >Thanks in advance, What browser are you using? They started putting png in on ie4.0 and nn4.04 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Array...
On Mon, 15 Jan 2001 13:57:04 -0800 (PST), jeremy brand ([EMAIL PROTECTED]) wrote: >for ($i=100; $i>0; $i++) > print "\n"; > >But, I presume you would rather do this: >for ($i=100; $i>0; $i++) ^^^ should be $i-- > print "\n"; or how about: 0; $i--){?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] common.inc probs.
On Fri, 26 Jan 2001 13:37:42 -0500, Shane McBride ([EMAIL PROTECTED]) wrote: >I have a script that pulls in the following file via: require >'common.inc' > >The problem occurs when it hits the $UNIX_PATH variable. At least I >think that's where it creates a problem. If I comment it out it >works fine, but I of course need that variable. > >First of all I created a script that creates this file and I don't >understand why it doubled the backslashes in the $UNIX_PATH >variable. Secondly, why it is crapping out on the double >backslashes? I thought PHP would use the first one as an escape >character. > >As a side note: I know the example shown here shows a windows path >for the unix path variable, I'm trying to port this over to >winders.. :-0 > >$DB_SERVER="localhost"; >$DB_LOGIN="shane"; >$DB_PASSWORD="whatever"; >$DB_NAME="test"; >$HTTP_HOST="localhost"; >$AUTH_USER="admin"; >$AUTH_PASS="installme"; >$CO_NAME="RDI Technologies"; >$EMAIL="[EMAIL PROTECTED]"; >$UNIX_PATH="d:\\sites\\mercpow\\mp\images\"; it's obvious if you look at it, you want: $UNIX_PATH="d:\\sites\\mercpow\\mp\\images\\"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] date format for MySQL
On Wed, 21 Feb 2001 11:36:02 -0800, Jerry Lake ([EMAIL PROTECTED]) wrote: >I have a field in my MySQL DB that is "DATE" > >on the form that populates this field, various >people will by typing in dates in various formats > >how to I convert say 2/21/01 or 02-21-2001 etc... >to 2001-02-21(MySQL Format) probably the safest thing is instead of giving them a text field, give them 3 drop downs for day month and year. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] a good hosting experience
The last time I used these guys I didn't like them because the software they were running was way out of date. I can deal with an old version of php, but mysql needs to be current because there's too many things that old versions can't do. Right now I'm looking for a cheap virtual host that runs mysql 3.23.30 or higher, does anybody know one? thanks, - Mark On Wed, 21 Feb 2001 09:35:22 -0800, Julie Meloni ([EMAIL PROTECTED]) wrote: >As a follow-up to the "Terrible Hosting Experience" posts, here's a >"Good Hosting Experience" post. > >I completely and unabashedly recommend Hurricane Electric >(www.he.net), >for virtual or dedicated hosting. AND...they're not paying me a >thing to >say that. :) > >They have virtual host packages starting at ten bucks. >thickbook.com >runs on a thirty bucks a month virtual hosting package, and it's >just >fine (as far as I can tell). PHP 4, MySQL at all levels of pricing, >and >you can control local PHP values with .htaccess, just fine. > >I also have a 1U dedicated server there for $200/mo >(www.mytrainingcamp.com) and am ecstatic about it. > >So, go Hurricane! > >- Julie > >++ >| Julie Meloni ([EMAIL PROTECTED]) | >|| >| "PHP Essentials" and "PHP Fast & Easy" | >| http://www.thickbook.com | >++ > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] a good hosting experience
On Wed, 21 Feb 2001 14:55:25 -0800, ..s.c.o.t.t.. ([EMAIL PROTECTED]) wrote: >liquidweb.com has some nice looking deals. > >last time i checked, they supported >MySQL/PHP/Perl/lots of other stuff well, most hosts do, but not many are using 3.23.30 or higher. I'm looking for a host that somebody knows for sure is running a current version of mysql. thanks, - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL execution order?
On Thu, 22 Feb 2001 17:41:43 -0500, ..s.c.o.t.t.. [gts] ([EMAIL PROTECTED]) wrote: >mysql executes the queries in the order it recieves >them, (so if your program's logic executes a select >before an update, you'll never see results from the >update in your select... at least not normally :) well, except for insert delayed and update low_priority this might be true, but there's exceptions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] isset()
On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger ([EMAIL PROTECTED]) wrote: >On Saturday 24 February 2001 17:18, PHPBeginner.com wrote: >> in my preceding email I've written: >> >> if($var!='') >> >> will fix your all your worries without an intervention of a strings >> function. > >Except that it will throw a warning in PHP4 if $var is not set. >=> isset () should be used. man, this is like the thread that will not die. isset() will return true for an empty string, which is not what he wants. the right thing to do is use if((isset($var))&&($var!="")) the isset on the left gets evaluated first so a warning is never thrown. to be even safer, you can go: if((isset($var))&&(trim($var)!="")) you do not want to use strlen() for the following reasons: 1) makes code unreadable -> very sloppy 2) overhead 3) it will give a warning when $var is not set (error_reporting 15 only). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Lets nock off any numbers at the begging of a string...
On Mon, 26 Feb 2001 11:57:04 -0800, Brandon Orther ([EMAIL PROTECTED]) wrote: >Hello, > >Is there a way to remove the first numbers of a string? Here is an >example: > >$string1 = "12 this is number twelve"; >when done: " this is number twelve"; > >$sting1 = "123 this is number one twenty three" >when done: " this is number one twenty three"; $string1=ereg_replace("^[0-9]+","",$string1); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mySQL table joins are slow, need rebuild?
On Tue, 27 Feb 2001 15:04:09 -0800, Joe Stump ([EMAIL PROTECTED]) wrote: >You need to remember a few things when it comes to joins: > >the joined fields must be the EXACT same definition > - example: a join on id int(9) and id int(3) will NOT be optimized > - more: a join on id char(9) and id int(9) is REALLY NOT optimized >:O) true, but even more important than this is to make sure there's an index on both fields. without that it will crawl. also if the 'order by' is causing problems you might want to up the tmp_table_size in my.cnf, and very important is to not let the partition that tmp is on get too full. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Need an array parser(CONT)
On Wed, 28 Feb 2001 12:33:55 -0800, Dallas K. ([EMAIL PROTECTED]) wrote: >I am looking for somthing that will parse a multidimentional array >of any >size, and return a key / value listing for debugging > >Example: > >if I have an array such as... > >$arr[name] = dallas >$arr[address][city] = austin >$arr[address][state] = Texas >$arr[somthing][somthing_else][blah1]= some_value1 >$arr[somthing][somthing_else][blah2]= some_value2 >$arr[somthing][somthing_else][blah3]= some_value3 > >I would want the result to be displaied as: > >ARR >name --- dallas >address --- city --- austin >address --- state --- Texas >somthing --- somthing_else --- blah1 --- some_value1 >somthing --- somthing_else --- blah1 --- some_value1 will come pretty close to what you want -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Developer certifications
On Wed, 28 Feb 2001 20:54:07 +0200 (EET), Dragos Roua ([EMAIL PROTECTED]) wrote: >Hello, > >If you'll take a look at Brainbench.com you'll see a PHP4 cert exam >there. As >brainbench plan to become a paid service, their certifications may >start worth >something sometime. The brainbench exam is terrible. It's heavy on knowing the details of mssql functions and oci functions, and no points are given for speed. It's like an open book test so anybody can spend all day looking up the right answer, fill it out, and get a perfect score. If you just want to get the thing over with you can be honest and dump all the answers you don't know. Anyway, I think that as a benchmark it's garbage. A good test should stay away from most modules, and also include speed as a factor. Also It's way too easy to cheat on a test like this, so I don't think they should be taken too seriously no matter what. I can see requiring a person to pass a test like this before they get a job interview, but a company using the scores as a basis for hiring someone would be silly. >My 2 cents anyway... > >> Does anyone know of a company which is offering or planning to >>offer PHP >> developer certifications? Arguments against certification programs >>aside[1], >> there are a lot of companies which prefer certified developers, >>even to the >> point of assuming a project done in ASP will be better than the >>same thing >done >> in PHP simply because the ASP developers are Microsoft certified. >> >> While this seems like an interesting sideline for a company like >>Zend, I'm >also >> somewhat curious about whether an "Open Source" test could be >>developed. It'd >> certainly have to be quite different from normal tests and that >>move away from >> easily memorized answers would probably be a very good thing. >> >> [1] We've all heard them before. I'm personally in favor only of >certifications >> like certain devilishly hard Cisco exams which measure more than >> multiple-choice memory. >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] >> > > >-- >Dragos Roua >Mirabilis Media, >http://www.portal.ro http://www.net-info.ro >http://www.analyser.ro http://www.adserver.ro >http://www.culinar.ro http://www.cartipostale.ro > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Developer certifications
On Wed, 28 Feb 2001 15:16:41 -0600, kmurrah ([EMAIL PROTECTED]) wrote: >actually, it IS a timed test, so you cannot simply "spend all day >looking up >the right answer." Heh, maybe not all day, but I took it twice to see if speed was getting counted in the score. The first time I sped thru it, and the second time I let sit there for what seemed like enough time to consult the manual or a book for each question and probably even write a sample program to check the output (whatever it would take to double check that I had the right answer). It scored me the same both times, and for this reason I decided that it was not a very good system. Besides, at this point somebody's probably posted the answers on the internet somewhere, making this thing completely useless. >BTW, if you do want to take the test, today is the last day that the >exam is >offered for free ... tomorrow they start charging $20 or so for each >exam > > >-----Original Message- >From: Mark Maggelet [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, February 28, 2001 2:14 PM >To: [EMAIL PROTECTED]; [EMAIL PROTECTED] >Cc: [EMAIL PROTECTED] >Subject: Re: [PHP] Developer certifications > > >On Wed, 28 Feb 2001 20:54:07 +0200 (EET), Dragos Roua >([EMAIL PROTECTED]) wrote: >>Hello, >> >>If you'll take a look at Brainbench.com you'll see a PHP4 cert exam >>there. As >>brainbench plan to become a paid service, their certifications may >>start worth >>something sometime. > >The brainbench exam is terrible. It's heavy on knowing the details of >mssql functions and oci functions, and no points are given for speed. >It's like an open book test so anybody can spend all day looking up >the right answer, fill it out, and get a perfect score. If you just >want to get the thing over with you can be honest and dump all the >answers you don't know. > >Anyway, I think that as a benchmark it's garbage. A good test should >stay away from most modules, and also include speed as a factor. Also >It's way too easy to cheat on a test like this, so I don't think they >should be taken too seriously no matter what. > >I can see requiring a person to pass a test like this before they get >a job interview, but a company using the scores as a basis for hiring >someone would be silly. > >>My 2 cents anyway... >> >>> Does anyone know of a company which is offering or planning to >>>offer PHP >>> developer certifications? Arguments against certification programs >>>aside[1], >>> there are a lot of companies which prefer certified developers, >>>even to the >>> point of assuming a project done in ASP will be better than the >>>same thing >>done >>> in PHP simply because the ASP developers are Microsoft certified. >>> >>> While this seems like an interesting sideline for a company like >>>Zend, I'm >>also >>> somewhat curious about whether an "Open Source" test could be >>>developed. It'd >>> certainly have to be quite different from normal tests and that >>>move away from >>> easily memorized answers would probably be a very good thing. >>> >>> [1] We've all heard them before. I'm personally in favor only of >>certifications >>> like certain devilishly hard Cisco exams which measure more than >>> multiple-choice memory. >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> To contact the list administrators, e-mail: php-list- >>>[EMAIL PROTECTED] >>> >> >> >>-- >>Dragos Roua >>Mirabilis Media, >>http://www.portal.ro http://www.net-info.ro >>http://www.analyser.ro http://www.adserver.ro >>http://www.culinar.ro http://www.cartipostale.ro >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >>To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: server side cookies
On Fri, 02 Mar 2001 13:49:17 -0600, Michael David ([EMAIL PROTECTED]) wrote: >Jeff: > >You're talking about sessions, for the most part. I might be wrong but I think he's talking about setcookie(), for which the docs are here: http://www.php.net/manual/en/function.setcookie.php meaning that the server sends the cookie info in a header, there's another way to do it with javascript where the client code sets the cookie. Anyway, one of these posts should cover what he wants :) >Sessions are nice, as you can efficiently handle things like arrays >with >10,000 items of 200 bytes each without doing something extremely >stupid like >sending the user The Cookie From Hell (assuming a 2M cookie is even >legal - >I forget if there is any limit or not). Something like that is >great when >you're paging through results. > >Hope this has helped. > >From: Jeff <[EMAIL PROTECTED]> >Date: Fri, 02 Mar 2001 10:58:05 -0500 >To: [EMAIL PROTECTED] >Subject: server side cookies > >Does anyone know how to set server side cookies in php? Or can you >point me to a link on how to do this. >Please note that I am not asking how to set client side cookies. > >Thanks, > >Jeff > > >--- >Michael David >The Miller Group >Web-based software for Schools >http://www.miller-group.net > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] oohform validation help
On Fri, 9 Mar 2001 09:12:46 -0600, Chris Lee ([EMAIL PROTECTED]) wrote: >using client side form verification is a bad idea anyhow, just write >a simple php verify. Imagine waiting 10 minutes for a 5 MB file to upload on a form just to get an error message that says 'please go back and fill out your zip code', suddenly client side validation doesn't seem like such a bad idea :) > > if (isset($HTTP_POST_VARS['done'])) > { > $people_name = @$HTTP_POST_VARS['people_name']; > > if ( !$HTTP_POST_VARS['people_name'] ) > $form_error[] = "Name must be set"; > } > > if(isset($form_error)) > { > echo " > > "; > foreach ($form_error as $pos => $val) > echo " > $val > "; > echo " > > "; > } > > echo " > > > > > > > "; > >?> > >simple stuff, server side is fool proof, client side is foolable. > > >-- > > Chris Lee > Mediawaveonline.com > > ph. 250.377.1095 > ph. 250.376.2690 > fx. 250.554.1120 > > [EMAIL PROTECTED] > >""Christopher Cheng"" <[EMAIL PROTECTED]> wrote in >message 989jvm$9r0$[EMAIL PROTECTED]">news:989jvm$9r0$[EMAIL PROTECTED]... >What should I put in for the parameter jvs_name of the oohform- >>start? Is >that a name of another javascript file? Where can I get a sample >script? > >I would like to make sure the clients put in something in the >textbox. > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] payment
On Mon, 12 Mar 2001 17:04:13 -0500, Russ Cobbe ([EMAIL PROTECTED]) wrote: >If you are worried about your payment processor going down (which to >me would be a very serious concern) you might want to look at >www.opayc.com which is a standardized way to talk to about 30 or so >payment processors. what makes you think that this company is less likely to go under than a company like cybercash? this isn't a flame, I'm looking for info. thanks, - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] payment
On Mon, 12 Mar 2001 17:34:14 -0500, Russ Cobbe ([EMAIL PROTECTED]) wrote: >> On Mon, 12 Mar 2001 17:04:13 -0500, Russ Cobbe ([EMAIL PROTECTED]) >> wrote: >> >If you are worried about your payment processor going down (which >>to >> >me would be a very serious concern) you might want to look at >> >www.opayc.com which is a standardized way to talk to about 30 or >>so >> >payment processors. >> >> what makes you think that this company is less likely to go under >> than a company like cybercash? this isn't a flame, I'm looking for >> info. > >It isn't a payment processor it is an API to payment processors such >as CyberCash, Authorize.Net, Signio/Verisign, iBILL etc... >Basically >you make an SQL call to a driver instead of a database and that >makes >the call out to the payment processor. The eliminates the >complexity >in dealing with the payment processors. Sometimes the integration >with them is easy and sometimes it is a royal pain. This makes the >integration the same for all of them so you simply switch drivers to >switch payment processors. You could build a failover system so if >the one you mainly use goes down for some reason you could build in >logic to switch to another one quite easily. hmm, yes but you're still relying on them for the driver updates, I'm sure all the payment processors change their system every once in a while. The failover system sounds like a good idea if you don't mind signing on with 2 payment processors, but otherwise it seems like all you're doing is adding an extra layer where things can go wrong. I'm leaning towards verisign/payflow pro. has anyone had trouble with these guys? thanks - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] adding to functionality of mysql_fetch_field
On Wed, 14 Mar 2001 12:12:22 -0800, Dennis Gearon ([EMAIL PROTECTED]) wrote: >I'd like to see mysql_fetch_field() return as the last value in the >object, the allowable values for an enum field as an array. Could I >get >a cc as well as a listserver group answer from the PHP guys as to >whether they think this is a good idea? > >Is there any other EASY way to get that information about a field? > >It would make making inputs a lot easier and more tied to >the >database without thinking by the programmer, and would track design >changes to the database. you can do something like this: $result=mysql_query("describe $table"); while($row=mysql_fetch_array($result)){ if($row["Field"]==$fieldname){ $enum=$row["Type"]; break; } } $enum will look something like: "enum('Yes','No')" then you parse out $enum to get the values. put it in a function called get_enum_values($table,$fieldname) and youre all set. maybe there's an easier way but I don't know of it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Good Free PHP Editor?
editplus can do this. On Wed, 14 Mar 2001 13:49:04 -0900 (AKST), chris ([EMAIL PROTECTED]) wrote: >Do any of these editors support server mappings allowing one to >auomatically preview files through a server? I find this invaluable >in >HomeSite (which is also VERY stable for me using Win2K) and I think >HTMLKit does it too-- but do anyof the leaner text editors? > >By server mappings I mean that I can map >d:\inetpub\wwwroot\ >to >http://127.0.0.1/ > >so that when I hit the preview in browser button it automatically >pulls >the poages up through the server. A small thing, but I need it SO >often... > >c > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] 3 situations - PHP Power or... servlet(JSP) power ?
On Thu, 15 Mar 2001 19:59:50 +0200, Marian Vasile ([EMAIL PROTECTED]) wrote: >I have 3 situations and I need an answer about what is faster... > >1. A PHP script that it's executed 10 times in a second, and have to >update >a a MySQL table. >1. A PERL script that it's executed 10 times in a second, and have >to update >a a MySQL table. >1. An servlet(JSP) script that it's executed 10 times in a second, >and have >to update a MySQL table. it depends on many things, but in general I'd say the first two are about the same and the third is about 3-4 times slower. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] 3 situations - PHP Power or... servlet(JSP) power ?
On Thu, 15 Mar 2001 21:36:52 +0200, Marian Vasile ([EMAIL PROTECTED]) wrote: >I don't think that JSP is slower than PHP... really... >In fact I think JSP is a lot more faster just because JSP is >compiled than >executed... So is php. Java has some strengths, but speed is definitely not one of them. >Marian Vasile >IT Manager >Schnecker van Wyk & Pearson >www.investments.ro > >-Original Message- >From: Mark Maggelet [mailto:[EMAIL PROTECTED]] >Sent: Thursday, March 15, 2001 9:11 PM >To: [EMAIL PROTECTED]; [EMAIL PROTECTED] >Subject: Re: [PHP] 3 situations - PHP Power or... servlet(JSP) power >? > > >On Thu, 15 Mar 2001 19:59:50 +0200, Marian Vasile >([EMAIL PROTECTED]) wrote: >>I have 3 situations and I need an answer about what is faster... >> >>1. A PHP script that it's executed 10 times in a second, and have to >>update >>a a MySQL table. >>1. A PERL script that it's executed 10 times in a second, and have >>to update >>a a MySQL table. >>1. An servlet(JSP) script that it's executed 10 times in a second, >>and have >>to update a MySQL table. > >it depends on many things, but in general I'd say the first two are >about the same and the third is about 3-4 times slower. > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Reminders
Hi, I'm working on something like this too. I was hoping to be able to put something like this into an icapd server because my app might have been able to use mcal. It was too much effort though, so I'm looking at doing it with cron. Let me know if you find a more creative way of doing it. - Mark On Thu, 15 Mar 2001 15:33:50 -0500 (EST), Dale Frohman ([EMAIL PROTECTED]) wrote: >I have a web interface that will submit entries into a mysql db. >These >entries are things to do at certain times, an organizer. Is there a >way >for php to intelligently keep track of time and when the certain >time of >the event hits, to trigger an event - such as an email. Any help >will be >appreciated. > >Thanks > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] dynamically change a variable name
On Sun, 18 Mar 2001 20:36:15 -0500, Gary ([EMAIL PROTECTED]) wrote: >Is there a way to dynamically change a variable name? For example: >I want to change the variable name $DWG to >$DWG1 >$DWG2 >$DWG3 >with a for loop. Is there a way to do this? you could try: for($i=1;$i<=3;$i++){ ${"DWG".$i}=$DWG; } or it might make more sense to use an array. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] files with html extension
for php4: AddType application/x-httpd-php .html for php3: AddType application/x-httpd-php3 .html On Tue, 20 Mar 2001 10:12:56 -0800, Rick VanNorman ([EMAIL PROTECTED]) wrote: >On 3/20/2001 at 12:29 PM Jack Dempsey wrote: > >>You can tell apache to have the php interpreter parse files with an >>html >>extension, thereby letting you use the tags in html >>files...whether >>this >>is a good solution or not is another question.that would mean >>that each >>file would get parsedwhy are you trying to do this? >> > >To be able to include php code in otherwise full html files; >most especially to allow me to do it without having to change >the name of every file and fix every href in the entire site. > >So, exactly how do I tell apache to do this? > >Thanks, >Rick >1 > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] banner exchange, how to?
On Tue, 20 Mar 2001 21:27:14 -0800, Ed Lazor ([EMAIL PROTECTED]) wrote: >Hi =) > >I'd like to setup a banner exchange with some friends. Some of them >don't >have PHP access, so I'm trying to come up with something that will >work for >everyone. I checked one site that's running a banner exchange and >saw them >using a cgi script like this: > >http://www.site.com/exchange.cgi?ad=NonSSI&page=XX"> this script logs the clickthrough and redirects to the page using header("Location: $url") >http://www.site.com/exchange.cgi?id=siteB&page=XX"> this script logs the impression and redirects (or passes thru) to the banner it's really not very hard you can do the whole thing in about 20 lines of code. > > >Looking at that, it suggests the cgi script is some how sending >image data >to be used for displaying the banner ad. Then, on top of that, it's >some >how routing the visitor to the correct location when they click on >the >ad. I don't see how they are doing it and figured I'd ask here to >see if >anyone has any ideas. > >If you're not sure of how they did it, any ideas on how to >accomplish what >I'm after? > >I came across another site that had the following code and some how >they >have it working as well. It would be cool to figure out how they >did it. > >http://www.lemnet.com/banners/show/?user=qatlantis" >HEIGHT="77" WIDTH="470" SCROLLING="no" MARGINHEIGHT="0" >MARGINWIDTH="0" >FRAMEBORDER="0"> >http://www.lemnet.com/banners/show/?user=qatlantis" >HEIGHT="77" WIDTH="470"> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Blur some text please
check the projects page on php.net for an extension called php_imlib. On Tue, 17 Apr 2001 01:28:02 +0200, Richard ([EMAIL PROTECTED]) wrote: >Nah... It's up to the browser. 8-bit text cannot be given any >effects using >PHP. > >- Richard > >"Brandon Orther" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> Hello, >> >> Does anyone know of an image library that plugs right into php >>that has a >> blur function so I can create a drop shadow effect for text? >> >> Thanks >> Brandon >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] >> > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Job in Whistler, BC
On Mon, 16 Apr 2001 20:00:27 -0700, Dddogbruce \(@home.com\) ([EMAIL PROTECTED]) wrote: >Whistler's cool! Yeah, and a php job at a ski resort?! Hmm, that's way too good to be true. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] baffled :<:
On Tue, 17 Apr 2001 15:59:37 +1000, Peter Houchin ([EMAIL PROTECTED]) wrote: >can any one see a problem with this loop? > > $db = include"connect.inc"; >$foo = "SELECT * FROM 6pci WHERE card='$card' ORDER BY card"; > > $result = mysql_query($foo,$db); > > >while ( ($myrow = mysql_fetch_array($result) ) ) { > >$id = $myrow["id"]; >$card = $myrow["card"]; >$serial = $myrow["serial"]; >$avail = $myrow["avail"]; >$pn = $myrow["pn"]; >$cat = $myrow["cat"]; >$box = $myrow["box"]; >$quote = $myrow["quote"]; >} >?> > >if i call say just $card it only displays the one record (the last >one) if you call it after the loop you mean? thats what i would expect to be there. >the minute i try to call $myrow["card"]; i get nothing at >all... any idea's? outside the loop again? well if the last call to mysql_fetch_array() returns false, then that sounds right too. you probably mean to do something inside the loop. here's another tip, use extract: while ( ($myrow = mysql_fetch_array($result) ) ) { extract($myrow); echo $card."\n"; } >I have script identical to this that works perfectly .. only >difference is this one has different names for the values > >Peter Houchin >[EMAIL PROTECTED] >= > _ __ /\ >/_/_/_\/ |_/ \ > /_/_/___ __ __ __ / \ > \_/_/_\ /_/ /_/ /_/ /_/ \ _ / > ___\_\_\/ /_/_/_/ /_//\/_/\_/ \/\_/ > \_//_/_/ /_/_/_/ /_/ \/_/v > >/_/_/_/_/ /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ > /_/_ _/_/ __ __ __ /_/ __ __ > /_/_/_/_/ /_/_/_/ /_/ /_/ /_/ /_/\_\/_//_/_/_/ > /_/ \_\ /_/ _/ /_//\/_/ /_/ /_/__\_\ /_/___ _\_\_\ >/_/\_\/_/_/_/ /_/ \/_/ /_/ /_/\_\/_/_/_//_/_/_/ >= >Telephone : (03) 9329 1455 Facsimile : (03) 9329 6755 >* We rent the dot in .COM! ** > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Finding Duplicate Numbers?
On Tue, 17 Apr 2001 11:30:07 -0700, Colin Putney ([EMAIL PROTECTED]) wrote: >On Tuesday, April 17, 2001, at 11:00 AM, Devin Atencio wrote: > >> I have a SQL Table that has over 1,000 records and I was wanting >> to write a script that would find duplicate phone numbers and >> then list the duplicate phone numbers. I have been trying to >> think on how to do this but I can't think of a way. Can someone >> please help me on some code I could write to do this? > >I think you want something like this (MySQL syntax, YMMV): > >SELECT phone_number, count(*) AS instances >FROM my_table >GROUP by phone_number >HAVING instances >= 2 >ORDER BY instances DESC > > >This give you a list of all duplicated phone numbers, the number of >times they appear in the table, and sorts them with the most- >duplicated >numbers first. > >To list them, you just need to loop through the result set echoing >the >phone number. That works for mysql. He probably just wants to kill the duplicates, so there's an easier way: add a unique index to the phone_number field. alter ignore table $table add unique (phone_number); - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Dynamic Pages and Google ???
Google doesn't choke at all on dynamic pages. pages get ranked by keywords appearing on the page and even more importantly, the link text of links on other pages pointing to the page that's being indexed. in other words, if a lot of sites link to your page like so: google choke then a search for 'google choke' will put you at the top. save your time trying to get rid of ?'s and &'s and concentrate on promoting your site the normal way. On Tue, 17 Apr 2001 17:47:43 + (GMT), Philip Olson ([EMAIL PROTECTED]) wrote: >Check out this article : > > Building Dynamic Pages With Search Engines in Mind : > > http://phpbuilder.com/columns/tim2526.php3 > >Also, mod_rewrite related "stuff" has been discussed : > > http://marc.theaimsgroup.com/?l=php-general&s=mod_rewrite > >regards, >philip > >On Mon, 16 Apr 2001, Jon Shoberg wrote: > >> >> So I was having a conversation with a manager/educator in the IT >>Industry :) >> >> In a discussion concerning search engines he stated how he >>dislikes dynamic >> web pages (PHP/ASP/JSP/CFM) because search engine spiders 'choke' >>on dynamic >> content or gives those pages a lower ranking. I can't see this as >>being >> true. I epically can't see the search spider "choking" on dynamic >>pages >> returning well-formed/valid HTML. >> >> Any thoughts? >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Finding Duplicate Numbers?
On Tue, 17 Apr 2001 12:34:27 -0700, Colin Putney ([EMAIL PROTECTED]) wrote: >On Tuesday, April 17, 2001, at 12:19 PM, Mark Maggelet wrote: > >> That works for mysql. He probably just wants to kill the >>duplicates, >> so there's an easier way: add a unique index to the phone_number >> field. >> >> alter ignore table $table add unique (phone_number); > >Yep, that will prevent duplicate phone numbers from being inserted >into >the table. > >Note that if there is existing data in the table, he'll have to >remove >the duplicates before making the phone_number field unique. That would be true if I left out the 'ignore'. The way it is here it will automatically toss the duplicates. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Why is this happening
On Tue, 17 Apr 2001 15:55:38 -0500, Boget, Chris ([EMAIL PROTECTED]) wrote: >Ok, I found out what the problem was. I'm still curious >why the problem is occuring. > >> if( $tmpArray[errorNumber] & $typesToDisplay ) { // line to >>comment out you're using the bitwise & when you want the logical && -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Why is this happening
On Tue, 17 Apr 2001 16:06:47 -0500, Boget, Chris ([EMAIL PROTECTED]) wrote: >> >Ok, I found out what the problem was. I'm still curious >> >why the problem is occuring. >> >> if( $tmpArray[errorNumber] & $typesToDisplay ) { >> you're using the bitwise & when you want the logical && > >No, I actually wanted to use the bitwise &. I wanted to see >if the "errorNumber" was in $typesToDisplay. without seeing the code I would guess you should be using in_array(). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange errors
maybe it's something in auto_prepend_file or auto_append_file. do phpinfo() to check. On Thu, 26 Apr 2001 09:36:56 +0930, Joseph Blythe ([EMAIL PROTECTED]) wrote: >Hey all, > >I keep getting this error message on a couple of pages from a site I >am >currently working on, the strange thing about this is there are no >included files in 'browser.php' and I am certainly not including >'browser.php' anywhere. > >Warning: Failed opening '/home/binary/public_html/browser.php' for >inclusion (include_path='./inc:/usr/local/lib/php:.') in Unknown on >line 0 > >If anyone knows what is wrong or has had a simular problem please >let >me know. > >Regards > >Joseph > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] cookies and clocks
I have a cookie that times out after an hour for security reasons. About 1 out of 200 of my users send me an email saying they can't log into my site and I find out that it's usually because their clocks are off. Has anyone had any luck using the time on the client to set cookies by instead of server time? I hate using javascript for this but I don't see much choice. thanks, - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Big Problem
On Thu, 26 Apr 2001 01:48:13 +0200, Thomas Booms ([EMAIL PROTECTED]) wrote: >Hi all, > >I'm using on my new machine (SuSE 7.0) PHP4. In one PHP4-Script I use >the mail-Function. But my /var/log/mail (qmail) does not give any >entry >for this mail. > >Is there a bug? > >In PHP3 it was all running good. > >I have a serious problem here because this is a customers site! > >Thanks in advance. > >Thomas maybe sendmail_path should be set, or else I think you can just check that sendmail is in the path. I know that you're using qmail, but it usually puts a wrapper called sendmail in the path which calls qmail. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strange errors
On Thu, 26 Apr 2001 09:54:04 +0930, Joseph Blythe ([EMAIL PROTECTED]) wrote: >Chris Fry wrote: > >> Have a look at php.ini in /usr/local/lib >> >> It looks like your prepend file is browser.php - just comment that >>line out. > >Those lines in the php.ini are blank > >; automatically add files before or after any PHP document >auto_prepend_file = >auto_append_file= they could be also be set in .htaccess or httpd.conf or maybe somewhere else. the best way to check is phpinfo() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] cookies and clocks
On Wed, 25 Apr 2001 17:32:44 -0700, DanO ([EMAIL PROTECTED]) wrote: >look at it this way: > >you are dealing with an INTERVAL of time, thus the only reason you >really need javascript is in the construction of a date object. as far as I know the only way to set a cookie's expiration is with an exact GMT timestamp. If there were a way to tell a browser "1 hour from now" then this would solve my problem. >you can either import that object into php as a string, or you can >actually go the extra mile and set the cookie in javascript. right. I hate to do this though. I guess I'm asking if someone out there has had this problem and found a good way around it. thanks, - Mark >HTH, >DanO > > >"Mark Maggelet" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >I have a cookie that times out after an hour for security reasons. >About 1 out of 200 of my users send me an email saying they can't log >into my site and I find out that it's usually because their clocks >are off. Has anyone had any luck using the time on the client to set >cookies by instead of server time? I hate using javascript for this >but I don't see much choice. > >thanks, >- Mark > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] cookies and clocks
On Wed, 25 Apr 2001 17:48:48 -0700 (PDT), Rasmus Lerdorf ([EMAIL PROTECTED]) wrote: >> I have a cookie that times out after an hour for security reasons. >> About 1 out of 200 of my users send me an email saying they can't >>log >> into my site and I find out that it's usually because their clocks >> are off. Has anyone had any luck using the time on the client to >>set >> cookies by instead of server time? I hate using javascript for this >> but I don't see much choice. > >Just use a session cookie (by not providing an expiry time) and add >the >server's expiry timestamp to the value of the cookie. Then when you >get >that cookie sent to you, check it against your server's time and >make the >decision on whether to accept the cookie or not based on that. > >That way you are immune from people not having their system clocks >set >right. good idea. I'll do that. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] timezones
On Mon, 30 Apr 2001 13:56:20 -0500, Joe Stump ([EMAIL PROTECTED]) wrote: >I have a quick question regarding timezones ... > >On the local side a record is inserted into the DB by someone in >Michigan, while >the server rests in CA. Thus a three hour difference. The local >mktime() will >create a timestamp for say 9:00am when in reality it was entered at >12:00noon >in MI. I have 2 character timezones for all my users so it should be >easy to >convert the two. you could use gmmktime() instead and add or subtract the offset. $offsets=array(" "PST"=>1000, // not actual values "EST"=>-2000, "); $localtime=gmmktime()+$offsets[$timezone]; >putenv() won't work because of the fact that the timestamp created >will be >9:00 no matter what timezone you put it in. So what needs to be done >is some >recognition that 10800 seconds needs to be added to adjust the PST >timestamp >to an EST timestamp. Are there any functions out ther that do this? > >--Joe > >Joe Stump <[EMAIL PROTECTED]> >- >--- >One is taught by experience to put a premium on those >few people who can appreciate you for what you are. > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] timezones
On Mon, 30 Apr 2001 14:24:20 -0500, Joe Stump ([EMAIL PROTECTED]) wrote: >Thanks to everyone who sent in the info. The problem is as follows: > >1.) the mktime()'s are stored as PST in the DB. they still could be just make your pst offset be 0 and every timezone offset be the difference in hours between them and pst*3600 >2.) we have users ALL OVER the world - is there a place to find all >of the timezones at? good luck, there's tons and some of them are wacky or don't honor daylight saving time. > >--Joe > >On Mon, Apr 30, 2001 at 12:11:55PM -0700, Mark Maggelet wrote: >> On Mon, 30 Apr 2001 13:56:20 -0500, Joe Stump ([EMAIL PROTECTED]) >> wrote: >> >I have a quick question regarding timezones ... >> > >> >On the local side a record is inserted into the DB by someone in >> >Michigan, while >> >the server rests in CA. Thus a three hour difference. The local >> >mktime() will >> >create a timestamp for say 9:00am when in reality it was entered >>at >> >12:00noon >> >in MI. I have 2 character timezones for all my users so it should >>be >> >easy to >> >convert the two. >> >> you could use gmmktime() instead and add or subtract the offset. >> >> $offsets=array(" >> "PST"=>1000, // not actual values >> "EST"=>-2000, >> "); >> >> $localtime=gmmktime()+$offsets[$timezone]; >> >> >putenv() won't work because of the fact that the timestamp created >> >will be >> >9:00 no matter what timezone you put it in. So what needs to be >>done >> >is some >> >recognition that 10800 seconds needs to be added to adjust the PST >> >timestamp >> >to an EST timestamp. Are there any functions out ther that do >>this? >> > >> >--Joe >> > >> >Joe Stump <[EMAIL PROTECTED]> >> >-- >>--- >> >> >--- >> >One is taught by experience to put a premium on those >> >few people who can appreciate you for what you are. >> > >> > >> >-- >> >PHP General Mailing List (http://www.php.net/) >> >To unsubscribe, e-mail: [EMAIL PROTECTED] >> >For additional commands, e-mail: [EMAIL PROTECTED] >> >To contact the list administrators, e-mail: php-list- >> >[EMAIL PROTECTED] >> > >Joe Stump <[EMAIL PROTECTED]> >- >--- >Dyslexics of the world > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL select rand() with weighting?
On Thu, 3 May 2001 20:15:26 +0100, James, Yz ([EMAIL PROTECTED]) wrote: >Hi Guys, > >Does anyone know how to select one field randomnly from a MySQL table >against a weighting column in the same row the field is selected >from? > >For example, "SELECT id, url, image FROM table ORDER BY rand() LIMIT >1". i guess you'd just go ' order by rand()*weighting' - Mark >And have a column like "weighting" where values between 1 and 100 >are held - >The larger values making it more likely that they're going to get >pulled >out. So say I have three rows in the table, one "weighing" 100, the >others >weighing 50, the one weighhing 100 stands a better chance of being >selected >randomnly? > >I know I've not explained this too well, but hopefully *someone* >will know >what I'm rambling on about ;) > >Thanks as always, > >James. > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] conversion script
On Tue, 8 May 2001 11:09:18 -0700, Ryan Christensen ([EMAIL PROTECTED]) wrote: >Would anyone be able to help me out with this: > >I have quite a few (almost 2000) .html files that I would like to >change >over to the .php extension. Past that, I would also like to add >text to the >top & bottom of each page (for template purposes.) Does anyone know >of a >script that would automate this process, going through all the >documents in >a directory, and making the needed changes? > >Thanks in advance.. for the first part you can try (not tested): for i in `/bin/ls *html |sed 's/.html//g'`; do mv $i.html $i.php; done for the second part you might want to try putting it in your auto_prepend_file. - Mark > >Ryan Christensen >OlyPen Technical Support >[EMAIL PROTECTED] >360.457.3000 >800.303.8696 > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Apache error when installing PHP 4.0.5
On Wed, 9 May 2001 15:49:51 -0500, Joseph Bannon ([EMAIL PROTECTED]) wrote: >> you need to point to the apache-source install >> ie: ./configure --with-apache=../apache-1.3.19 > > >But what if I have apache already installed? I have a Cobalt Raq3 >with >apache already installed. you need to recompile apache too, unless you want to run php as cgi, in which case you just leave out the --with-apache part >Joseph > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is there a string index funct?
On Wed, 9 May 2001 18:08:45 -0700, Dexter ([EMAIL PROTECTED]) wrote: >Hi PHP sters, > >Looking for a function like Perls index function to get the first >occurrence of a string within another. > >Thanks > >Dexter http://www.php.net/manual/en/function.strpos.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PC MAG article
On Wed, 9 May 2001 20:19:34 -0400, Mike ([EMAIL PROTECTED]) wrote: >As a devoted php programmer I was surprised how bad PC MAG blasted >php this >month.It sound as if it doesnt scale very well(Ive never had more >than a few >people on my site at once).Any comments??? seeing as how zdnet is owned by microsoft, you can decide how much credibility you can give their articles. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] protecting video files
On Fri, 11 May 2001 17:28:25 -0500, WebMaster ([EMAIL PROTECTED]) wrote: >I did :( went character by character and could find not extra spaces. > >At 06:16 PM 5/11/01 -0400, Michael Kimsal wrote: >>Check for extraneous spaces in your script. >> >>Tim Schulte wrote: >> >> > Hi there - >> > >> > I am having some weird problems here. I am try to write a >>script that >> > will check to see where a movie file is being called from. I >>want to define >> > which web page I will allow a movie to be called from, and block >>all >> others. >> > The script so far looks like this: >> > >> > The file gets called like this >> > http://www.hardcorehosting.com/video/playmovie.php?movie=test.mov >> > >> > playmovie.php === >> > > > header("Content-type: video/quicktime"); >> > $file=fopen($movie, "r"); >> > fpassthru($file); >> > ?> some suggestions: 1) use "rb" instead of "r" for binary files 2) you forgot to fclose the file handle. 3) try readfile() instead. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ssh
On Mon, 14 May 2001 23:29:03 -0800, Christopher Ostmo ([EMAIL PROTECTED]) wrote: >Tyrone Mills pressed the little lettered thingies in this order... > >> How about using something like puTTY or SecureCRT? >> > >Just a side note. I also like SecureCRT, but it isn't "free" (which >was >the original request) unless you install an "alternative license." >It's >worth the $99 to me, but the requestor was looking for free. I like just regular ssh under cygwin, which are both free, its especially nice on NT and win2000 where you can get a full size command prompt window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Change 'key' names of an associative array.
reset($array); while(list($key,$value)=each($array)){ $array[strtoupper($key)]=$value; unset $array[$key]; } On Tue, 15 May 2001 16:19:41 -0400, Altunergil, Oktay ([EMAIL PROTECTED]) wrote: >Yes. But I want to change the name of the key, not the value. Plus I >want to >be able to do this without creating an extra key/value pair for each >conversion I do. > >oktay > >-Original Message- >From: Jack Dempsey [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, May 15, 2001 4:22 PM >To: Altunergil, Oktay; [EMAIL PROTECTED] >Subject: RE: [PHP] Change 'key' names of an associative array. > > >have you tried http://www.php.net/manual/en/function.strtoupper.php > >-jack > >-Original Message- >From: Altunergil, Oktay [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, May 15, 2001 4:15 PM >To: [EMAIL PROTECTED] >Subject: [PHP] Change 'key' names of an associative array. > > > >I have been trying to convert a MySQL application to Oracle. Oracle >needs >the field names to be upper case. >For this reason even if I can fetch the result row, I can't access >it by >$row[name] because I have to do >$row[NAME]. > > >Is there a way to change the the key name to upper case, without >making a >copy.? (I mean without creating another array key with the same name >in >upper case) > >Thanks. > >Oktay Altunergil > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Pros/Cons, Case Examples, PHP vs Servlets
>The sercuity of java is better and the network controlling features >is better too . > >The loading time of servlet is faster since the server just need to >run the servlet one times You probably mean that it needs to load the jvm one time, the servlet gets run with every request (unless you cache). >and the servlet will leave inside server's memory for further use, I'm guessing you meant to say either 'leak' or 'live', probably both. >but PHP script will be run every times Unless you cache. I've never seen a benchmark where java ran faster than php >you can control synchronization in servlet but you can't in PHP Synchronization of what, threads? Php doesn't have threads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] function to complete strings with white spaces on the left
On Sun, 20 May 2001 22:03:05 -0300, Carlos Fernando Scheidecker Antunes ([EMAIL PROTECTED]) wrote: >Hello All, > >I need to output a string that must always be 17 characters even if >the inside value is not. > >Supose a have the HELLO word that is a 5 character string and I need >to output "HELLO" which is 17 characters. >How can I accomplish this in PHP4 ? > >Has anyone ever did it? echo str_pad("HELLO",17); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Job listings DB
On Mon, 21 May 2001 13:55:12 +0100, py ([EMAIL PROTECTED]) wrote: >> Hi, >> >> I am designing a system for my company to get employee resumes via >>the >Web, >> rather than paper. All resumes now go into a mySQL DB, which can be >> searched by HR (at least that's the theory :) > >[I would do it like that also] > >> >> My questions: >> >> For job listings - how do I design the tables? Can I dump all job >>listings >> into a single table, and all applications/resumes into another >>one? Or >> should they be normalized? > >[They should be normalized] only if it makes life easier. I hardly ever do it that way because it takes longer and doesn't usually speed things up any. >> If normalized - how much? For example, in a listing, I have job >>code, >> department, location, salary range, etc. - should I have separate >>tables >> for each of these? Like > >[Yes, I would say so] sounds like a headache to me. >> jcode dept loc >> 1 213 2 >> 2 77 3 >> >> where dept and loc are FKs to other tables? Or is this taking it >>too far? > >[It is not a necessity, but it would be easier to modify or upgrade >later, wich we always do] not necessarily easier, it just means you're making changes to one table instead of another. >> Same for application form. All this information that I am getting - >> should >> I put into a single table, or split across separate tables? I do >>plan to >> search by differenet criteria later. >> >> What about items in drop-downs? For example, if I have a drop-down >>for >> salary ranges or countries - should this information come from a >>table, or >> should I hard-code into the form itself? How do I make the >>decision as to >> which is appropriate? > >[I would never hard code anything that can change, salary ranges can >changes, country can change too :) ] I agree there. you can even take laziness to the next level and use 1 table with fields for just the items you will use in your sql, serialize the rest of the data and put it in a text field -> that way you can add fields later without having to alter the table. Plus you could put a fulltext index on that and do an easy keyword search on all the data. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regular Expression Help
On Tue, 22 May 2001 10:44:42 -0700, Jason Caldwell ([EMAIL PROTECTED]) wrote: >I'm trying to figure out how to "say" with a Regular Expression how >to check >for the following characters in a phone number: > >( ) - > >with a length between 1 and 20 -- > >I've tried the following and it doesn't seem to work. > >eregi("^([0-9]|\\(|\\)|\\-){1,20}$") oops, make that: "^[0-9\\(\\)-]{1,20}$" note: you don't have to escape the - when its the last char in the range >I'm not interested in checking for a completely valid phone >number... but >instead checking to see if the phone number is numbers with or >without the >( ) - characters. Plus, I think creating a Regex expr that can check >for US >and International formats would be too complex. > >Thanks. >Jason > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL "DISTINCT" query
On Wed, 21 Mar 2001 11:04:48 -0700, Jared Howard ([EMAIL PROTECTED]) wrote: >I need to retrive all column information from a DISTINCT query. But >so >far, I only can get one column to show by using this: > >SELECT DISTINCT my_column FROM my_table; > >which then gives me a list of my_column information and is correct, >but I >need all information from all columns. Querying this: > >SELECT DISTINCT my_column, my_column2, my_column3, my_column4 FROM >my_table; > >was my guess at it, but doesn't work how I'd like. SELECT * FROM my_table group by my_column; - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] trim string
On Wed, 21 Mar 2001 18:09:47 +0800, Wen Ni Leong ([EMAIL PROTECTED]) wrote: >I need help in this basic string function. >I query from the database by using while loop and the result in in >array. I separated them by using "," . > >I want at the end of the string to be trim off. Unfortunately I >tried >all the string function such as chop,trim and substr but they seem >like >can't manage to trim the end of the string. Please help me. > >my coding are: > >$db = mysql_select_db("tkenet_db"); >$query = "SELECT app_name,status FROM approval_list where >doc_no='6'"; >$result = mysql_query($query,$db); >while($data = mysql_fetch_row($result)){ > > $cc .= $h->get_email($data[0]).","; > > if ($data[1] != 'Y') > { $all_yes = 1;} > } > trim($cc); this doesn't do anything to $cc, you have to catch the return value: $cc=trim($cc); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Benchmark single page
On Wed, 21 Mar 2001 17:09:17 -0800, Jason Granum ([EMAIL PROTECTED]) wrote: >I'm wanting to benchmark a single PHP page to the millisecond (if >possible) that basicly just will put a > >This page generated in X.XXX seconds > >at the bottom of every page. > >I've tried looking through the past messages on the group but havn't >found any threads relating to this. Anyone have any ideas of how to >do this simple thing simply? > >Thanks you can call microtime() at the top and bottom and subtract them, and maybe use output buffering functions to be completely accurate. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Environment extract
On Tue, 27 Mar 2001 17:31:25 +0100, Costas ([EMAIL PROTECTED]) wrote: >when i try printing > >print $HTTP_USER_AGENT; > >I get the error message Undefined variable: HTTP_USER_AGENT > >have i missed a declaration of some sort or something else? > >thanks Are you doing this from inside a function? If so you have to make it global at the top: function foo(){ global $HTTP_USER_AGENT; echo $HTTP_USER_AGENT; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is it possible to have href link refer to same PHP file?
On Tue, 27 Mar 2001 14:04:58 -0600 (Central Standard Time), Michael Champagne ([EMAIL PROTECTED]) wrote: >Is there a way to have an ordinary href link call some javascript >and say "are >you sure blah blah blah?" and then once you hit Ok it calls the same >php file >which then does all the database stuff? >I know I can do this just by creating another PHP file and having >the link >call that, but it seems like it would be nicer to have this in the >same file. > >Thanks! > >-- >Michael Champagne >wk: [EMAIL PROTECTED] >hm: [EMAIL PROTECTED] > > > > >** >This communication is for informational purposes only. It is not >intended as an offer or solicitation for the purchase or sale of >any financial instrument or as an official confirmation of any >transaction, unless specifically agreed otherwise. All market >prices, data and other information are not warranted as to >completeness or accuracy and are subject to change without >notice. Any comments or statements made herein do not >necessarily reflect the views or opinions of Capital Institutional >Services, Inc. Capital Institutional Services, Inc. accepts no >liability for any errors or omissions arising as a result of >transmission. Use of this communication by other than intended >recipients is prohibited. >** > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Is it possible to have href link refer to same PHP file?
On Tue, 27 Mar 2001 15:50:44 -0600 (Central Standard Time), Michael Champagne ([EMAIL PROTECTED]) wrote: >But then how would you process it in the same file? If I'm calling >it from >myfile and my link is to myfile then how does it know that it's >already been >clicked? well you can make the url be: myfile?clicked=true then do if(isset($clicked)){ // do stuff } up at the top. - Mark >Thanks, >Mike > >> On Tue, 27 Mar 2001 14:04:58 -0600 (Central Standard Time), Michael >> Champagne ([EMAIL PROTECTED]) wrote: >> >Is there a way to have an ordinary href link call some javascript >> >and say "are >> >you sure blah blah blah?" and then once you hit Ok it calls the >>same >> >php file >> >which then does all the database stuff? >> >> >> >> >I know I can do this just by creating another PHP file and having >> >the link >> >call that, but it seems like it would be nicer to have this in the >> >same file. >> > >> >Thanks! >> > >> >-- >> >Michael Champagne >> >wk: [EMAIL PROTECTED] >> >hm: [EMAIL PROTECTED] >> > >> > >> > >> > >> >** >> >This communication is for informational purposes only. It is not >> >intended as an offer or solicitation for the purchase or sale of >> >any financial instrument or as an official confirmation of any >> >transaction, unless specifically agreed otherwise. All market >> >prices, data and other information are not warranted as to >> >completeness or accuracy and are subject to change without >> >notice. Any comments or statements made herein do not >> >necessarily reflect the views or opinions of Capital Institutional >> >Services, Inc. Capital Institutional Services, Inc. accepts no >> >liability for any errors or omissions arising as a result of >> >transmission. Use of this communication by other than intended >> >recipients is prohibited. >> >** >> > >> >-- >> >PHP General Mailing List (http://www.php.net/) >> >To unsubscribe, e-mail: [EMAIL PROTECTED] >> >For additional commands, e-mail: [EMAIL PROTECTED] >> >To contact the list administrators, e-mail: php-list- >> >[EMAIL PROTECTED] >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] >> >> > >-- >Michael Champagne, Software Engineer >Capital Institutional Services, Inc. >wk: [EMAIL PROTECTED] >hm: [EMAIL PROTECTED] > > > >** >This communication is for informational purposes only. It is not >intended as an offer or solicitation for the purchase or sale of >any financial instrument or as an official confirmation of any >transaction, unless specifically agreed otherwise. All market >prices, data and other information are not warranted as to >completeness or accuracy and are subject to change without >notice. Any comments or statements made herein do not >necessarily reflect the views or opinions of Capital Institutional >Services, Inc. Capital Institutional Services, Inc. accepts no >liability for any errors or omissions arising as a result of >transmission. Use of this communication by other than intended >recipients is prohibited. >** > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Match em up
On Thu, 29 Mar 2001 19:58:51 +0200, Johannes Janson ([EMAIL PROTECTED]) wrote: >Hi, > >SELECT a.list FROM db1 a, db2 b WHERE a.email!=b.email; > >this shoulds work no, this isn't even close. you need a left join, there's an example in the mysql docs under left join that shows you how to do what you want. - Mark >Johannes > ><[EMAIL PROTECTED]> schrieb im Newsbeitrag >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> Hi, >> >> I have two database`s with one table in each. (MySQL) >> >> Is there a way that I can select data from one table and then >>match it >with >> the data in another and discard the results so all I am left with >>is the >> original data from the first table which never matched up. >> >> Database1 >> >> EmailAddress >> RecID - Email >> >> Database2 >> >> Members >> lots of stuff blah blah >> Email >> >> So I would match the Email from Database1 Table EmailAddress to >>those in >> Database2 Members. Take out the matches and be left with a list of >>people >who >> started signing up but never completed it. Any thoughts? >> >> Ade >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] >> > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Date difference
On Sat, 31 Mar 2001 20:07:10 +0600, ([EMAIL PROTECTED]) wrote: >Dear Friends, > >I am accessing a MySQL database through PHP. > >I have to calculate the difference between todays date and the date >obtained >from MySQL database. select to_days(curdate())-to_days(datefield) from table; - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Loading SQL files (not CSV) into mySQL
I think you want: exec("/path/to/mysql -p$password -u$username $database < $filename"); On Wed, 04 Apr 2001 00:35:34 +0100, Andy Warwick ([EMAIL PROTECTED]) wrote: >I'm after some pointers on how to dump and load SQL files to and >from mySQL >using a PHP/HTML form. > >I've read the manual about "LOAD DATA INFILE", but as far as I can >tell that >won't help in this case. Unfortunately, CSV files are not an option >(client's demands... go figure). > >What I'm after is dumping/uploading SQL files of the form: > >== ># ># PHP/MySQL Demo - Table Dump ># > ># ># Structure ># > >DROP TABLE IF EXISTS demo; >CREATE TABLE demo ( > id tinyint(2) unsigned zerofill NOT NULL auto_increment, > name char(50) NOT NULL, > logo_url char(50) NOT NULL, > page_colour char(6) DEFAULT 'FF' NOT NULL, > last_order datetime DEFAULT '-00-00 00:00:00' NOT NULL, > PRIMARY KEY (id), > KEY id (id), > UNIQUE id_2 (id) >); > ># ># Data ># > >INSERT INTO demo (id, name, logo_url, page_colour, last_order) >VALUES ( >'01', 'CompanyName', 'logo.gif', '99CCFF', '2001-04-06 13:21:31'); >== > >Complete with table creation and data inserts. In effect, it needs >to be >standalone text files full of SQL commands. > >I know it can be done, because phpMyAdmin has exactly this facility. >But >even after studying the code of that carefully, I can't tell which >specific >pieces are handling this enough to extract the facility. > >Can anyone point me, or is willing to donate, any articles/code >snippets/etc >that will help. > >TIA > >Andy Warwick > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Alphabetize array,.. please?
On Tue, 03 Apr 2001 16:44:36 -0700, Brandon Orther ([EMAIL PROTECTED]) wrote: >Hello, > >I have an array from an ftp nlist. Is there any way I can >alphabetize the >array? sort($array); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] scramble the code-sneaky solution
On Thu, 05 Apr 2001 10:11:20 -0700, Lindsay Adams ([EMAIL PROTECTED]) wrote: >If you don't want to rewrite any of your existing code, consider the >behavior of frames. >If you make a frameset with a 0 height for the top frame, and then >use the >bottom frame for everything, then the URL in the location/address >bar in the >browser will not ever change. > >This only requires that you create a frameset as your default page, >and >rename your old default page. (don't forget to create a blank page >for that >invisible top frame, or you will get a no data present or file not >found >error, and your user won't know why) > >While this won't prevent people from seeing the code if they open >the lower >frame in a new window, but they probably won't think of it. ha, well it depends on the browser but in IE (the most widely used) when you click 'view source' from the right click menu you will see the source for the frame you're on. when you click it from the toolbar you see the source for the frameset. Mine (I'm a special case I know) even has this feature where you can highlight just the form part of a page and hit 'view partial source' and see just the form html -> hidden fields and all. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing variables,,, I know its not this hard.
On Mon, 09 Apr 2001 12:08:48 -0400, Curtis ([EMAIL PROTECTED]) wrote: >Hello, >Could someone please tell me where I am going wrong here. >I have an HTML form and I want to past the input from a text box to >the >next page url to connect >to my mysql database. > >Here is where I am at now > > >method="post" onsubmit="return validate()"> > > > > >the onsubmit is a javascript for validation. > >I have tried this every which way, but the correct way. > >Could someone point me in the right direction. > >Thanks >Curtis > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Limitation of redirecting using header()?
On Tue, 10 Apr 2001 14:18:54 -0400, Daniel ([EMAIL PROTECTED]) wrote: >I am writting a session enabled webapp that has a typical login >page. The >page submits to itself and upon validation, I want to allow the user >to >continue on to the next page. > >>From everything I have read so far, the only way to redirect >programmatically is via header(). Unfortunately, what I'm seeing is >that >while the followup page is loaded, the location in the address bar >(of IE >5.5) is not updated. Is this something specific to IE? I would >like the >address bar to have the correct address instead of the old page. > >Any suggestions? in my experience, using a full url: header("Location: http://www.mysite.com/mypage.html"); will do what you want while just using a path: header("Location: /mypage.html"); will not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Limitation of redirecting using header()?
On Tue, 10 Apr 2001 17:16:08 -0400, Daniel ([EMAIL PROTECTED]) wrote: >I might have misread this comment, but I found the opposite. > >In one instance, I had: >header("Location: $path/newpage.php"); >and in another instance: >header("Location: newpage.php"); I'm talking about using the full url (http://...), this will update the address bar every time (in my experience) >The latter (without the path) did update the address bar properly. I would stay away from doing it that way, it looks like it could be confusing for some browsers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] compile problems
Hi , I'm having compile problems with php4.04pl1 and the latest development version (where can I get older?) here's what the end of make looks like: .libs/libphp4.a(xml.o): In function `xml_parser_dtor': /home/certscape/php4-200104102145/ext/xml/xml.c:304: undefined reference to `php_XML_ParserFree' .libs/libphp4.a(xml.o): In function `php_if_xml_parser_create': /home/certscape/php4-200104102145/ext/xml/xml.c:1091: undefined reference to `php_XML_ParserCreate' /home/certscape/php4-200104102145/ext/xml/xml.c:1095: undefined reference to `php_XML_SetUserData' .libs/libphp4.a(xml.o): In function `php_if_xml_set_element_handler': /home/certscape/php4-200104102145/ext/xml/xml.c:1214: undefined reference to `php_XML_SetElementHandler' .libs/libphp4.a(xml.o): In function `php_if_xml_set_character_data_handler': /home/certscape/php4-200104102145/ext/xml/xml.c:1233: undefined reference to `php_XML_SetCharacterDataHandler' .libs/libphp4.a(xml.o): In function `php_if_xml_set_processing_instruction_handler': /home/certscape/php4-200104102145/ext/xml/xml.c:1252: undefined reference to `php_XML_SetProcessingInstructionHandler' .libs/libphp4.a(xml.o): In function `php_if_xml_set_default_handler': /home/certscape/php4-200104102145/ext/xml/xml.c:1270: undefined reference to `php_XML_SetDefaultHandler' .libs/libphp4.a(xml.o): In function `php_if_xml_set_unparsed_entity_decl_handler': /home/certscape/php4-200104102145/ext/xml/xml.c:1289: undefined reference to `php_XML_SetUnparsedEntityDeclHandler' .libs/libphp4.a(xml.o): In function `php_if_xml_set_notation_decl_handler': /home/certscape/php4-200104102145/ext/xml/xml.c:1307: undefined reference to `php_XML_SetNotationDeclHandler' .libs/libphp4.a(xml.o): In function `php_if_xml_set_external_entity_ref_handler': /home/certscape/php4-200104102145/ext/xml/xml.c:1325: undefined reference to `php_XML_SetExternalEntityRefHandler' .libs/libphp4.a(xml.o): In function `php_if_xml_parse': /home/certscape/php4-200104102145/ext/xml/xml.c:1394: undefined reference to `php_XML_Parse' .libs/libphp4.a(xml.o): In function `php_if_xml_parse_into_struct': /home/certscape/php4-200104102145/ext/xml/xml.c:1428: undefined reference to `php_XML_SetDefaultHandler' /home/certscape/php4-200104102145/ext/xml/xml.c:1429: undefined reference to `php_XML_SetElementHandler' /home/certscape/php4-200104102145/ext/xml/xml.c:1430: undefined reference to `php_XML_SetCharacterDataHandler' /home/certscape/php4-200104102145/ext/xml/xml.c:1432: undefined reference to `php_XML_Parse' .libs/libphp4.a(xml.o): In function `php_if_xml_get_error_code': /home/certscape/php4-200104102145/ext/xml/xml.c:1450: undefined reference to `php_XML_GetErrorCode' .libs/libphp4.a(xml.o): In function `php_if_xml_error_string': /home/certscape/php4-200104102145/ext/xml/xml.c:1465: undefined reference to `php_XML_ErrorString' .libs/libphp4.a(xml.o): In function `php_if_xml_get_current_line_number': /home/certscape/php4-200104102145/ext/xml/xml.c:1484: undefined reference to `php_XML_GetCurrentLineNumber' .libs/libphp4.a(xml.o): In function `php_if_xml_get_current_column_number': /home/certscape/php4-200104102145/ext/xml/xml.c:1500: undefined reference to `php_XML_GetCurrentColumnNumber' .libs/libphp4.a(xml.o): In function `php_if_xml_get_current_byte_index': I don't even want any of this xml crap. any pointers appreciated. thanks, - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] resultset array
On Thu, 12 Apr 2001 15:42:54 -0400, Mike ([EMAIL PROTECTED]) wrote: >I would like to put a mysql resultset into an array of type >row(rownunber)(data).Any Ideas? >Mike P >[EMAIL PROTECTED] > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] while($row[]=mysql_fetch_array($result)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] An idea
it looks like you're getting your ereg and preg mixed up but try it like this: switch(1){ case ereg("\\.jpg$",$filename): echo "JPEG Image";break; case ereg("\\.gif$",$filename): echo "GIF Image";break; case ereg("\\.zip$",$filename): echo "Compressed File"; break; default: echo "Unkown File Type"; break; } thats maybe a little cleaner than using if/else if's. also be careful on the backslash, you have to escape it in double quotes. On Tue, 19 Jun 2001 18:48:03 -0400, TunkeyMicket ([EMAIL PROTECTED]) wrote: > Humor me, how useful would a Regex switch statement be? > > Like: > > ereg_switch($filename) { > case "/\.jpg$/": > echo "JPEG Image"; break; > case "/\.gif$/"; > echo "GIF Image"; break; > case "/\.zip$/": > echo "Compressed File"; break; > default: > echo "Unkown File Type"; break; > } > > That is just an example of an application of such, I have other >applications that I would like to use it for, but that serves the >best example. I would love to get started on a module project for >something like this, as using IF blocks with PREG_MATCH become >tedious and inefficient. If you know of such a module or would >know how to get started, please repsond with your ideas/input. > > Chris "TunkeyMicket" Watford > > TunkeyMicket Productions > www.tunkeymicket.com >
RE: [PHP] Help with simple regular expression
another way to match this that works with preg or ereg is to go like this: ]*> On Mon, 25 Jun 2001 15:31:29 -0400, scott [gts] ([EMAIL PROTECTED]) wrote: >exactly. use the non-greedy "?" with the perl regex's >to have perl match the least amount of characters it can. > >preg_match('//', $text, $matches) > >in the case of perl regexp's, you have to specifically >tell the regexp not to be greedy. the "?" regexp modifier >is how you do this. (otherwise, the regexp will try and >match the maximum amount of text that it can, which >usually isnt what you want, since it'll match *eveything* >between "blah" and the last occurance of ">" in the text) > >so, in the case of this text: > >sasfd asdf asdf > > >the greedy will match something like this: > now> >sasfd asdf asdf > > >and the non-greedy will match something like this: >now > > > > > >> -Original Message- >> From: Richard Lynch [mailto:[EMAIL PROTECTED]] >> Subject: Re: [PHP] Help with simple regular expression >> >> >> That's because POSIX is greedy. Or Perl is greedy. Whatever. >> >> When one of them does that, use the other one. >> >> Instead of eregi, use pregi. >> >> Disclaimer: What I know about Regex could fit in a matchbook. >> >> -- >> WARNING [EMAIL PROTECTED] address is an endangered species -- Use >> [EMAIL PROTECTED] >> Wanna help me out? Like Music? Buy a CD: http://l-i- >>e.com/artists.htm >> Volunteer a little time: http://chatmusic.com/volunteer.htm >> - Original Message - >> From: "Aral Balkan" <[EMAIL PROTECTED]> >> Newsgroups: php.general >> Sent: Sunday, June 24, 2001 7:34 PM >> Subject: [PHP] Help with simple regular expression >> >> >> > Hi all, >> > >> > I'm trying to match the body tag in an HTML file (eg. > > bgcolor="gg">) with the following regular expression and >>eregi: >> > >> > >> > >> > Unfortunately it matches everything from the body tag onwards >>and doesn't >> > stop at the greater-than sign. It should be simple thing but I'm >>stumped! >> To >> > me the regex reads match string that begins with >by zero or >> > more of anything and ending with a greater-than sign. >> > >> > Any help would be greatly appreciated! :) >> > >> > Aral >> > __ >> > ([EMAIL PROTECTED]) >> > New Media Producer, Kismia, Inc. >> > ([EMAIL PROTECTED]) >> > Adj. Prof., American University >> > ¯¯ >> > >> > >> > >> > -- >> > PHP General Mailing List (http://www.php.net/) >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] >> > >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] setting output_buffering for certain hosts or directories
Is there any way to set output_buffering per directory or host? I tried putting: php_value output_buffering On in my virtual host, also in , , and .htaccess the only place it seems to get noticed is in php.ini php4.7devel/apache1.3.20/linux thanks, - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] [OT-ish] Optional Extras.
I don't see how this is weighted. I would suggest doing it the easy way and treating the options as keywords and just putting them all in a text field with a fulltext index. this will give you the weighting you want and it will be a lot easier to deal with, but you will have to watch out for things like 'power locks' partially matching 'power doors' (just take out the spaces I guess) On Wed, 27 Jun 2001 00:41:37 -0500, Richard Lynch ([EMAIL PROTECTED]) wrote: >How about solving both problems at once? :-) > >Yes, go with the N:N (the technical term for that car_option table) >relation, *AND* give yourself a weighted search engine to boot! > >create table car (car_id auto_increment...); >create table option (option_id auto_increment...); >create table car_option(car_id int4, option_id int4, key(option_id)); > >insert into car(name) values('Chevy Nova'); >insert into car(name) values('Lexus'); >insert into option(name) values('a/c'); >insert into option(name) values('power window'); >insert into option(name) values('power locks'); >insert into car_option(car_id, option_id) values(1, 1); >insert into car_option(car_id, option_id) values(2, 1); >insert into car_option(car_id, option_id) values(2, 2); >insert into car_option(car_id, option_id) values(2, 3); > >NOTE: The Lexus has all those options (at that price it had better! >) and >the Nova, well... It has a/c! :-) > >Now, assume the user wants everything, so you have: >$options[1] >$options[2] >$options[3] >all "set" to some value by your checkbox. > > >#Untested code. >$query = "select count(car_id), car.name from car, car_option "; >$query .= " where car.car_id = car_option.car_id " >$query .= " and (1 = 0"; ># 1 = 0 is a "starter yeast" for the following: >while (list($option_id) = each($options)){ >$query .= " or option_id = $option_id "; >} ># finish off our options OR list... >$query .= ")"; >$query .= " group by car_id "; > >-- >WARNING [EMAIL PROTECTED] address is an endangered species -- Use >[EMAIL PROTECTED] >Wanna help me out? Like Music? Buy a CD: http://l-i- >e.com/artists.htm >Volunteer a little time: http://chatmusic.com/volunteer.htm > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] help: unzip files for php 3.0
On Mon, 2 Jul 2001 12:55:32 -0700 (PDT), John Holcomb ([EMAIL PROTECTED]) wrote: >The company that houses our servers only has php 3.0 >installed. I need a function that can unzip files. >Are there any methods(functions) that can handle this >in php3.0 or any version of php that's before php 4.0. > >Thank you, you could do something like: exec("pkzip $file"); >John > >__ >Do You Yahoo!? >Get personalized email addresses from Yahoo! Mail >http://personal.mail.yahoo.com/ > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] upgrading to gd2.0.1
Hi, I just upgraded gd to 2.0.1 and recompiled apache1.3.20/php4.06. when I do phpinfo() it says: GD Support enabled GD Version 1.6.2 or higher WBMP Support enabled and when i call imagepng() it says: Warning: ImagePng: No PNG support in this PHP build any ideas what's going on here? I removed config.cache before reconfiguring php thanks, - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] multiple domains using one cookie
On Thu, 5 Jul 2001 14:59:19 +0200, Tobias Talltorp ([EMAIL PROTECTED]) wrote: >Hello all. > >I want multiple domains to be able to read from one cookie, or set >one >cookie each for the different domains. > >Here is the case: >When the user logs in to my server, I want to set a cookie that has >the >value $name="tobias". He specifies which domains that can read this >cookie, >something like $domains="domain1.com;domain2.com;domain6.com". >Then these sites can read the $name and print it. > >The other way might be to set one cookie with the value >$name="tobias" for >domain1.com, one for domain2.com and one for domain6.com. >But the cookie _has_ to come from domain1.com, otherwise it will >only work >for mydomain.com, right? >In other words, I can´t set, edit or read a cookie for an other site? > >How would I go about doing this? right, you can't do it. the browser won't accept a cookie for a domain other than the one it's coming from, and it won't send a cookie for a domain other than the one that's being requested. a couple of ideas for a workaround would be: 1) you can set a cookie on domain1, redirect to a page on domain2 which sets another cookie, redirects to domain6 and sets another cookie and redirects back to domain1 (messy) 2) you can restructure your domains into subdomains like so: www1.domain.com www2.domain.com www3.domain.com these will all get and send cookies for domain 'domain.com' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Using an image as a reset button on a PHP script
On Fri, 13 Jul 2001 14:46:41 -0700, Brandon Orther ([EMAIL PROTECTED]) wrote: >Hello, > >I am making a script at the moment and want to use images instead of >the >usual buttons. Does anyone know how I can use the image as a reset >button? >Thank you, > > >Brandon Orther >WebIntellects Design/Development Manager >[EMAIL PROTECTED] >800-994-6364 >www.webintellects.com > > substitute the name or number of the form for forms[0] if necessary. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] explode()
On Mon, 16 Jul 2001 16:23:19 -0700, Adam Plocher ([EMAIL PROTECTED]) wrote: >$reqmonth = ${explode("-",$row[5])}[1]; > >Is there anyway I can get that to work without having to use >multiple lines >of code? hmm... how about $reqmonth = array_pop(explode("-",$row[5],2)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP mail() function
On Fri, 27 Jul 2001 11:11:57 -0600, Kevin Leavell ([EMAIL PROTECTED]) wrote: >mail0 is sending mail that can't be received by aol or my local isp. > That >same mail can be received by other sites on that same server. The >mail doesn't bounce but I am getting a few DSN errors in my maillog. it sounds like you don't have dns set up. try pinging a bunch of domains from the server. >My site is >hosted at a major hosting company. Funny enough, when the scripts >were run >on their server w/ php as a cgi, all worked well. When I moved my >scripts >to a server that had mod_php, I began having problems. > >Any wizards out their have any ideas? The hosting company seems to >have run >out of ideas. > >The PHP version is 4.0.3pl1 running on Redhat 6x with Apache 1.3.14 > >I have tried various header configs, double checked my php.ini file >sendmail >config, but after a week of dealing with this, I'll try >anythingI'll >even dance a jig if that is what it takes. > >TIA, > >Kevin > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Payflow Pro Problems
On Fri, 27 Jul 2001 09:31:50 -0700, Brandon Orther ([EMAIL PROTECTED]) wrote: >Hello, > >I am trying to get the Payflow pro library compiled with PHP and am >having any problems. When I compile it without shared it gives me a >-8 >error or SSL connection error. If I try to compile it with shared it >gives me undefined function error. Anyone have an helpful tips? >Thank you, i ran into a lot of problems with this a while back. it turned out i had to get older libraries from verisign because they were the ones the payflowpro module was written for and it hadn't been updated yet. also when I tried to get it all compiled into apache-ssl everything was broken for some reason and I ended up having to use php as cgi. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] array through url?
On Fri, 27 Jul 2001 14:21:41 EDT, ([EMAIL PROTECTED]) wrote: >Is it possible to send an array of numbers into a php file through a >url? >Like if I have a file that adds numbers together, could I send it > >www.domain.com/add.php?num=2,3,4,5 > >$num would be an array. on the next page just go: $num=explode(",",$num); either that or use serialize/unserialize. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP mail() function
On Fri, 27 Jul 2001 13:32:49 -0600, Kevin Leavell ([EMAIL PROTECTED]) wrote: >Regular email flows in and out just fine. > >The host providers are and have been fiddling with the dns stuff to >no avail. we don't know anything about your setup, it could be that a different server is handling your mail. If you can ping, say, google.com from the server then that says your dns is ok, if so your problem is probably that php can't find sendmail or something like that. otherwise it's a network problem and you'll have to let the host figure it out. >Kevin > >- Original Message - >From: Mark Maggelet <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> >Sent: Friday, July 27, 2001 12:14 PM >Subject: Re: [PHP] PHP mail() function > > >On Fri, 27 Jul 2001 11:11:57 -0600, Kevin Leavell ([EMAIL PROTECTED]) >wrote: >>mail0 is sending mail that can't be received by aol or my local isp. >> That >>same mail can be received by other sites on that same server. The >>mail doesn't bounce but I am getting a few DSN errors in my maillog. > >it sounds like you don't have dns set up. try pinging a bunch of >domains from the server. > >>My site is >>hosted at a major hosting company. Funny enough, when the scripts >>were run >>on their server w/ php as a cgi, all worked well. When I moved my >>scripts >>to a server that had mod_php, I began having problems. >> >>Any wizards out their have any ideas? The hosting company seems to >>have run >>out of ideas. >> >>The PHP version is 4.0.3pl1 running on Redhat 6x with Apache 1.3.14 >> >>I have tried various header configs, double checked my php.ini file >>sendmail >>config, but after a week of dealing with this, I'll try >>anythingI'll >>even dance a jig if that is what it takes. >> >>TIA, >> >>Kevin >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >>To contact the list administrators, e-mail: php-list- >>[EMAIL PROTECTED] > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Take JS array send by form
On Wed, 1 Aug 2001 23:17:49 +0200, Ivo ([EMAIL PROTECTED]) wrote: >Hi > >I faced following problem: > >I've a form where which could have one or more input text fields (it >is not >clear how many they will be - one or more). Thay have same name - pn >- and >if they are more that one JavaScript treat them as an array - pn[x] > >The problem is that when I receive this form with more than one >field - i.e. >pm[2] - in my php script only the last value is seen, others are >lost i.e. I >loose pn[0], pn[1] and receive only pn[2] as a *pn* variable. I mean >that it >is NOT an array at all. > >What's the problem and how could I solve it? Thank you you have to name the fields pn[0],pn[1]... (you can name them all pn[] but you might have problems with the javascript) then to access them from javascript you go something like: document.forms[0].elements['pn[0]']; ---> using document.forms[0].pn[0] won't work. -- Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Matching Question
On Sat, 4 Aug 2001 12:40:42 -0500, Jeff Oien ([EMAIL PROTECTED]) wrote: >After a sign up page I want to check if someone is already entered >into a database. The First Name, Last Name and Address all have >to match exactly in order for it to be considered a duplicate. >However >this isn't doing what I want. I get the Error produced if the >Address matches >but the name doesn't. Not sure what I'm doing wrong. Thanks. >Jeff Oien you're going about this the wrong way. try it like this: $result=mysql_query("select * from table where first='$first' and last='$last' and address='$address'"); if(mysql_num_rows($result)){ // error code } you want to keep the result sets that mysql gives back as small as possible because they take up tons of resources. >while ($row = mysql_fetch_array($result)) { > $First_Name = $row['First_Name']; > $Last_Name = $row['Last_Name']; > $Address = $row['Address']; > > if (($M_First_Name || $F_First_Name == $First_Name) && > ($M_Last_Name || $F_Last_Name == $Last_Name) > && ($Address1 == $Address)) { > echo " > Error > vlink=\"#660099\"> > Error >etc... > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] dynamic checkboxes?
On Mon, 6 Aug 2001 08:57:08 -0500, garman ([EMAIL PROTECTED]) wrote: >I have a form that generates a list of "categories" dynamically. >That is, for >each category in a database, the form has a corresponding checkbox. >The >checkboxes are given serialized names, such as "chkbx1", "chkbx2", >etc. > >I'm having trouble figuring out how to process these in the php >script that >handles this form. In other words, how do I figure out which >categories were >selected when I don't know in advance how many categories there are? > How can >I check if the form variables "chkbx1", "chkbx2", etc have been set? name them chkbx[1], chkbx[2]... then on the next page go: foreach($chkbx as $key=>$value){ echo "chkbx[$key] is set.\n"; } >Thanks, >Matt > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] checking for null form fields fails
On Mon, 6 Aug 2001 13:56:45 -0500, garman ([EMAIL PROTECTED]) wrote: >For all of my HTML forms, I put in some JavaScript to check and make >sure no >fields are left blank. When the forms are processed in PHP, I also >perform a >check to make sure the forms fields aren't null (redundant, I know). > >Anyway, on a form I just made, both JavaScript and PHP think the >form has been >completed, even when the fields haven't been touched. > >The code basically looks like this: > > > > > > > >onSubmit="return >VerifyInput()"> i can't tell if it's just a email formatting thing, but if there's a line break in the onsubmit string it might mess things up. > > > > >Now, the file "myscript.php" will have something like this: > >if (!isset ($HTTP_POST_VARS['input'])) { >die ("form not complete. cannot continue."); >} well, if it makes it this far, $input will be set, but the value will be "". try empty() instead of !isset() - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] checking for null form fields fails
>Well, Mark... almost! You shouldn't use empty() _instead_ of >isset(). You should use 'm together: > > if (isset ($input) && !empty($input)) { > print ("Okay... form is completed!"); > } else { > print ("No way... can't do!"); > } > >Because, when you check using empty($input) there's still the >possibility that $input isn't defined at all. And then some horrible >error still arises in your logfile. This isn't right, empty() won't give an error if $input isn't set. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP in corporate settings?
On Thu, 09 Aug 2001 14:30:43 -0500, Sheridan Saint-Michel ([EMAIL PROTECTED]) wrote: >Bzzzt...Wrong! But thank you for playing. If you read the FAQ on >Sun's "Open Source" website not only do they admit Java is not >open source, but they sort of tip toe around whether or not it ever >will be. well, I think it depends on if you're talking about java the language, java the jvm, or java the bytecode compiler. which of these do you need to be open source. I know of at least one open source jvm (kaffe), and I believe IBM may have released an open source compiler >http://www.sunsource.net/faq.html#Java > >Sheridan Saint-Michel >Website Administrator >FoxJet, an ITW Company >www.foxjet.com > > > >> Just one point Java is actually open source, because you can get >>the >> source code for the JVM. It is not GPL what means that if you want >>to >> make money with it you have to pay for it (but after all Sun is a >> bussiness, and bussiness are for making money). > >> Sean C. McCarthy >> SCI, S.L. (www.sci-spain.com) > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strstr Question
On Sun, 12 Aug 2001 18:42:48 -0500, Erich Zigler ([EMAIL PROTECTED]) wrote: >I am currently writing a piece of code that when a user enters in >their >email address it will check it for validity. > >In this instance they are supposed to type in [EMAIL PROTECTED] But if >they >just type in user I want it to add @domain.com at the end by >default. This >is the piece of code I have so far, but it does not seem to be >working... > >if (strstr($email, '@')) { >continue; >} else { >$email = $email . "@domain.com"; >} > >I've been all over the documentation but I am obviously missing >something. >If anyone could be of any assistance I would greatly appreciate it. continue is for loops, not if's. delete that line and it should work, or better yet: if (!strstr($email, '@')) $email.="@domain.com"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] ucwords Except 'The' 'And' etc?
>Something like this, perhaps (untested): I needed this too so I just tested it. >function smart_ucwords($String) >{ > > $ExceptionList = array('the', 'an', 'a'); # should all be in >lowercase > > $String = ucwords(strtolower(ltrim($String))); # LINE A > > foreach ($ExceptionList as $Word) > { > $String = eregi_replace("[[:space:]]+$Word[[:space:]]+", >$Word, $String); > } this line should be more like: $String = eregi_replace("([[:space:]]+)".$Word."([[:space:]]+)", "\\1".$Word."\\2", $String); > return $String; # LINE B > >} thanks! - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How give a 'timed' online quiz?
On Mon, 13 Aug 2001 17:06:37 -0400 (EDT), Daniel Adams ([EMAIL PROTECTED]) wrote: >Sounds like you could use javascript rather than php for this one. >Or you >could try using an http refresh after a certain number of seconds. > - Dan yeah but an http refresh won't post the form. you could try javascript or java but if it were me I'd play around with ming's flash functions and try to create a timer that shows how much time is left, and when time is up calls javascript:form.submit() >On Mon, 13 Aug 2001, Tom Henry wrote: > >> Hi >> >> Could someone steer me in the right direction for this one - I >>can't >> seem to see the forest for the trees. >> >> I want to be able to show the user a set of _quiz_ questions - and >> almost simultaneously (that part's not critical bit) start a >>_timer_ for >> the quiz session. >> >> The critical bit is that if the preset "time allowed" expires -- I >>need >> to interrupt the user, capture their answer up to that point in >>time, >> and send them to the examiner. >> >> Of course if they finish inside the time limit by submitting the >>quiz >> form - we would just kill the session. >> >> SO - how do I interrupt the user after a set period of time >> >> >> Thanks for any/all clues for this one. >> Tom >> >> >> > >-- > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] How to stop images preloading in netscape?
On Mon, 13 Aug 2001 23:16:35 +0100, Seb Frost ([EMAIL PROTECTED]) wrote: >I have a php page which generates a page of thumbnails from a >database. In >internet explorer all of the layout loads first, and the thumbnails >appear >one by one as they are downloaded. Netscape however seems to insist >on >downloading all images before displaying the page. This makes it >appear >very slow. How can I prevent this behaviour? > >cheers, > >seb use lowsrc and a low-res image. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Eval error
lots of things: 1) variables in single-quoted strings aren't evaluated so you don't need to escape the $ in $email 2) php uses . not + for concatenation. 3) try it like this: eval('$email = $email_'.$i.';'); or eval("\$email = \$email_$i;"); 4) you can save yourself the trouble by using arrays as field names: 5) RTFM! that's what its there for. On Wed, 15 Aug 2001 15:15:09 -0300, Felipe Coury ([EMAIL PROTECTED]) wrote: >Hi, > >I am a beginner in PHP and I am trying to do the following: I have a >form in >a page that has 3 fields: email_1, email_2 and email_3. I am trying >to send >e-mail to those people, if the fields are filled. Relevant part of >code: >for ($i = 1; $i <= 6; $i++) { >$eval = '\$email = \$email_' + $i + ';'; >eval( $eval ); >echo $email; >} >?> > >The code complains about an error in line eval( $eval );: > >Parse error: parse error in >/home/httpd/htdocs/hthcombr/cgi-local/envia.php(19) : eval()'d code >on line >1 > >Can anyone please help me? > >Regards, > >Felipe Coury > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: php-list- >[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] The future of PHP
On Fri, 24 Aug 2001 16:25:08 -0400, Thomas Deliduka ([EMAIL PROTECTED]) wrote: >Wait, you blame someone convicting microsoft for a recession? Give >me a break. Things were on the way out before it started. Was that the cause? Not really, there were many causes and that was just one of them. Was that when it started? Yes, that's the way I remember it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Best Way?
On Tue, 28 Aug 2001 11:35:33 -0400, Michael Kimsal ([EMAIL PROTECTED]) wrote: >So require them to have cookies turned on. If it's YOUR system, you >can require whatever you want. If this is something for your >company, >presumably >it's a business tool of some sort, and you can then require them to >do >whatever >you need to go get the job done. Yeah, you can't do much with cookies turned off these days anyway. Another way to do it is to use $PHP_AUTH_USER, it's easier (but not as pretty) and you won't have to worry about cookies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: how to sort search results by relevance?
On Wed, 29 Aug 2001 13:58:34 +0200, BRACK ([EMAIL PROTECTED]) wrote: >> In article <3B8A1D6A.4295.2947D@localhost>, [EMAIL PROTECTED] >> (Yura) wrote: >> >> > How to sort search results of php-mysql site by relevance? >> >> See the mysql manual's chapter on FULLTEXT indexes. > >I indexed column 'text' and tried to add "ORDER BY text DESC" in >query and deleted wildcards in front of variables but still it >doesn't >sort results by number of found words (or parts of words). Maybe I >didn't quite understand what to do? or maybe you didn't look up fulltext indexes :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] FULLTEXT search sorting results
On Sat, 1 Sep 2001 14:01:57 +0200, BRACK ([EMAIL PROTECTED]) wrote: >I have query - > >$res = mysql_query("SELECT >skits.*,category.cat_id,category.cat_name FROM skits,category WHERE >MATCH (title,descr,skits) AGAINST ('%$search_idea%') and skits.lang >like 'English' and skits.category like category.cat_id limit >$limit,10 "); > >I expect to get results sorted by relevance and it actually does BUT >(!) >inside of categories =( I mean it sorts result first by category and >second by relevance. How do I make it to be sorted by only relevance? try it like this: $res = mysql_query("SELECT skits.*,category.cat_id,category.cat_name,MATCH (title,descr,skits) AGAINST ('%$search_idea%') as relevance FROM skits,category WHERE skits.lang like 'English' and skits.category like category.cat_id having relevance>0 order by relevance desc limit $limit,10 "); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]