Re: [PHP] Zend DB Table - WHERE as OR?

2010-04-09 Thread Andrew Ballard
On Fri, Apr 9, 2010 at 3:15 PM, Dan Joseph wrote: > Hi Everyone, > > I'm trying to figure out if something is even an option with the Zend > Framework.  We use the DB Table stuff.  I don't see it in the manual, so I > figured I'd ask you all... > > I have: > > $select = $table->select()->where( "h

Re: [PHP] 404 redirects "stolen" by provider

2010-04-09 Thread Andrew Ballard
On Fri, Apr 9, 2010 at 3:29 PM, Merlin Morgenstern wrote: > Hello, > > I am running a website under apache and php where I do redirects on 404 > errors: > > apache conf: > ErrorDocument 404 /subapp_members/search_user.php > > This is done to allow ULRs with usernames like this: > www.server.com/us

Re: [PHP] Sort two coupled arrays {my solution]

2010-04-08 Thread Andrew Ballard
On Thu, Apr 8, 2010 at 9:55 AM, tedd wrote: > At 8:28 AM -0400 4/8/10, Andrew Ballard wrote: >> >> On Wed, Apr 7, 2010 at 6:46 PM, Ryan Sun wrote: >> >>  > >>> >>>  rsort(array_combine(array2, array1)); >>> >>>  you should

Re: [PHP] Sort two coupled arrays {my solution]

2010-04-08 Thread Andrew Ballard
On Wed, Apr 7, 2010 at 6:46 PM, Ryan Sun wrote: > On Wed, Apr 7, 2010 at 6:29 PM, tedd wrote: [snip] >> >> Let's look at the problem again (a vote collection problem): >> >> Array 1 >> ( >>    [1] => 75 >>    [2] => 31 >>    [3] => 31 >>    [4] => 31 >>    [5] => 40 >> ) >> >> Array 1 is an arr

Re: [PHP] Sort two coupled arrays

