Re: [PHP] Why doesn't working with array's ever stick in my thick head?

2008-05-09 Thread Roberto Mansfield
Jason Pruim wrote: >> Why do you want tenth's of pounds? Just divide pounds by 16 and you'll >> get ounces. > > It's actually for a weight calculator that we use for some of our > mailings. when you take .226 and multiply that by 464 you get 104.864 > ounces. > > I need to be able to display that

Re: [PHP] Why doesn't working with array's ever stick in my thickhead?

2008-05-09 Thread Roberto Mansfield
Roberto Mansfield wrote: > (I'm assuming .226 is the cost per ounce and 464 is the total number of > ounces) It sure is Friday. This assumption doesn't make any sense! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Generating JavaScript menus on-the-fly

2008-03-10 Thread Roberto Mansfield
If you are building select menus on the fly using javascript, look at php's json_encode function. It will create a JSON representation of your php data structure. Makes "passing" data sets to javascript very easy. Just build your array of allowed options in php, plug the data into your javascript v

Re: [PHP] including files outside of document root

2008-01-23 Thread Roberto Mansfield
Daniel Brown wrote: > On Jan 23, 2008 2:50 PM, Roberto Mansfield <[EMAIL PROTECTED]> wrote: >> I tend to keep the directories in the document root, but I deny access >> via an .htaccess file. This keeps the code in a simple directory >> structure. Anyone else doing tha

Re: [PHP] including files outside of document root

2008-01-23 Thread Roberto Mansfield
Jason Pruim wrote: > >> Been doing some reading on security and have decided that I should be >> storing my include files outside of the document root... Which I >> understand how to do it, but what I'm wondering, is say I write the >> Next Killer App (tm). How would I port that code easily off of

[PHP] Re: [pcre] backreferences to all matches of a repeated subexpression

2007-08-03 Thread Roberto Mansfield
Jack Bates wrote: > I'm trying to pull all the components out of strings structured like: > word followed by any number of ( dot word or square bracketed string ) > > This is an example: foo.bar[ab.cd].baz > > From the above example, I want: array('foo', 'bar', 'ab.cd', 'baz'); > > A regular exp

Re: [PHP] Loss of precision in intval()

2007-08-02 Thread Roberto Mansfield
, the ridiculousness (probably not a word) of the example is > highlighted by the fact that 75.81 and 75.83 work perfectly. > > Roberto Mansfield wrote: >> Internally, 75.82 can't be stored exactly, so 75.82 * 100 is probably >> 7581.92 rather than the expected integer va

Re: [PHP] Loss of precision in intval()

2007-08-01 Thread Roberto Mansfield
Internally, 75.82 can't be stored exactly, so 75.82 * 100 is probably 7581.92 rather than the expected integer value of 7582. So intval is behaving properly. Sounds like you want intval(round($a)); [EMAIL PROTECTED] wrote: > Very weird and counter intuitive. Looking at the php manual, I see

Re: [PHP] If statement duplicating mysql records?

2007-06-21 Thread Roberto Mansfield
( $row[5] == "Level1" ) { // your commands } elseif ( $row[5] == "Level2" ) { // your commands } else { // your commands } This would work in the way you are thinking. Hope this helps your understanding. -- Roberto Mansfield Institutional Research and Application De

Re: [PHP] If statement duplicating mysql records?

2007-06-21 Thread Roberto Mansfield
Jason Pruim wrote: > > > The code I had worked out, originally was something along the lines of: > > if($row[5] =="Level1") ( > echo "$row[0] "; > echo "$row[1] "; > echo "Instructions"; > echo " href='update.php?taskid=$row[0]'>Click here!"; > } > > if($row[5] =="Level2"){ > e

[PHP] Re: If statement duplicating mysql records?

2007-06-19 Thread Roberto Mansfield
Jason Pruim wrote: > Okay, so I have a question... Probably pretty easy, but why would my if > statement show more records then what are in the database? > > if($row[5] =='Level4'){ // White Highlight > }// End of Level 4 > else > {// Green Highlight > }// End of Un

[PHP] Re: Removing a row from an Array

2007-06-04 Thread Roberto Mansfield
Can't you just unset() the values you don't want? Ken Kixmoeller -- reply to [EMAIL PROTECTED] wrote: > Hey - - - - - - -- > > To do this, I am: > > - looping through the array > - copying the rows that I want to *keep* to a temp array, and > - replacing the original array with the "temp' one

Re: [PHP] checkboxes problem

2007-06-01 Thread Roberto Mansfield
Richard Lynch wrote: > > On Wed, May 30, 2007 3:59 am, blueboy wrote: >> Hi, >> >> I have a checkbox array (about 20 lines) >> >> input name=\"box\" type=\"checkbox\" value=\"$id\"> >> input name=\"box\" type=\"checkbox\" value=\"$id\"> >> input name=\"box\" type=\"checkbox\" value=\"$id\"> >> >>

[PHP] Re: Make eclipse-php recognise custom extension as php ?

2007-04-27 Thread Roberto Mansfield
Don Don wrote: > Hi all, i've changed my server's apache config to recognize my custom > extension for php files. And all my development filenames now come > with this new extension. > > However my IDE (Php Eclipse) will not recognise this new extension as > a php file, even though it opens it up

[PHP] Re: breakthrough: get record, insert on different table works

2007-04-26 Thread Roberto Mansfield
Thufir wrote: > it ain't pretty, but it's like a sugar rush! Finally, able to enter data on > forms which I can create :) > [snip] > > Any thoughts/suggestions/advice as a next step? I need to add a timestamp > when > the data's entered, but that's a small thing. This is adding notes onto > c

[PHP] Re: downloading an image

2007-04-11 Thread Roberto Mansfield
Verify that your $type is a correct mime type. Ross wrote: > tthe image does not display although it exists in the table 'images' > > > This calls the download script > > > $property_id = $_SESSION['property_id'] ; > $query = "SELECT * FROM images WHERE property_id='$property_id'"; > $resu

Re: [PHP] Link to download files on another part of system

2007-03-29 Thread Roberto Mansfield
Only do this if all the files should be publicly accessible. Otherwise, you'll need to create a php wrapper to do authorization before sending the file. -Roberto Rahul Sitaram Johari wrote: > Ave, > > I¹m going to try creating the sharepoint within my webserver, as suggested > by you and tijnem

Re: [PHP] Show Filename using Wildcards

2007-03-29 Thread Roberto Mansfield
Also, you should validate the phone number (make sure it contains only numerical digits) before using it on the command line. I wouldn't trust the data to build a command line. -Roberto Rahul Sitaram Johari wrote: > ;) > > Point taken! > > exec("find /Users/rjohari/Documents/XFER/espi

Re: [PHP] Date/time format?

2007-03-29 Thread Roberto Mansfield
Jason Pruim wrote: > Thanks everyone for your suggestions, it turns out it was a unix time > stamp and I can get it to parse out a normal date now. > > Now... on to the harder part > > What I am trying to do is learn... This is kind of just a pet project > for me to figure out how I can do it

[PHP] Re: Oracle XMLTYPE column truncates

2007-03-08 Thread Roberto Mansfield
Mikey wrote: > Roberto Mansfield wrote: >> Hi Mikey, >> >> OCI doesn't directly support the XMLtype so you need to convert to >> string (if < 4k) or clob before retrieving. Use: >> >> select xml_metadata.getClobVal() ... OR >> select xml_metadat

[PHP] Re: Oracle XMLTYPE column truncates

2007-03-08 Thread Roberto Mansfield
Hi Mikey, OCI doesn't directly support the XMLtype so you need to convert to string (if < 4k) or clob before retrieving. Use: select xml_metadata.getClobVal() ... OR select xml_metadata.getStringVal() ... If converting to clob, you get a clob object back and you'll need to run the load() method

Re: [PHP] problems with thumbnail image

2007-03-02 Thread Roberto Mansfield
> I have used this method for generating the thumbnail images. I avoided > creating the thumbnails and saving to the disk as the images change very > frequently. > > Thank you so much for helping me with this one:)) > > regards > Punit Neb The problem is that your function generates thumbnail

[PHP] Re: Error handling

2007-03-01 Thread Roberto Mansfield
Chris Ditty wrote: > I am trying to add some error handling to my code. Instead of > reinventing the wheel, I searched and found the code below. For the > most part, it seems to work. When I have an error, it doesn't get > shown. However, I don't get any output. I tracked it down to the > $err

Re: [PHP] Eregi error

2007-03-01 Thread Roberto Mansfield
Myron Turner wrote: > M.Sokolewicz wrote: $pattern = '^[a-z0-9\!\_ \.- ,/]*$'; if(!eregi($pattern, $input)){ > > the problem is that the hyphen is interpreted as regex range operator: > [a-z0-9\!\_ \.- ,/] > Rewrite this as >

[PHP] Re: [X-POST] PHP script to make sure MySQL is up?

2007-03-01 Thread Roberto Mansfield
Brian Dunning wrote: > I host at Rackspace, and one thing that their monitoring service does > NOT catch is a problem when too many connections hit MySQL, and for some > reason it remains hung up until the service is manually restarted. In > the meantime, this is happening to us once or twice a mon