Re: [PHP] Question About Blocking Email Addresses in Forms

2008-01-18 Thread Silvio Porcellana
Javier Huerta wrote: I am wondering if there is a way to block out email addresses in specific format from a form? We ahve a form that people have to enter an email address, and the form has been getting used by bots to send spam to a listserv. The email address they enter is in this type of

Re: [PHP] DESC order results

2008-01-13 Thread Silvio Porcellana
$query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo DESC'; If you want just one record: $query = 'SELECT * FROM eChart WHERE clientNo = "2" ORDER BY ChartNo DESC LIMIT 0, 1'; BTW, you'd better ask the MySQL mlist: http://lists.mysql.com/ HTH, cheers Silvio -- PHP Genera

Re: [PHP] mysql date question

2008-01-03 Thread Silvio Porcellana
Uhm, a shot in the dark - try: select date_format(contract.length_start, '%m-%d-%Y') as length_start HTH, cheers! Silvio Adam Williams wrote: I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which s

Re: [PHP] Comparison Problems with 5.2.5

2007-12-30 Thread Silvio Porcellana
Magnus Anderson wrote: ...snip... This will not work (I expect this to work since _USER['level'] is 5) if($_USER['level'] => 5) Try if($_USER['level'] >= 5) maybe it helps ('=>' is used when assigning values in an hash, maybe you are triggering something strange...) -- Antinori and Partn

Re: [PHP] is_prefix() - checking wheather $A is prefix for $B

2007-12-29 Thread Silvio Porcellana
You should benchmark and tell us - anyway, just looking at the code, I'd say 'is_prefix2()' is faster since there's 1 function call instead of 2 AmirBehzad Eslami wrote: In case you haven't realized it, I have already written two functions to check for a prefix !! The question is: Which functi

Re: [PHP] Getting The Document Root

2006-02-02 Thread Silvio Porcellana [tradeOver]
Jeremy Privett wrote: I'm looking for a method that would be able to extract the user's true document root (e.g. /home/jeremy/public_html/) so that I can use it for some filesystem scanning functions. I'm trying to avoid hard-coding supported document roots in favor of being able to dynamically

Re: [PHP] PHP hosting with multiple domains?

2006-01-30 Thread Silvio Porcellana [tradeOver]
[EMAIL PROTECTED] wrote: hah.. I'll stop now. Think you get the idea. The convenient management of multiple domains with a hosting provider is my ultimate goal. Go with http://www.hub.org I've got a couple of domains with them - and I think they are great. Silvio -- tradeOver | http:/

Re: [PHP] Regular expression

2006-01-30 Thread Silvio Porcellana [tradeOver]
Barry wrote: Simple reg help please i want to match the last "," in "a,b,c,d" and replace it with " and " Without using a regexp, you could do: $string = 'a,b,c,d'; $letters = explode(',', $string); $last_letter = array_pop($letters); $final_string = implode(',', $letters) . ' and '

Re: [PHP] PHP 5 Backwards Compatability

2006-01-30 Thread Silvio Porcellana [tradeOver]
Tod Thomas wrote: Is their a list of portability problems to be aware of when switching from v4 to v5? Maybe a table that compares the two? Thanks. You can start here: http://www.zend.com/php5/migration.php Silvio -- tradeOver | http://www.tradeover.net ...ready to become the King of the

Re: [PHP] How can I get ENUM values from column info?

2006-01-29 Thread Silvio Porcellana [tradeOver]
[EMAIL PROTECTED] wrote: If I have columns type ENUM('live', 'hidden', 'pending'), $flags will show ONLY 'enum'. How can I get all ENUM values? Thanks for any help or direction. -afan This doesn't really seem a PHP question... BUT... give a look here: http://dev.mysql.com/doc/refman/5.0/en/

Re: [PHP] query problem.

2006-01-24 Thread Silvio Porcellana [tradeOver]
Angelo Zanetti wrote: (...) Why does the < > cause that not to be displayed? or is it retrieving it correctly but not showing it because of the < > (which might be conflicting with HTML tags? When showing things in an HTML page it's always a good idea to use 'htmlspecialchars' (or htmlenti

Re: [PHP] Re: hiding the index.php page.

2006-01-23 Thread Silvio Porcellana [tradeOver]
Barry wrote: Gregory Machin wrote: Hi I would like to know how i would hide my index page so that it is not shown at the end of the url like how gmail does it and many cms do it .. And what is it called when one does this .. Thank you If you use Apache, what you are looking for is probably

Re: [PHP] getting list of files included

2006-01-20 Thread Silvio Porcellana [tradeOver]
Diana Castillo wrote: does anyone know of a command in php that will give you a list of the files already included . Something that would tell you whether a file is already included before you do the require_once ? Try this: http://php.net/manual/en/function.get-included-files.php Oh, and

Re: [PHP] adding script

2006-01-20 Thread Silvio Porcellana [tradeOver]
Ross wrote: This was a page I did ages ago http://www.ecurry.net/menu2.php The problem with it is when you add or subtact an item is it always button press behind. This must be because of the way the page self submits or something? The script is here http://www.ecurry.net/calculat

Re: [PHP] date("H", $datevalue) always adds an hour?

2006-01-20 Thread Silvio Porcellana [tradeOver]
David Grant wrote: Murray, I can't think what else it might be. Sorry! David What does date("I", $datevalue) return? (it's a capital 'i') I guess you already checked out this page... http://php.net/date -- tradeOver | http://www.tradeover.net ...ready to become the King of the World? --

