RE: [PHP] Round

2007-08-29 Thread PHP-Gen
I believe there is some confusion on what ABS actually does. Ignoring all the rounding that you are trying to do ABS is a very simple function. ABS definition: Returns the absolute value of number. What that means is. Abs(1) = 1 Abs(2) = 2 Abs(3) = 3 Abs(0) = 0 Abs(-1) = 1 Abs(-2) = 2 Abs(-3)

[PHP] Zend Enc and 0T Q

2004-07-21 Thread PHP Gen
Hi all, Our company has decided to encrypt the php programs that we sell, I have to choose which encryption package to buy. After a lot of seaching (on this list(archives), google, forums etc) I saw a quite a few products like ioncube, zend, codesecure, blender, mmCache encryptor etc etc

Re: [PHP] Zend Enc and 0T Q

2004-07-21 Thread PHP Gen
Hi, Thanks for replying. And the loss is entirely theirs. MMache really can take a load of your webserver. True, but its easier to tell a webhosting company to install a Zend product as they are the maker of PHP blah blah than to tell them to install an untrusted 3rd party app like mmCache.

Re: [PHP] Zend Enc and 0T Q

2004-07-22 Thread PHP Gen
--- raditha dissanayake [EMAIL PROTECTED] wrote: PHP Gen wrote: how about using SSH tunneling instead. Never tried it, any examples for a win2k pro machine? There are some tutorials on this topic search term may be 'ssh tunnel howto' you do need to have an SSH client

[PHP] RSS and your opinion needed.

