[PHP] Re: Sorting an array by value length.

2003-10-22 Thread Justin Patrin
You want to use usort, which lets you specify a comparison function. function cmpByLength($a, $b) { return strlen($a) > strlen($b); } usort($arrayToSort, 'cmpByLength'); And change the '>' to '<' if the ordering is wrong. Rolf Brusletto wrote: Hey all - I've been scouring the php.net site for

[PHP] Re: Check mysq_field_type, display appropriate FORM element

2003-10-22 Thread Justin Patrin
I'm working on a general purpose database data editor in PHP which can allow users to edit what you want and also knows about linked record with no extra coding. I was planning on putting this kind of field typing and type checking in my code, but haven't gotten around to it yet. If you're inte

[PHP] Re: get user attributes php/ldap/win2k active directory

2003-10-23 Thread Justin Patrin
n"; } If you need an LDAP Browser, I suggest Softerra LDAP Browser. It's very nice for finding OU's and such. Justin Patrin Redmond Militante wrote: hi all my first email to the list re: php/ldap/win2k AD garnered no responses. i've got most of the problem solved, ho

Re: [PHP] usort

2003-10-27 Thread Justin Patrin
No need to write your own function, it's already in PHP. :-) What you're looking for it natsort(). It uses natural order string comparison (which takes into account numbers instead of just using characters like a regular search does). There are also lots of other 'nat' functions, such as strnat

[PHP] Re: Post variables and mysql queries

2003-10-27 Thread Justin Patrin
$query='Select * from users where userid="'.$_POST['userid'].'"'; I tend to use single quotes whenever I can and to use concatenation instead of using in-string variables. I do this for three reasons. The first is efficiency. Strings surrounded by single chars are not parsed for any values, suc

[PHP] Re: eregi function?

