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 my

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 that? My fear

[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

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\ I do some client side checking with

[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.

[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

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 TRTD bgcolor=.$Level1.$row[0] /td; echo td bgcolor=.$Level1.$row[1] /td; echo td bgcolor=.$Level1.A href='$row[2]'Instructions/A/td; echo TD

Re: [PHP] If statement duplicating mysql records?

2007-06-21 Thread Roberto Mansfield
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 Development (IRAD) SAS Computing -- PHP General Mailing List

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] Loss of precision in intval()

2007-08-02 Thread Roberto Mansfield
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 value of 7582. So intval is behaving properly. Sounds like you

[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 expression

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

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 as: 6 #

[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 month.

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: 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 $errno.

[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

[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_metadata.getStringVal() ... If converting to clob, you get a clob object

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. here

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! ?php exec(find /Users/rjohari/Documents/XFER/espi

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 tijnema.

[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'; $result =

[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

[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 but