2010-04-07 Thread Andrew Ballard
On Wed, Apr 7, 2010 at 5:02 PM, Paul M Foster wrote: > On Wed, Apr 07, 2010 at 04:09:47PM -0400, tedd wrote: > >> Hi gang: >> >> Here's the problem -- I want to sort and combine two arrays into one >> sorted array. Here's a real-world example: >> >> Array 1 >> ( >>     [1] => 75 >>     [2] => 31 >

Re: [PHP] MySQL query not working!

2010-03-31 Thread Andrew Ballard
On Wed, Mar 31, 2010 at 9:08 AM, Andrew Ballard wrote: > Nope. All it does is suppress the error message. Just try it: > > > @mysql_connect('localhost', 'baduser', 'badpassword') or die('Could > not connect'); > > ?> > >

Re: [PHP] MySQL query not working!

2010-03-31 Thread Andrew Ballard
On Wed, Mar 31, 2010 at 8:46 AM, Ashley Sheridan wrote: > On Wed, 2010-03-31 at 16:50 +0430, Parham Doustdar wrote: > >> Andre, >> The @ operator is used for error catching statements. When you put: >> >> @mysql_connect('localhost', 'username', 'password') or die('Could not >> connect.'); >> >> If

Re: [PHP] Global Var Disappearing After Function

2010-03-22 Thread Andrew Ballard
On Mon, Mar 22, 2010 at 4:58 PM, APseudoUtopia wrote: > Hey list, > > I have a very odd problem which has been driving me crazy for two > days. I've been trying to debug my code and gave up. I finally coded a > very simple representation of what the code does, and I get the same > problem. However

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Andrew Ballard
On Fri, Mar 19, 2010 at 6:13 PM, Ashley Sheridan wrote: > > On Fri, 2010-03-19 at 18:01 -0400, Jason Pruim wrote: > > On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote: > > > On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan > > wrote: > > [snip] > >> And

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-19 Thread Andrew Ballard
On Fri, Mar 19, 2010 at 6:01 PM, Jason Pruim wrote: > > On Mar 18, 2010, at 1:26 PM, Andrew Ballard wrote: > >> On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan >> wrote: >> [snip] >>> >>> And I believe that when MS Office saves a CSV out with a char

Re: [PHP] Spreadsheet_Excel_Reader problem

2010-03-18 Thread Andrew Ballard
On Thu, Mar 18, 2010 at 1:00 PM, Ashley Sheridan wrote: [snip] > And I believe that when MS Office saves a CSV out with a character other > than a comma as the delimiter, it still saves it as a .csv by default. Nope. If you save as CSV, it is comma-separated with double-quotes as the text qualifi

Re: [PHP] Doing dynamic routing for an office

2010-03-15 Thread Andrew Ballard
On Fri, Mar 12, 2010 at 3:30 AM, Per Jessen wrote: > Ian wrote: > >> Hi, >> >> I have had a weird request as a project and that is to build a system >> where the clients can put down their office plans into a system and >> based on where you are in the buliding (either via defined kiosks or >> mob

Re: [PHP] Execution order of PHP

2010-03-10 Thread Andrew Ballard
On Wed, Mar 10, 2010 at 9:54 AM, Bruno Fajardo wrote: [snip] > 2010/3/10 Auke van Slooten : >> This is not what I meant. I should perhaps mention that it's an xml-rpc >> client and the method calls are remote method calls. The multiCall method >> gathers multiple method calls into a single request

[PHP] Is there a way to get PHP to release this file?

2010-03-01 Thread Andrew Ballard
I am editing a data file via ODBC, and would like to be able to download the updated file in the same transaction when finished. It seems, however, that even after calling odbc_close(), PHP still retains a lock on the file for the duration of the request. Is there a way to get PHP to release the fi

Re: [PHP] Excel Spreadsheets and PHP

2010-03-01 Thread Andrew Ballard
On Fri, Feb 26, 2010 at 3:47 PM, Ian Robertson wrote: > Thank you all very much for your replies. > > I learned about a few new approaches. > > I didn't see it come up yet, so I'll post the URL of what I have been using. > > php_writeexcel - > http://www.bettina-attack.de/jonny/view.php/projects/

Re: [PHP] PHP / mySQL Project... Real men use 'cat'

2010-02-24 Thread Andrew Ballard
On Wed, Feb 24, 2010 at 5:12 AM, Ashley Sheridan wrote: > On Wed, 2010-02-24 at 09:18 +, Pete Ford wrote: >> sudo ln -s /bin/cat /bin/dog >> sudo ln -s /bin/cat /bin/rabbit >> sudo ln -s /bin/cat /bin/rat >> >> Sorted... >> > > > But now they're in /bin, surely at some point you'll want to exe

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread Andrew Ballard
On Mon, Feb 22, 2010 at 5:02 PM, Slack-Moehrle wrote: > John, > >>>Then if you use a MySQL database you would escape the string like this >>>$tmp = mysql_real_escape_string($_REQUEST['yyy']); > > >>>mysql_real_escape_string() protect from SQL injection by escaping your >>>string according to what

Re: [PHP] Excel Spreadsheets and PHP

2010-02-19 Thread Andrew Ballard
On Fri, Feb 19, 2010 at 3:36 PM, Bob McConnell wrote: > From: Ian Robertson > >> What are you using, if anything, to create Excel spreadsheets with > PHP? >> > > Output CSV files with the correct MIME type. MS-Windows will open them > in Excel by default in both IE and Firefox. > > Unfortunately,

Re: [PHP] Using base64 encode and decode to store user data in database

2010-02-19 Thread Andrew Ballard
On Fri, Feb 19, 2010 at 8:18 AM, Dotan Cohen wrote: > In order to prevent SQL injection, can one simply base64 encode the > data and store that? Then it can be decoded when I need to display it > on a website. I understand that this means that the data will not be > searchable, and that I still mu

Re: [PHP] Export/Write rows from DBF to CSV

2010-02-19 Thread Andrew Ballard
On Thu, Feb 18, 2010 at 5:31 PM, OBXer wrote: > > I'm trying to adopt this piece of code for my use.  I fixed the csv_data .= > trim error.  Does anyone know how I can fix empty fields?  Everything is > dumping to a csv file but information is not matching up.  I don't know if I > can insert a spa

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Andrew Ballard
On Thu, Feb 18, 2010 at 10:50 AM, Ashley Sheridan wrote: > On Thu, 2010-02-18 at 09:47 -0600, Chuck wrote: > >> Sorry, been doing heavy perl and haven't written any PHP in 3 years so a tad >> rusty. >> >> Can someone explain why the second expression in this code snippet evaluates >> to 7 and not

Re: [PHP] PHP Manual problems

2010-02-12 Thread Andrew Ballard
On Thu, Feb 11, 2010 at 5:18 AM, Ashley Sheridan wrote: > There's a good reason for OpenOffice having some difficulties with MS > Office documents. Back when MS rushed through getting their document > standard ratified by ISO (which itself is a whole other story) they > didn't explain all the deta

Re: [PHP] PHP Manual problems

2010-02-10 Thread Andrew Ballard
On Wed, Feb 10, 2010 at 3:48 PM, Robert Cummings wrote: > Nathan Rixham wrote: >> "The most common misconception of how this element should be used is for >> the standard sidebar." - see: http://html5doctor.com/understanding-aside/ > > Unfortunatley I examined that side quite thoroughly and got sm

Re: [PHP] DOM TextArea (and dom chart please)

2010-02-02 Thread Andrew Ballard
On Tue, Feb 2, 2010 at 2:29 PM, Ryan S wrote: > Hey! > i'm just starting with PHP's DOM-XML and need a little help please. > > > Basically, first i am trying to see if a input like a textbox has a 'VALUE=' > associated with it, if yes, i leave it be, if no, i add a default value. > > This *is wor

Re: [PHP] If the first four characters are "0000", then do {}

2010-01-25 Thread Andrew Ballard
On Mon, Jan 25, 2010 at 11:12 PM, Daevid Vincent wrote: >> >From what I understand, strpos() faster than a lot of other similar >> string functions and much faster than regexps. You could do: >> >> if (strpos($mydata->restored, '') === 0) { >>       do_stuff(); >> } > > Ah. Clever use of the "

Re: [PHP] header("Location:...") fails

2010-01-13 Thread Andrew Ballard
On Wed, Jan 13, 2010 at 2:39 PM, Richard S. Crawford wrote: > Now, even if $numprojects is 1, 2, 3, etc., the header() command is not > executed. Strangely, a header("Location") command later on in the script > *is* executed. I've output the value of $numprojects, so I know that it's > greater tha

Re: [PHP] Re: PHP programming strategy; lots of little include files, or a few big ones?

2010-01-08 Thread Andrew Ballard
On Thu, Jan 7, 2010 at 10:48 PM, Robert Cummings wrote: > ... > They almost always make your shit run faster. You know they make medicine for that? ;-) Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: splitting a string

2010-01-05 Thread Andrew Ballard
On Tue, Jan 5, 2010 at 10:20 AM, Ashley Sheridan wrote: > On Tue, 2010-01-05 at 16:18 +0100, Daniel Egeberg wrote: > >> On Tue, Jan 5, 2010 at 16:09, Shawn McKenzie wrote: >> > Of course this doesn't work for something like 'My.Word.Document.docx' >> > or 'archive_v2.0.1.tar.gz', but I don't know

Re: [PHP] PHP + ODBC

2009-12-16 Thread Andrew Ballard
On Tue, Dec 15, 2009 at 10:13 AM, Philip Thompson wrote: > On Dec 14, 2009, at 8:47 PM, James McLean wrote: >> Why not just use the built in MySQL libraries or PDO? > > Oh, that would be "my" preference. However, the database that I > really need to connect to is an MSSQL one and the allowed conne

Re: [PHP] strip tags but preserve title attributes

2009-12-15 Thread Andrew Ballard
On Mon, Dec 14, 2009 at 6:43 PM, Ashley Sheridan wrote: > I'm looking for a way to strip HTML tags out of some text content > (sourced from a web page) to leave just the text which I'll be running > some basic analysis on. The thing is, I want to preserve text that is in > alt and title attributes

Re: [PHP] Server-side encryption to prevent form hacking: new idea?

2009-12-11 Thread Andrew Ballard
On Fri, Dec 11, 2009 at 3:34 PM, Michael Shadle wrote: > On Fri, Dec 11, 2009 at 12:29 PM, Mattias Thorslund > wrote: >> Kelly Jones wrote: >>> >>> If you have an HTML form select field xyz with possible values >>> "apple", "banana", and "cucumber", anyone can easily set xyz to an >>> arbitrary v

Re: [PHP] Disabling button onclick in IE

2009-12-01 Thread Andrew Ballard
On Tue, Dec 1, 2009 at 4:06 PM, Skip Evans wrote: > Hey all, > > You probably remember me asking about disabling a submit button when it is > clicked to prevent double clicks submitting  a form for CC processing. > > I put the following code into the submit button and it works fine on > FireFox, b

Re: [PHP] tracking forwarded emails using PHP

2009-11-18 Thread Andrew Ballard
On Wed, Nov 18, 2009 at 9:07 AM, Ashley Sheridan wrote: > I  think that people removing themselves from mailing lists is a little > extreme. I wouldn't remove myself just because I thought I was being tracked. You might not, but some people will. One (of many) of the problems with that approach

Re: [PHP] tracking forwarded emails using PHP

2009-11-18 Thread Andrew Ballard
On Wed, Nov 18, 2009 at 4:30 AM, Angus Mann wrote: > 1. Is possible. Google the term web-bug. Be prepared that it will only work > if the recipient has a HTML enabled email reader AND allows downloading of > images. Be prepared also that every time the email (including forwarded > emails) are view

Re: [PHP] sessions and email

2009-11-12 Thread Andrew Ballard
On Thu, Nov 12, 2009 at 1:21 PM, Ashley Sheridan wrote: > On Thu, 2009-11-12 at 13:17 -0500, Dan Shirah wrote: > >> All, >> >> I am using sessions for my application to verify a user has logged in: >> >> // Verify the user is logged in. >> if (!isset($_SESSION['basic_is_logged_in']) >>     || $_SE

Re: [PHP] How do I get reliable COMPUTERNAME?

2009-11-05 Thread Andrew Ballard
On Thu, Nov 5, 2009 at 2:03 PM, Jim Lucas wrote: > Andrew Ballard wrote: >> I want to store the name of the computer that is executing a script in >> some log tables. (Our servers are load balanced, and I'd like to be >> able to determine which physical machine is servi

Re: [PHP] Textarea to road a text file

2009-10-28 Thread Andrew Ballard
On Wed, Oct 28, 2009 at 10:39 AM, Jean Lee wrote: > I want to use Textarea as the text-file viewer and editor of my homepage. > But Textarea doesn't work exactly as i intended. > In sometimes, TextArea doesn't show up > and moreover the some parts of the file are displayed(rendered) in browser > w

Re: [PHP] How is this possible?

2009-10-28 Thread Andrew Ballard
On Wed, Oct 28, 2009 at 1:27 PM, tedd wrote: > Hi gang: > > I am reviewing some old code (circa 2003) where the programmer had one > script call another and placed variable values in the URL, like so: > >     > > That seems innocent enough. However, in the called script (i.e., > "user_edit.php") t

Re: [PHP] how call a variable in a text

2009-10-21 Thread Andrew Ballard
2009/10/21 Bulend Kolay : > I 'll send a mail in html form using php5. > > cat send.php > $variable="date1" ; > .. > .. > $message=' > > There is a text $variable  trial. > '; > > mail($to, $subject, $message, $headers) ; > ?> > > when I run send.php, I get the mail. But I can't call variable ca

Re: [PHP] utf8_decode() and mixed character sets

2009-10-10 Thread Andrew Ballard
On Sat, Oct 10, 2009 at 11:40 PM, James Colannino wrote: > > Hey everyone.  I'd been troubled for a while by the fact that inserting > cut-pasted special characters such as ä caused truncation when passed to > MySQL, then discovered that it was because I was cutting and pasting unicode > values in

Re: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrew Ballard
On Wed, Oct 7, 2009 at 3:58 PM, Andrew Ballard wrote: > On Wed, Oct 7, 2009 at 3:42 PM, tedd wrote: > >> However, what I find wacky about all of this is: >> >> for($i=1; $i<=10; $i++) >>{ >>echo($i); >>} >> >>

Re: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo

2009-10-07 Thread Andrew Ballard
On Wed, Oct 7, 2009 at 3:42 PM, tedd wrote: > However, what I find wacky about all of this is: > > for($i=1; $i<=10; $i++) >{ >echo($i); >} > > and > > for($i=1; $i<=10; ++$i) >{ >echo($i); >} > > Do exactly the same thing. I would have expected the first to print 1-10,

Re: [PHP] PHP Header issue

2009-09-18 Thread Andrew Ballard
On Fri, Sep 18, 2009 at 12:39 PM, Ernie Kemp wrote: > > > > > > Contact Us > > > > > > > > > > > > The above is just snippet of the code but even this simple example throws the > Header Warning / Error. > > > > Warning: Cannot modify header information - headers already sent by (output >

Re: [PHP] PHP configuration values

2009-09-11 Thread Andrew Ballard
On Fri, Sep 11, 2009 at 10:49 AM, Arno Kuhl wrote: > You're right, you can't change register_globals in script but you can query > it in script, which is what I was referring to. There aren't many settings > you can change in script, about the only useful one that we use is > max_execution_time. E

Re: [PHP] Reading files in PHP 5.3.0

2009-09-11 Thread Andrew Ballard
On Fri, Sep 11, 2009 at 8:15 AM, Ashley Sheridan wrote: > On Fri, 2009-09-11 at 08:04 -0400, tedd wrote: >> At 5:06 PM -0700 9/10/09, Tommy Pham wrote: >> >  > So did anything change in PHP5.3.0 that would preclude the > code >> >below > from working?  Am I going crazy?  Or did Apple > f...@# >> >

Re: [PHP] PHP configuration values

2009-09-11 Thread Andrew Ballard
On Fri, Sep 11, 2009 at 3:06 AM, Arno Kuhl wrote: > I'm having some problems with the way my service provider is implementing > FastCGI. My tests show that local configuration values are no longer used, > even though those are the values reported by php when the script queries a > setting (e.g. re

Re: [PHP] Re: Class variable value lost

2009-09-09 Thread Andrew Ballard
On Wed, Sep 9, 2009 at 11:58 AM, Sumit Sharma wrote: > What I have done is declared one User class in a separate file and created > its object there only. After this included this file in all other file which > are using its object. So the object is creating only once and included in > every other

Re: [PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread Andrew Ballard
On Fri, Sep 4, 2009 at 3:16 PM, James Colannino wrote: > Hey everyone.  I ran into a really weird issue that I was hoping I could > find some clarification on.  In short, I have javascript functions that > operate on hidden text values.  Those values may be posted, in which > case PHP then prints t

Re: [PHP] Date +30 comparison

2009-09-01 Thread Andrew Ballard
On Tue, Sep 1, 2009 at 1:27 PM, tedd wrote: > First get the date to seconds, like so: > > $today_date = '8/26/2009'; > > $next_date = strtotime($today_date) + (86400 * 30); > No. Due to Daylight Saving Time, many time zones have two days each year when the number of seconds in a day is not 86400.

Re: [PHP] File Open Prompt?

2009-08-28 Thread Andrew Ballard
On Fri, Aug 28, 2009 at 3:03 PM, Dan Shirah wrote: > Greetings, > > I'm having a problem trying to get a file download prompt. > > Basically I have a page with image links. > > When the link is clicked, the user is directed to another page I have. That > page finds the image path based on the image

Re: [PHP] How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Wed, Aug 26, 2009 at 12:06 PM, hack988 hack988 wrote: > Mysql,mssql has its own feature,you can't say Mysql is better than > Mssql or Mssql it better than Mysql,Is'nt is? > My the Way ,Mssql support Top n,m form mssql 2005 :) > Perhaps, but the OP said he's using SQL Server 2000. Andrew -- P

Re: [PHP] How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Wed, Aug 26, 2009 at 12:13 PM, Andrew Ballard wrote: > On Wed, Aug 26, 2009 at 9:51 AM, David Stoltz wrote: >> Sorry - I don't know what you mean by DB class? >> >> I'm using Microsoft SQL 2000with this code: >> >> > //create an instance of

Re: [PHP] How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Wed, Aug 26, 2009 at 9:51 AM, David Stoltz wrote: > Sorry - I don't know what you mean by DB class? > > I'm using Microsoft SQL 2000with this code: > > //create an instance of the  ADO connection object > $conn = new COM ("ADODB.Connection") >  or die("Cannot start ADO"); > //define connect

Re: [PHP] Re: How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Tue, Aug 25, 2009 at 3:22 PM, Shawn McKenzie wrote: > First off, if the value is NULL in the database then in PHP it will be > the string "NULL" and not a null value as far as I remember. I've not seen this happen. I've found, depending on the database and the data access library used to interf

Re: [PHP] How to output a NULL field?

2009-08-26 Thread Andrew Ballard
On Wed, Aug 26, 2009 at 10:52 AM, Ashley Sheridan wrote: > You should try and see if you can get it installed there, as it will > work on Windows servers. I've found it generally to be faster than MS > SQL, and the choice of different database engines for each table gives > you a LOT of flexibility

Re: [PHP] Determining Calling Script Information

2009-08-13 Thread Andrew Ballard
On Thu, Aug 13, 2009 at 10:48 AM, Matt Giddings wrote: > Hi, > > Is there a way (other than using __LINE__ and __FILE__) to determine which > file & line called a function/method?  I would like to add some debugging > information to a method but I don't want to have to go through to each line > tha

Re: [PHP] reason for a "Notice:.." on one site but not another? (Same code.)

2009-08-10 Thread Andrew Ballard
On Mon, Aug 10, 2009 at 1:50 PM, Ralph Deffke wrote: > this is not "intelligence" its just pure math. the '&&' says if BOTH > expressions are true then the whole expression is true. > > so if the first one is false, the whole is false, why checking the next one > in the underlaying C it would be so

Re: [PHP] Displaying user data and picture

2009-08-06 Thread Andrew Ballard
On Thu, Aug 6, 2009 at 5:02 PM, Michael A. Peters wrote: > Ralph Deffke wrote: >> >>  and a blob field in mysql is >> the right thing, however u have to have a little php scrip, however with a >> .png extention to get the browser displaying the picture. > > What is the advantage to storing an image

Re: [PHP] Warning: OutsourcingRoom.com

2009-08-06 Thread Andrew Ballard
On Thu, Aug 6, 2009 at 8:20 AM, abdulazeez alugo wrote: > >> > > Well, I try not to give out my details to too many people each month, >> > > and this month they were beat to it by a nice fellow in Nigeria who I'm >> > > helping out by letting him put some money into my account. > > Hello Ash, > Co

Re: [PHP] Need quick got written up yesterday!! OUCH

2009-08-04 Thread Andrew Ballard
On Tue, Aug 4, 2009 at 2:05 PM, HallMarc Websites wrote: > I have noticed a few issues with Gmail and this isn't the first time that > mail service has muffed up an email and/or the attachments. It consistently > has compromised jpg's, pdf's and the like. I sent an email to a prospective > clien

Re: [PHP] Need quick got written up yesterday!! OUCH

2009-08-04 Thread Andrew Ballard
On Tue, Aug 4, 2009 at 10:30 AM, Ashley Sheridan wrote: > On Tue, 2009-08-04 at 07:16 -0700, Miller, Terion wrote: >> for($i = 0; $i <= 9; $iﯯ) > > I'm noticing an odd character just here (heaven knows what line number!) > I'd presume this was meant to be something like a ++ or +=n, but seems > to

Re: [PHP] isset not functioning

2009-08-03 Thread Andrew Ballard
On Mon, Aug 3, 2009 at 1:08 PM, Allen McCabe wrote: > I created a simple survey for my work website, most of the PHP is on my > process.php document, which is referenced by a form on a seperate page > containing the form with the method of "post". > > On my process.php page, the script obtains the

Re: [PHP] clean url problem .htaccess

2009-07-31 Thread Andrew Ballard
On Sat, Aug 1, 2009 at 2:11 AM, A.a.k wrote: > Hi > I'm trying to use clean urls in my application: > lets say convert http://mysite/article.php?id=3   to > http://mysite/article/3/ > my problem is to use /article act as it was /article.php > here is mt .htacess : > > ForceType application/x-httpd

Re: [PHP] Can a range be passed to a query?

2009-07-31 Thread Andrew Ballard
On Fri, Jul 31, 2009 at 5:55 PM, Phpster wrote: > What about > > $sql = "SELECT DISTINCT ID, name, address FROM restaurants WHERE > left(name, 1) between 0 and 9"; > > > > > Bastien > > Sent from my iPod You need to wrap the 0 and the 9 in single quotes, or else it returns everything. $sql = "SEL

Re: [PHP] ForEach Range Problems

2009-07-31 Thread Andrew Ballard
On Fri, Jul 31, 2009 at 4:51 PM, Miller, Terion wrote: > //Show all restaurants that start with $letter not > between "A" and "Z" > > $other = ctype_digit($letter); > > foreach(range('0','9') as $other) { > > $sql = "SELECT DISTINCT ID, name, address > FROMrestaurants >

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread Andrew Ballard
On Mon, Jul 27, 2009 at 11:46 AM, Bastien Koert wrote: > Back to the DIVs option, you can write js controls that make the > window dragable, hidable etc to improve the users enjoyment of the > page > > -- > > Bastien > Some implementations are definitely better than others. Like any other software

Re: [PHP] More on "JS alert that links to file"

2009-07-27 Thread Andrew Ballard
On Mon, Jul 27, 2009 at 10:34 AM, Jim Lucas wrote: > Ashley's answer is correct.  But the one thing she ... He. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to pull window to the foreground - Window Focus

2009-07-27 Thread Andrew Ballard
On Mon, Jul 27, 2009 at 10:26 AM, WebPat wrote: > Bastien Koert wrote: >> >> On Mon, Jul 27, 2009 at 8:31 AM, WebPat wrote: >>> >>> I have a web page with a button that displays additional information for >>> the >>> user. It does a Window.Open to create a "popup" window, then populates >>> it. >>>

Re: [PHP] Question on code profiling

2009-07-27 Thread Andrew Ballard
On Sat, Jul 25, 2009 at 1:31 AM, Daniel Kolbo wrote: > Andrew Ballard wrote: >> On Thu, Jul 23, 2009 at 11:31 PM, Andrew Ballard wrote: >>> From what I can tell, the numbers I see in WinCacheGrind >>> look like they are off by about a factor of 10 pretty &g

Re: [PHP] Question on code profiling

2009-07-24 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 11:31 PM, Andrew Ballard wrote: > From what I can tell, the numbers I see in WinCacheGrind > look like they are off by about a factor of 10 pretty > uniformly. > > Andrew > Apparently the difference is indeed WinCacheGrind, as a number of other people hav

Re: [PHP] Re: Question on code profiling

2009-07-24 Thread Andrew Ballard
On Fri, Jul 24, 2009 at 2:27 AM, Lupus Michaelis wrote: > Andrew Ballard a écrit : >> >> I'm trying to profile a site on our development server to see why it >> takes around 4 seconds to generate a pretty basic page. > >  Last time I seen this is when I did vali

Re: [PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 5:32 PM, Ben Dunlap wrote: > I second Jonathan's suggestion; I would try calling microtime() before and > after your database query, and before and after anything else that isn't > strictly "execution of the script". > > Ben I tried this where I could. (The ZF library itsel

Re: [PHP] Re: Question on code profiling

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 5:10 PM, Ben Dunlap wrote: >> significant (around 46%), it says they only account for 193ms. What >> could account for that much difference between what xdebug calculates >> versus the total elapsed time? > > Are you counting "total elapsed time" from the perspective of the

Re: [PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 4:51 PM, Robert Cummings wrote: > Andrew Ballard wrote: >> >> I'm trying to profile a site on our development server to see why it >> takes around 4 seconds to generate a pretty basic page. I installed >> xdebug to use for the profiling, a

[PHP] Question on code profiling

2009-07-23 Thread Andrew Ballard
I'm trying to profile a site on our development server to see why it takes around 4 seconds to generate a pretty basic page. I installed xdebug to use for the profiling, and now I'm really confused. Even though it takes around 4 seconds to build the entire page, the profile says that the total proc

Re: [PHP] Converting SQL Dialects

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 3:39 PM, Matt Neimeyer wrote: >> You might even be able to convert EMPTY(X) to COALESCE(X, '') = ''. >> MySQL seems to be pretty forgiving with its implicit type-casting. > > Hmm... The new system I've written properly handles the datatype and > EMPTY... So this would be a h

Re: [PHP] How to build an FF extension

2009-07-23 Thread Andrew Ballard
On Thu, Jul 23, 2009 at 10:15 AM, Robert Cummings wrote: > Ashley Sheridan wrote: >> >> >> Wikipedia can hardly be accounted an official source of anything, >> especially considering how it gets the content! If you want official, >> then http://www.mozilla.com/en-US/firefox/releases/1.5.html is a g

Re: [PHP] Replace in a string with regex

2009-07-22 Thread Andrew Ballard
On Wed, Jul 22, 2009 at 11:01 AM, Ashley Sheridan wrote: > On Wed, 2009-07-22 at 07:54 -0700, Jim Lucas wrote: >> Sure that can be done.  But you will need to change the second argument >> to have double quotes so it will be parsed by PHP. >> >> Then I would surround YOUR variable with curly bracke

Re: [PHP] Doubt regarding session_destroy() in PHP 5

2009-07-22 Thread Andrew Ballard
On Wed, Jul 22, 2009 at 9:59 AM, Robert Cummings wrote: > A custom session handler that writes to files could easily encrypt session > data so that only the user with the correct session ID can decrypt it. I > think you're confusing the issue by claiming database sessions are more > secure when wha

Re: [PHP] Doubt regarding session_destroy() in PHP 5

2009-07-22 Thread Andrew Ballard
On Wed, Jul 22, 2009 at 8:36 AM, Ashley Sheridan wrote: > But *how* does it offer more security? You've not actually mentioned > that! > One way would be to encapsulate data access in stored procedures and deny direct table access on the session data. That way, even though the PHP account has acce

Re: [PHP] newbie - Is there a calendar module for date entry?

2009-07-22 Thread Andrew Ballard
On Wed, Jul 22, 2009 at 9:02 AM, Ashley Sheridan wrote: > Sorry, my bad, I misread the URL. Having a lot of stress here at the > moment getting my laptop fixed :-/ > Isn't that called withdrawal? ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/uns

Re: [PHP] newbie - Is there a calendar module for date entry?

2009-07-22 Thread Andrew Ballard
On Wed, Jul 22, 2009 at 3:50 AM, Ashley Sheridan wrote: > On Tue, 2009-07-21 at 22:17 -0300, Jonathan Tapicer wrote: >> On Tue, Jul 21, 2009 at 10:06 PM, >> c...@hosting4days.com wrote: >> > newbie ... >> > >> > - is there a calendar module for date fields? >> > >> > - so that a small calendar pops

Re: [PHP] Converting SQL Dialects

2009-07-21 Thread Andrew Ballard
On Tue, Jul 21, 2009 at 2:13 PM, Matt Neimeyer wrote: > Um... It depends? :) These are customer entered queries and vary based > on the end user and the customizations they have. It could be as > simple as WHERE inlist(SalesPerson,"Bob","Bill","Fred") OR it could be > something 12 lines long that p

Re: [PHP] Search Query on two tables not working

2009-07-21 Thread Andrew Ballard
On Tue, Jul 21, 2009 at 1:20 PM, Miller, Terion wrote: > Here it is...I see where it's doing the restaurant.name LIKE statement 2x > which is prob messing it up right...but in the code why is it doing that > twice.. > > SELECT name, address, inDate, inType, notes, critical, cviolations, > noncri

Re: [PHP] Search Query on two tables not working

2009-07-21 Thread Andrew Ballard
On Tue, Jul 21, 2009 at 12:26 PM, Miller, Terion wrote: > Why isn't this working for searching? Check your concatenation in the query. You need some white space padding your SQL segments, otherwise the text all starts to run together. (I had to reformat it. For some reason, most of the code snip

Re: [PHP] Syntax Snag need extra eyes

2009-07-16 Thread Andrew Ballard
On Thu, Jul 16, 2009 at 12:35 PM, Jim Lucas wrote: > > Andrew Ballard wrote: > > On Thu, Jul 16, 2009 at 12:25 PM, Jim Lucas wrote: [snip] > >> Also, this is the wrong way to use printf().  Please go read the manual > >> page for this function. > >> > &

Re: [PHP] Syntax Snag need extra eyes

2009-07-16 Thread Andrew Ballard
On Thu, Jul 16, 2009 at 12:25 PM, Jim Lucas wrote: > Miller, Terion wrote: > > I'm almost there with my little pagination script but now I'm hung on the > > "Unexpected T_Variable" error...which in the past has been a semi-colon > > missing so I'm not sure why this is throwing it...eyes please: >

Re: [PHP] Alphabetical pagination (RESOLVED)

2009-07-16 Thread Andrew Ballard
On Thu, Jul 16, 2009 at 9:33 AM, Miller, Terion wrote: > > Here is what finally worked: > >     isset($_GET['letter']) ? $_GET['letter'] : "A";                               >                          //alphabetical pagination links                       >                                  echo '

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Andrew Ballard
On Wed, Jul 15, 2009 at 11:30 AM, Ashley Sheridan wrote: > On Wednesday 15 July 2009 16:21:22 tedd wrote: >> At 12:38 PM -0700 7/14/09, Miller, Terion wrote: >> >I am trying to make a page that displays a-z like a b c d e etc as links >> >then when you click open one it reloads itself and shows onl

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Andrew Ballard
On Wed, Jul 15, 2009 at 3:28 AM, Ashley Sheridan wrote: > On Wednesday 15 July 2009 06:35:04 Jim Lucas wrote: >> Andrew Ballard wrote: >> > On Tue, Jul 14, 2009 at 3:38 PM, Miller, >> > >> > Terion wrote: >> >> I am trying to make a page that dis

Re: [PHP] Alphabetical pagination

2009-07-14 Thread Andrew Ballard
On Tue, Jul 14, 2009 at 3:38 PM, Miller, Terion wrote: > I am trying to make a page that displays a-z like a b c d e etc as links > then when you click open one it reloads itself and shows only the query > results that go with that letter...i'm not getting itI get a page that > says ARRAY over

Re: [PHP] MySql Injection advice

2009-07-13 Thread Andrew Ballard
On Mon, Jul 13, 2009 at 4:18 PM, Haig Dedeyan wrote: > for the phone #'s, I'm using int as the data type & storing each part of the > phone # in its own cell, > > When it gets displayed, I add a dash in between each part of the phone #'s > (country code-area code-1st set of digits-last set of digit

Re: [PHP] Establishing PHP Session From a Different Host

2009-07-13 Thread Andrew Ballard
On Mon, Jul 13, 2009 at 9:15 AM, Bob McConnell wrote: > From: Daniel Kolbo >> Daniel Brown wrote: >>> On Sun, Jul 12, 2009 at 12:37, Daniel Kolbo wrote: Hello, How does one continue a php session on a different domain (domain B) than the domain (domain A) that started the sessio

Re: [PHP] mysql cache query as xml

2009-07-10 Thread Andrew Ballard
On Fri, Jul 10, 2009 at 12:36 PM, Daniel Brown wrote: >    Chris; > >    From my understanding of your question, your message (included > below in its entirety) is better sent to the MySQL General list, which > I've CC'd on this reply.  If you haven't yet, please subscribe there > at mysql-subscr..

Re: [PHP] PHP script for detecting pattern sequences?

2009-07-10 Thread Andrew Ballard
On Fri, Jul 10, 2009 at 10:30 AM, Isaac Dover wrote: >> On Wed, Jul 8, 2009 at 11:32 PM, WenDong Zhang wrote: >> On Thu, Jul 9, 2009 at 6:00 AM, Per Jessen wrote: >> > A suitable regex might look something like this: >> > >> > /([0-9]+)\1+/ >> > >> > Not tested, probably won't work on the first t

Re: [PHP] Simple login form with cookies

2009-07-08 Thread Andrew Ballard
Try again, and include the actual link this time, dummy. :-) On Wed, Jul 8, 2009 at 5:30 PM, Andrew Ballard wrote: > On Wed, Jul 8, 2009 at 4:45 PM, PJ wrote: >> Andrew Ballard wrote: >>> On Wed, Jul 8, 2009 at 11:53 AM, PJ wrote: >>>> I have a couple of

Re: [PHP] Simple login form with cookies

2009-07-08 Thread Andrew Ballard
On Wed, Jul 8, 2009 at 4:45 PM, PJ wrote: > Andrew Ballard wrote: >> On Wed, Jul 8, 2009 at 11:53 AM, PJ wrote: >>> I have a couple of questions/comments re all this: >>> [snip] >>> 2. Cleaning is another bloody headache, for me anyway. I have found that &g

Re: [PHP] Simple login form with cookies

2009-07-08 Thread Andrew Ballard
On Wed, Jul 8, 2009 at 3:06 PM, Tony Marston wrote: [snip] > I don't like this rule, so I choose to disobey it. Now that's some scary ideology. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Simple login form with cookies

2009-07-08 Thread Andrew Ballard
On Wed, Jul 8, 2009 at 11:53 AM, PJ wrote: > Michael A. Peters wrote: >> Daniel Brown wrote: >>>     First, a reminder to several (including some in this thread) that >>> top-posting is against the law here. >>> >>> On Wed, Jul 8, 2009 at 09:48, Martin Scotta >>> wrote: $sql = 'SELECT * FROM y

Re: [PHP] Simple login form with cookies

2009-07-08 Thread Andrew Ballard
On Wed, Jul 8, 2009 at 9:48 AM, Martin Scotta wrote: > $sql = 'SELECT * FROM your-table WHERE username = \''. $username .'\' > and passwd = md5( concat( \'' . $username .'\', \'@\', \'' . $password > .'\'))'; > > I use this solution because md5 run faster in Mysql > > > > > -- > Martin Scotta > If

<    1   2   3   4   5   6   7   >