2003-11-25 Thread Justin Patrin
Jas wrote: Not sure how to do this but I have a call to a database which pulls the contents of a table into an array and I need a eregi string which will sift through the contents and put a line break (i.e. \n or ) after each ";", "}" or "{". here is what I have so far... while($b = mysql_fet

Re: [PHP] trim...

2003-11-26 Thread Justin Patrin
trim also gets rid of leading spaces... Mike Ford wrote: On 26 November 2003 16:59, [EMAIL PROTECTED] contributed these pearls of wisdom: Why doesn't this work...? $body = " blurb blah happy days end of text"; $body = trim($body); $body now should output: "blurb blah\nhappy days\nend of text"

[PHP] Re: PHP Java extension--hopeless?

2003-11-26 Thread Justin Patrin
If you *must* get it to run in Java (starting and using a JVM for every page seems very costly to me) then I would suggest writing a simple Java app which writes the decoded values to stdout and using system() in PHP to run the JVM manually. Kelly Hallman wrote: I am trying to find help or inf

[PHP] Re: talking to a web page

2003-12-03 Thread Justin Patrin
You can use PEAR's HTTP_Client package (http://pear.php.net/package/HTTP_Client) to connect to a website, do authentication, post forms, handle redirects, etc. It also keeps track of cookies. Here's a sample (note that the URLs in this will probably not work): require_once('HTTP/Client.php');

[PHP] Re: validating email address

2003-12-03 Thread Justin Patrin
Or you could always use the PEAR package: http://pear.php.net/package/Validate Manuel Lemos wrote: Hello, On 12/03/2003 04:31 PM, Blake Schroeder wrote: Whats the best way to validate email address (check for white space, check for .com, .net.edu etc) Try this class: http://www.phpclasses.org

[PHP] Re: validating email address

2003-12-03 Thread Justin Patrin
Actually it does do DNS checking. It doens't yet check to make sure that the mail will work, but it could easily be added. Manuel Lemos wrote: Hello, On 12/03/2003 07:53 PM, Justin Patrin wrote: Or you could always use the PEAR package: http://pear.php.net/package/Validate That package

Re: [PHP] Re: talking to a web page

2003-12-03 Thread Justin Patrin
-- ...and then Justin Patrin said... % % You can use PEAR's HTTP_Client package % (http://pear.php.net/package/HTTP_Client) to connect to a website, do % authentication, post forms, handle redirects, etc. It also keeps track % of cookies. Oh, goodie; that sounds great. % % Here's a sample

Re: [PHP] PHP - Oracle - BLOBs - Display BLOB data in a table

2003-12-03 Thread Justin Patrin
Actually, I would suggest using two scripts. The first takes the id of the row as a GET parameter (say $id) and grabs the image data, sends the header, and echoes the data. The second script outputs a web page with an img tag. As such: image.php page.php Image.jpg Chris W. Parker wrote:

Re: [PHP] Re: talking to a web page

2003-12-03 Thread Justin Patrin
dependencies for those packages. Easiest way to go is to use the PEAR installer if you're just getting started. David T-G wrote: Justin, et al -- ...and then Justin Patrin said... % % One last thing. If all you need to do is go to a page and not navigate % it, you could just use HTTP_Re

[PHP] Re: Text field comparison

2003-12-03 Thread Justin Patrin
Yes, but the user would have to submit the form and you would have to re-fill it out for them and give them a message saying that they must be equal. You could use the PEAR HTML_Form and Quickform packages for much of this. Jeff wrote: I have created a few forms using post. There are certain f

Re: [PHP] validating email address

2003-12-03 Thread Justin Patrin
Quick note: The PEAR Validate package does this for you. It also checks for an alternate A record. Terence wrote: You could use MX records if you wanted to. I found this some time ago... function checkEmail($Email) { //Do the basic Reg Exp Matching for simple validation if (eregi("[EMAIL

Re: [PHP] CHMOD...

2003-12-04 Thread Justin Patrin
In all fairness, that's not a very good solution. Using system commands makes your script not cross platform, meaning it can't work on Windows. For a better solution try writing a recursive chmod script that sets the permission, the loops through the files and calls itself on them if the input

Re: [PHP] how to determine if shopping cart has been abandoned?

2003-12-04 Thread Justin Patrin
Of course, this makes problems when you're adding promotional product to the cart, which should have a seperate price. Add to this that the customer may have special pricing (think Business to Business). So you have to have an update mechanism for promotions and the extra price lists. Do-able,

Re: [PHP] how to determine if shopping cart has been abandoned?

2003-12-04 Thread Justin Patrin
Of course, now you have to deal with putting inventory back on the shelf when the session expiresand you have no way of knowing when that would happen unless you're storing *something*. Chris W. Parker wrote: Justin French on Thursday, December 04, 2003 2:48 P

[PHP] Re: Handling Database errors in php

2003-12-05 Thread Justin Patrin
If you want to get database errors back in a meaningful format, I'd suggest using PEAR::DB or another of the DB abstraction classes. They can return an error which you can then check and handle appropriately. In addition, it can let you use the same code for multiple database types (should you

Re: [PHP] MySQL Dump using PHP

2003-12-06 Thread Justin Patrin
Cesar Aracena wrote: The thing is that I don't have phisical access to the server and it doesn't have telnet access either. What I want to achieve is to make a password protected page inside my site were a button is kept to start a full backup of my MySQL DB and after clicking on it, be able to se

Re: [PHP] PHP & Variables

2003-12-06 Thread Justin Patrin
John W. Holmes wrote: echo ''; Or even *MORE* correct echo ''; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: getimagesize() & MySQL Image Storage (Running functions on contents of variables)

2003-12-07 Thread Justin Patrin
Galen wrote: I'm using a MySQL database to store images as BLOBs. I know how to handle all the MySQL stuff, it's easy, and really makes keeping track of files nice an clean. No permissions, no risk of getting things out of sync, finding stuff is as easy as SQL. My question is about handling st

[PHP] Re: preg_match and regular expression

2003-12-08 Thread Justin Patrin
Fred wrote: Hi I have problems with a regular expression. I have a html file like this: Hello somthing And i want to use preg_match to get a list of all the tags in the file: result: $list[0] = Hello $list[1] = somthing I have tryed this: preg_match('/.*(\.*\<\/div\>).*/', $conte

[PHP] Re: PHP My SQL vs ASP.NET SQL 2000 Server

2003-12-08 Thread Justin Patrin
Ryotaro Ishikawa Md wrote: Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in t

[PHP] Re: Reading email from sendmail

2003-12-08 Thread Justin Patrin
Robin Kopetzky wrote: Good afternoon, all!! Is there a function or series of functions in PHP that will allow a PHP package to read email from a sendmail account, look for a specific information in the subject line, then be able to resend that email to a group of users?? I know mail can b

[PHP] Re: query to display the results without...

2003-12-08 Thread Justin Patrin
Eric Holmstrom wrote: Hi there I have a database called "Eric" and table name called "Rocket'. Table consists of three values. PARTNO | DESCRIPTION | COMMENT So far if i want to show copper headgaskets from the 5r field i put this string into the php script (along with the rest of the html/php c

[PHP] Re: query to display the results without...

2003-12-08 Thread Justin Patrin
N']; $comment = $newArray['COMMENT']; } ?> --- How do i make it so if i type http://localhost/test.php?partno=5r&description=copper Cheers if you can help out! "Justin Patrin" <[EMAIL PROTECTED]> w

Re: [PHP] post an array into another site

2003-12-08 Thread Justin Patrin
Chris W. Parker wrote: fred on Monday, December 08, 2003 4:31 AM said: I have an array in php like this: $arr[0][0] = "Something"; $arr[0][1] = "Hello"; $arr[0][2] = "Hi"; It is possible to post this array to another site in a form? Or how can i do this? Yes. Her

[PHP] Re: post an array into another site

2003-12-08 Thread Justin Patrin
Manuel Lemos wrote: Hello, On 12/08/2003 10:30 AM, Fred wrote: I have an array in php like this: $arr[0][0] = "Something"; $arr[0][1] = "Hello"; $arr[0][2] = "Hi"; It is possible to post this array to another site in a form? Or how can i do this? You may want to try this class that lets you m

[PHP] Re: post an array into another site

2003-12-08 Thread Justin Patrin
Manuel Lemos wrote: Hello, On 12/08/2003 10:39 PM, Justin Patrin wrote: $arr[0][0] = "Something"; $arr[0][1] = "Hello"; $arr[0][2] = "Hi"; It is possible to post this array to another site in a form? Or how can i do this? You may want to try this class that le

Re: [PHP] Re: post an array into another site

2003-12-08 Thread Justin Patrin
Chris Shiflett wrote: --- Manuel Lemos <[EMAIL PROTECTED]> wrote: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/HTTP_Client Why better? Have you tried both packages? I can make a guess as to why he would say this, aside from the obviou

[PHP] Re: restrict access to multiple pages

2003-12-08 Thread Justin Patrin
Chris W. Parker wrote: Hey y'all. Ok so I am working on the admin sectin of the e-commerce app I'm writing and I'm hoping there's a better way to do what I am currently doing. In an effort to prevent circumvention of the login page I've placed a check at the beginning of each page that basically

Re: [PHP] post an array into another site

2003-12-08 Thread Justin Patrin
Chris W. Parker wrote: Justin Patrin <mailto:[EMAIL PROTECTED]> on Monday, December 08, 2003 4:39 PM said: If all you want to do is give an array to another script, sure you can delimit (although that's much more error prone than serializing). Serialize, delimit. It's pret

Re: [PHP] Re: post an array into another site

2003-12-08 Thread Justin Patrin
Chris Shiflett wrote: --- Justin Patrin <[EMAIL PROTECTED]> wrote: Actually PEAR isn't a PHP project per se. I disagree. You have to become a member of the PHP development team, as far as I know, to participate in PEAR development (CVS account, php.net email address, etc.). The

[PHP] Re: post an array into another site

2003-12-08 Thread Justin Patrin
Manuel Lemos wrote: Hello, On 12/08/2003 11:06 PM, Justin Patrin wrote: You may want to try this class that lets you make HTTP requests like a normal browser: http://www.phpclasses.org/httpclient Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/ > HTTP_Cli

[PHP] Re: post an array into another site

2003-12-08 Thread Justin Patrin
Justin Patrin wrote: Manuel Lemos wrote: Hello, On 12/08/2003 10:30 AM, Fred wrote: I have an array in php like this: $arr[0][0] = "Something"; $arr[0][1] = "Hello"; $arr[0][2] = "Hi"; It is possible to post this array to another site in a form? Or how can i

Re: [PHP] Re: post an array into another site

2003-12-08 Thread Justin Patrin
Ralph Guzman wrote: = THE END = I apologize, everyone. I should have realized a while ago that this would become a holy war. -- paperCrane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: goto label

2003-12-08 Thread Justin Patrin
Nitin wrote: Hi all, I was wondering, if there's any way to achieve 'goto "label":' using PHP Thanx for ur time Nitin goto is a very old and broken way of coding. If you ever find yourself in need of a goto, you should re-evaluate how you're doing things. If you're having trouble finding out

Re: [PHP] Re: goto label

2003-12-08 Thread Justin Patrin
Robert Cummings wrote: On Tue, 2003-12-09 at 00:32, Justin Patrin wrote: Nitin wrote: Hi all, I was wondering, if there's any way to achieve 'goto "label":' using PHP Thanx for ur time Nitin goto is a very old and broken way of coding. If you ever find yoursel

Re: [PHP] Re: goto label

2003-12-09 Thread Justin Patrin
Robert Cummings wrote: On Tue, 2003-12-09 at 08:14, Bogdan Stancescu wrote: Robert, I know your grief, been there, I know how it feels. I started my childhood with BASIC, which was /the/ "GOTO" programming language, learned Turbo Pascal when I was a teenager, and continued to use GOTO's (Pasca

[PHP] Re: Display Query Result As Editable Form

2003-12-10 Thread Justin Patrin
[EMAIL PROTECTED] wrote: Hi all, I am creating a user form whereby I will do an "INSERT" , "SELECT" , "UPDATE" and of course "DELETE" for the form. Right now I am trying to create a form whereby when user choose to update their info, they wil be directed to a form where the fields region are

[PHP] Re: removing ?> tag from include files

2003-12-10 Thread Justin Patrin
Priit Kaasik wrote: hi, im interested in specific information about removing php end-tags from include files (which contain php code). it woun't give any warning or error but will remove all annoying spaces and line breaks before you send your own header data... how does include function work

Re: [PHP] ARRAY

2003-12-10 Thread Justin Patrin
Richard Davey wrote: Hi, Wednesday, December 10, 2003, 6:29:43 PM, you wrote: RM> Because it's and array! print and echo take strings, not RM> arrays, I believe. Anyway, print_r() or a foreach loop will do it RM> for you. Agreed.. print_r() is the best, but if you're outputting all of this tex

Re: [PHP] Images in MySQL vs directory/file?

2003-12-10 Thread Justin Patrin
Galen wrote: I tend to disagree. Images in the database, providing they actually associate with other bits of info, are great. I usually keep images in a separate table than the data, but it's really easy to keep track of everything. No file permissions, backup is as easy as standard SQL backu

Re: [PHP] Images in MySQL vs directory/file?

2003-12-10 Thread Justin Patrin
Gerard Samuel wrote: On Wednesday 10 December 2003 02:43 pm, Galen wrote: If you store images that are played with a lot on the disk, it'll likely be slower than MySQL due to MySQL having better caching. I disagree. Depending on your setup, when a file based image is downloaded to a user's com

[PHP] Re: fopen >> custom 404 issue

2003-12-10 Thread Justin Patrin
Mike D wrote: I am trying to read in a particular page to a variable. How do you handle if the page is a 404 and then redirects to a custom error page? Am I supposed to use fsockopen and read headers or ?? Ideally I need to pull the end-result page to search for a string in it. Here's the code $ha

[PHP] Re: Help with associative array in a PHP class. Not working as I'd expect it to?!

2003-12-10 Thread Justin Patrin
Daevid Vincent wrote: I'm pulling out my hair on this. I don't think I'm doing anything wrong and I've tried it with PHP 4.3.4 (cli) (built: Nov 7 2003 03:47:25) AND also v4.1.2 on Linux. With the line commented as shown, I get this output: -- [daevid=pts/4]6:[EMAIL PROTECTED]:{/home/daevid}>

[PHP] Re: Help with associative array in a PHP class. Not working as I'd

2003-12-10 Thread Justin Patrin
Justin Patrin wrote: class kismetap { function kismetap() { $this->$myPacket = array('blah' => 'asdfasdfasdf'); } } That should be $this->myPacket = ... -- paperCrane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Write on image in faint color

2003-12-11 Thread Justin Patrin
Al wrote: 4) I'd love to see a PEAR IM module a la PerlMagick (but I haven't even looked yet, so please don't flame me for missing something obvious). One of these days I'll have The Great Rewrite and that will go in then. I'd love to be rid of the system() calls to convert and mogrify. The cl

Re: [PHP] Re: Write on image in faint color

2003-12-11 Thread Justin Patrin
Justin Patrin wrote: imagepng($ih, $dir.basename($file, $fileinfo['extension']).'png'); Oops, the above line should probably be: imagepng($ih, $dir.'-watermark'.basename($file, $fileinfo['extension']).'png'); so as not to trample you

Re: [PHP] Error that I can't find causing header() to fail

2003-12-11 Thread Justin Patrin
Rogue wrote: Yes. The html is after the call to header(). I am very clear on header() now :) That isn't the problem since the header() should be called way before any output... this is something bizarre here... The offending code is a block right smack in the middle of a bunch of other html st

Re: [PHP] php .htaccess autologin

2003-12-11 Thread Justin Patrin
Jas wrote: Combination of session vars and cookie vars... example... [login page] sets cookie with auth=0 (variable) sets session with auth=0 (variable) [logged in page(s)] sets cookie with auth=1 (variable -client side) sets session with auth=1 (variable -server side) hash of users password as cl

[PHP] Re: PHP IDE?

2003-12-13 Thread Justin Patrin
I use Emacs with syntax PHP highlighting. It does tabbing very well as well and has a lot of features that I couldn't easily gert out of vim (and there's no annoying mode change ;-). (Note: I used to use vim and loved it, but emacs seduced me away.) -paperCrane -- PHP General Mailing List (ht

[PHP] Re: Whats wrong with this statement.

2003-12-13 Thread Justin Patrin
Philip J. Newman wrote: $websiteUrl="http://www.philipnz.com/";; $websiteEmail="[EMAIL PROTECTED]"; // CHECK TO SEE IF DATA MATCHS WHATS IN THE DATABASE. $sql = "SELECT hUrl,hContactEmail FROM hyperlinks_data"; $sql_result = mysql_query($sql, $connection) or die ("Could not get Query"); $exi

Re: [PHP] Sorting arrays

2003-12-14 Thread Justin Patrin
Jake McHenry wrote: -Original Message- From: Bronislav Klucka [mailto:[EMAIL PROTECTED] Sent: Sunday, December 14, 2003 1:52 AM To: Jake McHenry; 'Php-general' Subject: RE: [PHP] Sorting arrays Try to explain a little bit more how the arrays could be sorted asscending and by hitting bac

Re: [PHP] Sorting arrays

2003-12-14 Thread Justin Patrin
Jake McHenry wrote: -Original Message- From: Bronislav Klucka [mailto:[EMAIL PROTECTED] Sent: Sunday, December 14, 2003 2:22 AM To: Jake McHenry Cc: 'Php-general' Subject: RE: [PHP] Sorting arrays Try to explain a little bit more how the arrays could be sorted asscending and by hittin

[PHP] Re: PHP and MySQL date

2003-12-15 Thread Justin Patrin
Cesar Aracena wrote: Hi all, I'm making a site and need some tables from wich I can extract date, time and/or date/time later with PHP and I neved had very clear the way the possible formats work with each other so my question is what is the best (or recommended) method to store dates and/or time

[PHP] Re: mail question (mime)

2003-12-16 Thread Justin Patrin
You may want to try using PEAR's Mail_Mime class. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: mail question (mime)

2003-12-16 Thread Justin Patrin
Cesar Cordovez wrote: ...and talking about mail, is there a class to parse an incoming mail? Let me explain: I'm using the great POP3 pear class to receive mail, but I'm having trouble separating the different parts in an "multipart/alternative" type of msg. Is there a class to receive the re

Re: [PHP] Authentication

2003-12-16 Thread Justin Patrin
Robert Sossomon wrote: I am not trying to authenticate off of a database though. I have scripts that automatically modify the .htaccess file as I change a user, so I need to authenticate off the .htaccess file and store the users information into a cookie. I think from the cookie I can do everyt

[PHP] Re: saving resource objects

2003-12-16 Thread Justin Patrin
Michael Lewis wrote: How can I pass this variable and its contents so they are usable to the next web page? The short answer is that you can't pass resources back and forth between pages. You could consider passing the current index, rerunning the query, and seeking to the new index. OR, you cou

Re: [PHP] Re: saving resource objects

2003-12-16 Thread Justin Patrin
If you're doing a large JOIN (which slows things down) you might try writing it all as multiple queries in PHP and having PHP join it together. It *may* be faster, especially for many joins. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Trying to make my session code smarter

2003-12-16 Thread Justin Patrin
Gerard Samuel wrote: Currently in my code, if a user is blocking cookies (for what ever reason that may be), it keeps generating session ids for each page load. Is there a way to ignore and/or work around these "users"?? Thanks You can turn on URL rewriting for sessions. I'm not sure where it is

[PHP] Re: Help with php output to file

2003-12-18 Thread Justin Patrin
Paul Godard wrote: Hi I have develop an online catalog in php/mysql. Now the client needs the web site on a cd. Of course without php or mysql... What is the fastes and easiest way to convert the only 2-3 dynamic php pages into static html files? Of course I could copy the html code generat

[PHP] Re: Retrieve key from $_POST

2004-01-05 Thread Justin Patrin
Robin Kopetzky wrote: Is there any way to retrieve a key value from $_POST when there is more than one $_POST array entry? I'm trying to retrieve the name of an 'INPUT TYPE="image"' control with HTML because you can't pass a value back. I need to get the name of the control to use in a 'switch' st

Re: [PHP] [Fwd: failure notice] Why??

2004-01-05 Thread Justin Patrin
Richard Davey wrote: Hello Rolf, Tuesday, January 6, 2004, 1:26:31 AM, you wrote: RB> Whenever I submit a message to this list, I get a bounce back saying its RB> a dupe, anyone have any ideas? I get exactly the same - it's highly annoying and happens every time. Do you use Pair Networks by any

[PHP] Re: Is there a way to protect PHP's $_POST, $_GET when user tamper with post string in URL toolbox???

2004-01-07 Thread Justin Patrin
When the page is submitted, set your session vars, then redirect to the next page. Or you can set the session vars before you do any other processing. Scott Fletcher wrote: Will check into whether did I use the post method correctly. Speaking of session, I don't see how can it be done to put t

Re: [PHP] Not working?

2004-01-08 Thread Justin Patrin
Roger Spears wrote: Try this: system(rename('/path/to/new.sh', '/path/to/old.$today')); Actually, it should be this: rename('/path/to/new.sh', '/path/to/old.$today'); -- paperCrane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: post vars not by form

2004-01-08 Thread Justin Patrin
Nabil wrote: HI, Anyone can help , how to post variables from server side .. as from php page to other without HTML form and submistion ??? i want post method , to post my vars to another php on another server , then i have to read the body that will be printed by fopen ... so i can not use Locati

[PHP] Re: not sure why regex is doing this

2004-01-09 Thread Justin Patrin
while (eregi(',\s*,',$query)): $query = preg_replace('/,\s*,/',',NULL,', $query, -1); endwhile; Please don't mix the regex engines like that...it could lead to much suffering. instead of eregi, use preg_match. -- paperCrane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

[PHP] Re: Headers and sessions in php .cgi

2004-01-10 Thread Justin Patrin
BøRge Strand wrote: Hi there, I have a problem setting my headers right with php running as .cgi. I have to specify a Content-type for the cgi file to work. But how should I do both that and start a session? I have a few options: #! /usr/local/bin/php This way $_SESSION['count'] stays unset even

[PHP] Re: Array Key Test

2004-01-12 Thread Justin Patrin
Cameron B. Prince wrote: Hi, How would I go about determining if a specific key exists in an array? I want to see if $conf['hOpt'] is defined. is_array only works at the $conf level. You want: if(isset($conf['hOpt'])) { ... } You should always use isset to check if a variable is set, whether it

[PHP] Re: to array or not to array..

2004-01-12 Thread Justin Patrin
Edward Peloke wrote: Ok, This is probably a basic question, I am just looking for opinions and examples as to the best way to handle this... I cycling through a query and displaying results to the user such as ... usernamecan add can delete eddieY

Re: [PHP] to array or not to array..

2004-01-12 Thread Justin Patrin
The way I deal with this is one of two ways. An easy way is to populate hidden fields in the page with the indexes of the users, thwn loop through those, checking the indexes of the arrays sent back. User 5 User 7 Another is to loop through, say, records from the DB and use their IDs for th

Re: [PHP] class design question

2004-01-12 Thread Justin Patrin
Jason Sheets wrote: Take a look at the PEAR DB Abstraction layer, I usually store connection info in an XML or INI file and use parse_ini or PEAR Config to parse the configuration file. http://pear.php.net hi there. i am working out the finishing touches on a authentication class that uses mysq

[PHP] Re: iteration of $GLOBAL

2004-01-12 Thread Justin Patrin
Chris Sherwood wrote: hello everyone I feel a little stupid asking this but I have tried multiple searches on google and on php.net and cant seem to find the snippet of code that will iterate through all the global variables for the session thanks in advance This will work for any associative ar

Re: [PHP] Storing PHP code in a database

2004-01-13 Thread Justin Patrin
John W. Holmes wrote: Justin French wrote: Is there much I need to know about storing mixed PHP/HTML text in a mysql database table, and then using eval() to execute it? All I managed to find so far is that I should store it in a blob. A TEXT or BLOB column will do. Only difference is BLOB is

[PHP] Re: class functions where the function name == class name

2004-01-13 Thread Justin Patrin
Glenn Yonemitsu wrote: Hey there guys I just started trying out with writing classes. I've been looking at a lot of PEAR class files and noticed this: class classname { function classname() { } } I know that "$object = new classname;" will automatically run $object->classname();. But is i

Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Justin Patrin
RewriteEngine On RewriteRule ^show/(.*)/(.*) /show.php?sid=$1&id=$2 Try: RewriteRule ^show/([^/]*)/([^/]*) /show.php?sid=$1&id=$2 -- paperCrane -- Question Everything, Reject Nothing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: dynamic list/menu in php

2004-01-15 Thread Justin Patrin
I didn't really understand most of what you said (your English is really confusing), but you might want to check out DB_DataObject_FormBuilder. It will create forms for editing of DB records with select boxes for foreign keys. There are also lots of new options in the newest CVS version which i

[PHP] Re: addslashes

2004-01-15 Thread Justin Patrin
JoãO CâNdido De Souza Neto wrote: Hello to all. I'm using str_replace("\r\n","\\r\\n",addslashes($campo)) to add "\" in mysql data to send to javascript variable. Running in my machine with win xp + iis it's all ok, but in server with linux + apache, the javascript variable no have "\" causing er

Re: [PHP] 2 x DB connections at once

2004-01-22 Thread Justin Patrin
You're running into an old error. I believe that this was a problem with previous versions of PHP, are you using the newest version? Barring that, if you add true to the end of the mysql_connect call to make it a different connection, that should also fix things. Or you could try using PEAR::DB

Re: [PHP] pass by reference

2004-01-23 Thread Justin Patrin
Kevin Waterson wrote: This one time, at band camp, Tom Rogers <[EMAIL PROTECTED]> wrote: php can output the stream without having to save it to a file first if that is what is worrying you. That was sorta my concern, but not so much as a file, does it copy to memory anywhere, or, is it a dire

Re: [PHP] what PHP really needs

2004-01-23 Thread Justin Patrin
John W. Holmes wrote: From: "Chris Boget" <[EMAIL PROTECTED]> [snip] [/snip] Learn and use C++ Or sessions. Along with serialize() and deserialize(), all are your friends in this case. He's talking about the same set of data being available to all instances of PHP, though. I think they're c

Re: [PHP] Best practice to re-write a tutorial website

2004-07-23 Thread Justin Patrin
On Fri, 23 Jul 2004 17:51:52 +0300, EE <[EMAIL PROTECTED]> wrote: > On Fri, 2004-07-23 at 00:06, Justin Patrin wrote: > > On Thu, 22 Jul 2004 23:48:54 +0300, EE <[EMAIL PROTECTED]> wrote: > > > Dears, > > > > > > I am planing to rewrite my website

Re: [PHP] Refer a class

2004-07-26 Thread Justin Patrin
his->main->VARIABLE but the values are old. If I call a > function > > > with $this->main->func_name(); it doesn't work, but there also isn't an > > > error message! > > > > > > What's wrong with these functions? > > > > > > Thanks for help, Michael > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Fwd: IMPORTANT: Please Verify Your Message

2004-07-26 Thread Justin Patrin
D] > Well then, it *does* sound like something isn't right here. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] [Fwd: IMPORTANT: Please Verify Your Message]

2004-07-26 Thread Justin Patrin
DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP editor that doesn't require installation

2004-07-26 Thread Justin Patrin
built in? -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Problem with PEAR DB & MySQLi

2004-07-26 Thread Justin Patrin
s'); > > // Always check that result is not an error > if (DB::isError($res)) { > die($res->getMessage()); > } > ?> > > result: > > DB Error: unknown error > Echo $res->getUserInfo() as well. It has the real error. -- DB_DataObject_FormB

Re: [PHP] issue a value on header, not working..

2004-07-26 Thread Justin Patrin
rtips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] exists max number of case block in switch steatment ?

2004-07-27 Thread Justin Patrin
7;t make sense. If you mean a switch with 300 different cases, yes you can do itbut you should really switch to maybe a DB backend as 300 case statements would be very hard to maintain. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormB

Re: [PHP] Sendmail Return-Path

2004-07-27 Thread Justin Patrin
0774 > [EMAIL PROTECTED] > www.category9.com > > - + - + - + - + - + - + - + - + - + - + - + - + - > > !DSPAM:4106c542182671082813648! > -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Verifying AUthorised Users through Session Variables not Working...?

2004-07-27 Thread Justin Patrin
hael Mason > Arras People > www.arraspeople.co.uk > - > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > !DSPAM:4106d348216571949498371! > > -- DB_DataObject_FormBuil

Re: [PHP] eliminate keyword

2004-07-27 Thread Justin Patrin
lder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Showing all users who are logged in

2004-07-27 Thread Justin Patrin
p://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Adding +7 more days on date() value problem

2004-07-27 Thread Justin Patrin
uot;-", $curdate); > > print (" > cut: > " .$plus7[0]. " > " .$plus7[1]. " > " .$plus7[2]. " > > > Current Date: $curdate > +7 Dats Date: $plus7 > > "); > ?> > ## > $add7days = date('Y-m-d', strtot

Re: [PHP] Data management tool

2004-07-27 Thread Justin Patrin
taObject_FormBuilder_Frontend If you need help using DataObject, FormBuilder, or the frontend, don't hesitate to ask for help. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP Gener

Re: [PHP] PHP Templates Cached on Server

2004-07-28 Thread Justin Patrin
something like Smarty templates then you need to look into the settings of your template system. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   3   4   5   6   >