Re: [PHP] input validation?

2006-01-12 Thread Silvio Porcellana
William Stokes wrote: > Hello, > > I need to check that user input text is less than 300 characters long. How? > > Thanks > -Will > Try with strlen: http://php.net/strlen Silvio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] fopen/fwrite and owner/group settings

2006-01-05 Thread Silvio Porcellana [tradeOver]
Mathijs wrote: > Hello there, > > I Have a problem with some file writeing. > > I Use fopen to create a new file, but that file gets the owner and group > the same as the apache owner and group. > > How can i change it so that the file gets the same owner/group as the > files i upload with FTP?

Re: [PHP] Access Client IP address

2006-01-04 Thread Silvio Porcellana [tradeOver]
Nilanjan Dasgupta wrote: > Hi, > Is there any way to client's IP address inside a php document. I am > trying to generate a code that depends on the IP address of the client. > > thanks a lot, > Nilanjan > Give a look at $_SERVER, and more specifically $_SERVER["REMOTE_ADDR"] http://php.net/

Re: [PHP] forms

2006-01-03 Thread Silvio Porcellana [tradeOver]
Mark wrote: > Hi can any one show me how make another form appear below another once the > 1st form has been submitted. > [not really a PHP solution...] You can do like this: the 'SUBMIT' button of the first form only makes visible the (hidden) DIV where the second form is, and only *that* 'SUBM

Re: [PHP] XML Reader

2005-12-29 Thread Silvio Porcellana [tradeOver]
[EMAIL PROTECTED] wrote: > Is there any easy php script to run to view an xml file such as new > headlines like so: http://news.google.com/?output=rss or can anyone point > me in the right direction for good online tutorials or books. > You can start here: http://magpierss.sourceforge.net/ Magp

Re: [PHP] Earlier versions hurt PHP 5

2005-12-29 Thread Silvio Porcellana [tradeOver]
Anas Mughal wrote: > Here is a PHP5 hosting company: > http://www.a2hosting.com/ > Aaargh! I wouldn't suggest that one, I've had a really really bad experience with them (they shut down my site *w/o any notice* because they said I was using too much of their resources - while this was not true).

Re: [PHP] Location ....

2005-12-28 Thread Silvio Porcellana [tradeOver]
Christian Ista wrote: > Hello, > > Could you tell me a efficient solution for change page (new location) in > PHP? I tried this code : header("Location: mypage.php"); > note: HTTP/1.1 requires an absolute URI http://php.net/header > But in some case, I have error message "heade already send". T

Re: [PHP] mutiple file upload

2005-12-21 Thread Silvio Porcellana [tradeOver]
Ross wrote: > Hi, > > I am trying create a multiple file upload to a mysql server. > Google is your friend... http://www.google.com/search?hl=en&q=multiple+upload+php&btnG=Google+Search And, by the way, if you are uploading and storing images in your MySQL DB, you might want to consider that th

Re: [PHP] gdf fonts

2005-12-21 Thread Silvio Porcellana [tradeOver]
Adrian Bruce wrote: > Hi > > Does anyone know where i can get some decent gdf fonts for using in the > imageloadfont() function, i have found some on the net but they are all > a bit naf so far. I'm really just looking for something like Arial or > verdana. Im creating pie charts on the fly but

Re: [PHP] Filtering URLs problem..

2005-12-20 Thread Silvio Porcellana [tradeOver]
Anders Norrbring wrote: > > I'm writing a filter/parsing function for texts entered by users, and > I've run into a problem... > What I'm trying to do is to parse URLs of different sorts, ftp, http, > mms, irc etc and format them as links, that part was real easy.. > You might want to consider u

Re: [PHP] Problem with fopen and sending POST vars

2005-12-20 Thread Silvio Porcellana [tradeOver]
Barry wrote: > Hello everyone! > > I have a problem sending POST vars via fopen. > It was possible for me to send some xml data but that's all. > > Anyone know how to send POST vars? > Big probleme here is also that i have to connect via SSL. > cURL can be your friend... http://php.net/curl ht

Re: [PHP] Passing $_POST values to a php script