2004-07-23 Thread PHP Gen
Hi, Some time back I came on the list and asked your advise for a class that gets RSS feeds from diff sites, I got quite a few good sites and a particular class that was really good. Unfortunatly I lost it in a webhost change but here is what it did: It got the feed and cached it for a day (or two

[PHP] Include path

2004-07-23 Thread PHP Gen
Hello, I am a bit confused :-(, this is my server path: /home/sites/site80/web/articles/myfile.php from myfile.php I want to include header.php which is located in: /home/sites/site80/web/templates/ /* eg: /home/sites/site80/web/articles/myfile.php /home/sites/site80/web/templates/header.php

RE: [PHP] Include path

2004-07-23 Thread PHP Gen
--- Jay Blanchard [EMAIL PROTECTED] wrote: [snip] /home/sites/site80/web/articles/myfile.php from myfile.php I want to include header.php which is located in: /home/sites/site80/web/templates/ /* eg: /home/sites/site80/web/articles/myfile.php

Re: [PHP] Include path (SOLVED)

2004-07-23 Thread PHP Gen
Hey everyone, ** Have you tried $_SERVER['DOCUMENT_ROOT'].'/'; ** Matt, DAMN! THATS what I was looking for. No, didnt try that, took the long route home instead, but atleast brushed up on php's explode function. ** $baseDir = $_SERVER[DOCUMENT_ROOT]; $templatesDir = $baseDir . /templates/;

[PHP] Learning Regex

2004-07-24 Thread PHP Gen
Hi, Does anybody know of a good place to learn how to work with regex? Google has quite a few links for learn pattern matching or learn php regex but none that start you on baby steps. Any recommendations? Thnx, Mag = -- - The faulty interface lies between the chair and the keyboard.

Re: [PHP] Re: Learning Regex

2004-07-25 Thread PHP Gen
This helped me get started with Perl-compatible regular expressions: http://www.weitz.de/regex-coach/ Thanks Jason, will try it immd. Cheers, Mag. = -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile,

[PHP] class help (PLEASE)

2004-07-25 Thread PHP Gen
Hi, After searching the archives and google I found a class that does bb code conversions, although I know how to use classes (thanks to the docs the writers write) I dont really understand them too well. The class is REALLY good and covers all my needs (which is to display php code in colors)

Re: [PHP] Re: class help (PLEASE)

2004-07-25 Thread PHP Gen
--- Jason Barnett [EMAIL PROTECTED] wrote: No offense intended, but I'm not going to read through all of that. Narrow down the code block that gives you problems and then post that one block here... not the entire class. Hey Jason, No offense at all taken, am happy you read part of my

Re: [PHP] Re: class help (PLEASE)

2004-07-25 Thread PHP Gen
Thanks, Will first try learning RegEX then will move onto classes ore again will have problems in the future. Will screw around with the class and see what happens but if you do figure it out, please drop me a line. Thanks, Mag --- Jason Barnett [EMAIL PROTECTED] wrote: Hey Jason, No offense

[PHP] Using htaccess to show diff dir (0T)

2004-07-27 Thread PHP Gen
Hi, instead of showing my index.php page located at / I want to show my index.html page located at /cached/ but I dont want to use javascript as the clients JS might be off...and I dont want to get blacklisted by the search engines for redirecting... I did read somewhere that you can redirect via

[PHP] RE[PHP] Using htaccess to show diff dir (0T) (SOLVED)

2004-07-27 Thread PHP Gen
Hey, Dont worry about it, found it: http://www.thinkhost.com/services/kb/301-redirect.shtml Thanks, Mag = -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-)

Re: [PHP] Replace a button by an image

2004-07-30 Thread PHP Gen
Jay Blanchard wrote: Yes, anything is possible. Can I be the next Queen of England? -- John C. Nichel Anythings possible...and with all your choices you want to be an old fart?? :-) = -- - The faulty interface lies between the chair and the keyboard. - Creativity is

[PHP] str_replace: use multiple or array?

2004-07-30 Thread PHP Gen
Hi, I need to use a couple of str_replace's in one of my programs and would like to know which is more resource friendly: 1) having multiple str_replace one after another eg: $text = str_replace(orange, apple, $text); $text = str_replace(black, white, $text); $text = str_replace(girl, guy,

Re: [PHP] multiple checkboxes

2004-08-02 Thread PHP Gen
--- John Nichel [EMAIL PROTECTED] wrote: Like I had a shot in hell of getting the answer in first with John and Curt trolling the list. ;) Yep, those two guys are the highrollers here...also known as the big guns so when they are aroundI keep my little pistol voice out of it :-) Not

[PHP] Confused...need some programming logic

2004-08-04 Thread PHP Gen
Hi, I have 13 folders with a few thousand images each, now the client wants me to export the gallerys to another server that does not run phpso he wants plain .htm files. Below is how far I have come to porting this... the idea being: generate .html files then simply copy the images folders

Re: [PHP] Confused...need some programming logic

2004-08-04 Thread PHP Gen
--- Justin Patrin [EMAIL PROTECTED] wrote: 4: put 100 img tags to call 100 images per page (confused here) I put some code inline below. Should work. If you want a thumbnail gallery, you could also create thumbnails using the GD functions in PHP, same them, and create an img tag with

Re: [PHP] Confused...need some programming logic

2004-08-04 Thread PHP Gen
Hey, Just change the echo to an fwrite. for($j = 0; $j 100; ++$j) { if($pics[$i * 100 + $j]) { fwrite($handle, 'img src='.$pics[$i * 100 + $j].'/br/'); } } Works like a charm, thanks a million. -Mag = -- - The faulty interface lies between the chair and the keyboard. -

[PHP] Write text on imge...AND save it to disk..

2004-08-04 Thread PHP Gen
Hi, Have very little of idea of the GD functions (and dont ahve imagemagik) so am having problems 1. I need to read all the images from a dir and write something on it at the bottom right side of the picture 2.save this image in a diff folder keeping the originals as is. I have worked out

Re: [PHP] Write text on imge...AND save it to disk..

2004-08-04 Thread PHP Gen
--- Jason Wong [EMAIL PROTECTED] wrote: On Thursday 05 August 2004 10:36, PHP Gen wrote: Have very little of idea of the GD functions (and dont ahve imagemagik) so am having problems So RTFM. I *DID* RTFM, just am more confused after doing so, did you read my post or did you

Re: [PHP] Write text on imge...AND save it to disk..

2004-08-04 Thread PHP Gen
Big clue: look up each of the image*() functions used in your class and find out what they do. Arn't you the genius? I dont know if you read my older posts (around 2-3 days ago) when I asked if someone could recommend a good place to learn about PHP classes... Still learning and still

Re: [PHP] Write text on imge...AND save it to disk..

2004-08-04 Thread PHP Gen
Hey, Here's another big clue: have a look at the section of the class which does the output. I did, but forget it, I got another answer from Wudi that is far more helpful and I think a starting point. I guess knowing the answer and still playing games makes you feel all powerful, to each

[PHP] sorting an array..dont know numeric or alpha-numeric

2004-08-06 Thread PHP Gen
Hi, I have a function that reads jpg files (thumbnails) from a directory and puts all the files names into an array...I want to sort that array by the filename, problem is, I dont know if filenames will be pure numeric (eg 001.jpg,002.jpg) or alpha-numeric (asdf001,asdf002) It HAS to be

Re: [PHP] sorting an array..dont know numeric or alpha-numeric

2004-08-06 Thread PHP Gen
Hi Curt, Damn, looks like I (unintentionally) gave you guys quite a challenge! You're the first one to reply and looks like you sure worked on it! For starters, if your going to provide some code, make sure its readable by others.. trying to figure out what it is doing is nearly impossible

[PHP] regex help and file question

2004-08-07 Thread PHP Gen
Hi, I am just starting out with regex (and classes) so am not sure how to do this... I am seeing if a HTML file exists, if yes, I am using file_get_contents to get the entire HTML file into a string. In the HTML file I already have this: !-- Start header -- html body whatever you want comes

[PHP] Flush()....go to bottom of page (might be 0T)

2004-08-07 Thread PHP Gen
Hi, I am using flush() and ob_flush() in one of my scripts and its working great.., just one problem, as it keeps outputting x on the screen the page just stays on top...is there anyway (I am not sure via php...but maybe JavaScript? ) to make the browser follow the output below eg: keep the

Re: [PHP] Re: regex help and file question

2004-08-07 Thread PHP Gen
Hi, I can't answer your regexp question but some thoughts on file() etc.: - file() returns the contents line by line as an array, so this makes only sense if you need the contents in this form, e.g. for looping through each line and applying a function or whatever - fread() requires a

Re: [PHP] Flush()....go to bottom of page (might be 0T)

2004-08-07 Thread PHP Gen
--- John Holmes [EMAIL PROTECTED] wrote: PHP Gen wrote: Hi, I am using flush() and ob_flush() in one of my scripts and its working great.., just one problem, as it keeps outputting x on the screen the page just stays on top...is there anyway (I am not sure via php...but maybe

[PHP] urlencode - urldecode

2004-08-08 Thread PHP Gen
Hi, I am using a header(location:) to send a rawurlencod'ed string to another script...then I tried decode it and use those values...but its not working... snippets of my code: // sending file:

Re: [PHP] urlencode - urldecode

2004-08-08 Thread PHP Gen Newbie
Hi, Thanks again John, point taken...will not trust the browser, will use sessions :-) Cheers, -Mag --- John Holmes [EMAIL PROTECTED] wrote: PHP Gen wrote: // sending file: $one=rawurlencode(dir_name=$dir_nameimgs_dir=$imgs_dirthumb_pre=$thumb_pretn_width=$tn_widthtn_height