2005-12-19 Thread Silvio Porcellana [tradeOver]
Jay Blanchard wrote: > [snip] > I am trying to develop a testing framework for a bunch of php scripts. These > > files expect various kinds of data from the $_POST array. They work fine > when invoked from the browser. > > But I am wondering if I can programmatically pass these values so that I

Re: [PHP] Re: [Bulk] Re: [PHP] PHP errors in Apache error logs

2005-12-19 Thread Silvio Porcellana [tradeOver]
Jose Borquez wrote: > I installed PHP from the ports and did not do any configuration. I set > up the phpinfo page and the configuration line did not set disable session. > > Thanks in advance, > Jose > Maybe you have this: '--disable-all' (not sure, thou, this should enable sessions anyway, II

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Silvio Porcellana [tradeOver] wrote: > > > $file = "images.txt"; > $openFile = file($file); > $num_images = 10; > # don't need this is PHP > 4.2.0 > srand((float) microtime() * 1000); > $random_keys = array_ran

Re: [PHP] Random Images with no duplicates?

2005-12-18 Thread Silvio Porcellana [tradeOver]
Jared Williams wrote: > Hi, > Just unset the ones you've picked > > #random images example > #this is your file > $file = "images.txt"; > #open the file > $openFile = file($file); > #generate a random number > srand((double)microtime()*100); > #get one of the entries in the file > for

Re: [PHP] XSS via curl

2005-11-30 Thread Silvio Porcellana [tradeOver]
Sandy Keathley wrote: > > Is there a way to detect that a script is being accessed by curl, and > not by a browser? ENV ($_SERVER) variables won't work, as > those can be forged. > Use a CAPTCHA test: http://en.wikipedia.org/wiki/Captcha HTH, cheers! Silvio -- tradeOver | http://www.tradeo

Re: [PHP] Help with logic :(

2005-10-11 Thread Silvio Porcellana
[EMAIL PROTECTED] wrote: > > include ("../utils.inc"); > > $date = date("U"); > $dateExpire = $date + 90 * 86400; > > $code = "jack"; > > $query = "INSERT INTO CouponTable VALUES > ('','$date','0','$code','preset','$dateExpire','3.75')"; > > $result = mysql

Re: [PHP] Run a php script as a separate thread/process

2005-10-11 Thread Silvio Porcellana
Tommy Jensehaugen wrote: > > > > The reason why I want to do this is because separate_script.php has to be > fully executed even if the request for example.php is stopped in the middle > of "more logic". > I am using PHP Version 4.3.11. > You might also want to give a look at this: http://php

Re: [PHP] Handling competing edits in a wiki engine?

2005-10-04 Thread Silvio Porcellana
Murray @ PlanetThoughtful wrote: > > Out of curiosity, does anyone know if it's possible to tell whether an > individual session is still alive from PHP? I don't mean from within > code being run for a particular user, but in code that, for example, > might be executed by a cron job, which would e

Re: [PHP] Array Select from database

2005-09-28 Thread Silvio Porcellana
A.J. Brown wrote: > > [code] > $values = join(', ', $array); > $query = "SELECT * FROM client WHERE clientaccountmanager IN ('$values')" > [/code] > Actually this doesn't seem right, the join should be: $values = join("', '", $array); # notice the ' inside the " In addiction, I would (SQL)escape

Re: [PHP] Array - partical path to the array's path....

2005-09-27 Thread Silvio Porcellana
Scott Fletcher wrote: >What I want this to work instead is >[code] > $array = array(); > > $array['col1']['col2'] = "Test #1"; > $array['col3']['col2'] = "Test #2"; > > $prefix = "['col3']['col2']"; > > echo $array.$prefix; //Spitted out result as "Test #2"... >[/code] > > Try something li

Re: [PHP] Pre global configuration

2005-09-27 Thread Silvio Porcellana
Jake Gardner wrote: > This is a stretch and I doubt you can do this very easily, but I was > wondering if there is a way to define behaviors that happen throughout > a script before execution for example if the OS is windows, all > strings are terminated with \r\n, if Linux, then \n without adding

Re: [PHP] variable instant value

2005-09-27 Thread Silvio Porcellana
FSA wrote: > Hi all, i have a question :), i need to display the instant value of a > variable (think at a variable that stores the interface trafic at one > moment) in browser, without having to refresh browser. I was wondering > if i can do that with php (not perl, cgi, etc). > If i missed someth

Re: [PHP] mysql/php date functions..

2005-09-26 Thread Silvio Porcellana
Jim Moseby wrote: > > Hi Bruce! > > MySQL and PHP both have extensive built-in date functions that are clearly > documented and extraordinarily easy to use. For the vast majority of > situations, there is no need to manually write any custom date-handling > code. The decision to use MySQL or PHP

Re: [PHP] new ways to add an html body?

2005-09-25 Thread Silvio Porcellana
Ross wrote: >Hi, > >I am using php mailer and am trying to find a new way to make the html email >body instead of the old > > $mail_body = " src=\"my_logo3.gif\" width=\"100\" height=\"139\">"; > $mail_body .= ""; >$mail_body .= "sans-serif\">$mail_text "; >$mail_body .= ""; >$mail_b

Re: [PHP] selfreferencing script with output

2005-09-25 Thread Silvio Porcellana
Sabine wrote: > Thanks you very much Silvio, for your answer. > Yes, it seems to be complicated. Especially regarding the time I have > to do the programming for this part of my work. > Now I reduced the time the preparing of the mailtext needs and hope > for the moment that the servers time my sc

Re: [PHP] selfreferencing script with output

2005-09-25 Thread Silvio Porcellana
Sabine wrote: > Thanks for your answer, Gustav, > > now I see I didn't explain good enough what my problem is. > My problem is not how to construct a status bar, but not it is > possible to provide any output before the headering (*Warning*: Cannot > modify header information - headers already sen

Re: [PHP] Connecting To Multiple MySQL Databases

2005-02-07 Thread Silvio Porcellana
Richard Lynch wrote: > > Actually, you want a few SPARE MySQL connections, so you can use the mysql command line monitor to do things -- Particularly in case of a run-away PHP/MySQL script which slams the server into over-drive... If you don't have a connection available cuz they're all used up b

Re: [PHP] Multiple permisions, different sessions.

2004-10-22 Thread Silvio Porcellana
also "edit" permissions, kinda like the ones you have on files on Linux): anyway, I hope it helped a bit. Silvio Porcellana Pablo D Marotta wrote: Hi, I´m developing an intranet on Apache-PHP-Mssql. I need to know if there´s any way of managing users to have access to specific area

Re: [PHP] File Copy

2004-10-20 Thread Silvio Porcellana
; the file with 'ftp_fput()' [http://php.libero.it/manual/en/function.ftp-fput.php]. That is, he opens the files he wants to copy and PUTs it via this function. Since he is logged in - using 'ftp_connect()' and 'ftp_login()' - the files will be owned by the user he used to l

Re: [PHP] File Copy

2004-10-20 Thread Silvio Porcellana
HP FTP functions. Check out these pages: http://php.libero.it/manual/en/ref.ftp.php HTH, cheers! Silvio Porcellana -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] str_replace problem

2004-10-20 Thread Silvio Porcellana
($ArrayName); ?<>/pre<>? This is what you are asking PHP to do. Actually - to achieve this - it would be better to use the 'htmlspecialchars()' function [http://php.libero.it/manual/en/function.htmlspecialchars.php] Anyway, probably I didn't understand what you want from your code... Cheers! Silvio Porcellana -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Add to regex help

2004-10-19 Thread Silvio Porcellana
Uhm, I guess you are looking for links (following a 'href') in your HTML page, so why don't you just do something like: preg_match_all('/href=[\"\']?([^\"\'>\s]*)[\"\']?/i', $url, $matches) (note the '\s' added inside the bracket that should match the link, as you could have: - that is, a link "

Re: [PHP] how to create multiple selects within php

2004-10-18 Thread Silvio Porcellana
br> function check_form(form) {<br> if (form.foo.value == '') {<br> alert("C'mon!!!");<br> return false;<br> }<br> }<br> and in your HTML you need to add something like this to the tag: Anyway, this has more t

Re: [PHP] Searching My Database

2004-09-29 Thread Silvio Porcellana
I don't think this is the best list to ask questions about SQL, try http://lists.mysql.com Cheers! Silvio Porcellana Harlequin wrote: Morning everyone. I've read around the subject of searching and although using the FULLTEXT capability of MySQL might be the proper way of doing this I

Re: [PHP] Multiple pages of data.

2004-09-29 Thread Silvio Porcellana
You can solve it totally with SQL, using the FOUND_ROWS() function [http://dev.mysql.com/doc/mysql/en/Information_functions.html] I think this is the most efficient way of doing it... HTH, cheers Silvio Porcellana Nick Patsaros wrote: I'm trying to build a bulletin style system right no

Re: [PHP] Setcookie doenn't work

2004-09-24 Thread Silvio Porcellana
> > $ok = setcookie("client_id", "argh", 259300); //* expire in a month ish > Nope, it expired a long time ago... :-) Read the manual for setcookie: http://php.libero.it/manual/en/function.setcookie.php (mainly the part about the "expire" parameter) HTH, cheers Silvio -- PHP General Mailing Lis

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Silvio Porcellana
ould get 'three') all you have to do is: $out[1][1][1] => 14 Just my .2 euros... Silvio Porcellana - Original Message - From: "Brian Dunning" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 22, 2004 5:54 PM Subject: [PHP] Split h