[PHP] Newbie Question about Conditionals

2010-03-30 Thread Matty Sarro
Hey all! This is probably my second post on the list, so please be gentle. Right now I am running through the Heads First PHP and MySQL book from O'Reilly. It's been quite enjoyable so far, but I have some questions about some of the code they're using in one of the chapters. Basically the code

Re: [PHP] Newbie Question about Conditionals

2010-03-30 Thread Tommy Pham
On Tue, Mar 30, 2010 at 9:22 PM, Matty Sarro msa...@gmail.com wrote: Hey all! This is probably my second post on the list, so please be gentle. Right now I am running through the Heads First PHP and MySQL book from O'Reilly. It's been quite enjoyable so far, but I have some questions about

Re: [PHP] Newbie Question about Conditionals

2010-03-30 Thread Matty Sarro
That explains it perfectly, thanks you! On Wed, Mar 31, 2010 at 12:40 AM, Tommy Pham tommy...@gmail.com wrote: On Tue, Mar 30, 2010 at 9:22 PM, Matty Sarro msa...@gmail.com wrote: Hey all! This is probably my second post on the list, so please be gentle. Right now I am running through

Re: [PHP] another question on setting include paths for a project

2010-03-24 Thread Richard Quadling
On 23 March 2010 16:39, Robert P. J. Day rpj...@crashcourse.ca wrote: On Tue, 23 Mar 2010, Richard Quadling wrote: However you want to identify the location, the autoloading techniques will allow you to only need to identify the location once. As compared to every file meticulously

Re: [PHP] another question on setting include paths for a project

2010-03-23 Thread Robert P. J. Day
On Mon, 22 Mar 2010, Nilesh Govindarajan wrote: What I do is, set the include path in the top-level bootstrapper. /bootstrap.php: set_include_path(dirname(__FILE__) . '/lib' . PATH_SEPARATOR . get_include_path()); Then I load the autoloader from /lib/autoload.php at the time of bootstrap.

Re: [PHP] another question on setting include paths for a project

2010-03-23 Thread Richard Quadling
On 23 March 2010 13:11, Robert P. J. Day rpj...@crashcourse.ca wrote: On Mon, 22 Mar 2010, Nilesh Govindarajan wrote: What I do is, set the include path in the top-level bootstrapper. /bootstrap.php: set_include_path(dirname(__FILE__) . '/lib' . PATH_SEPARATOR . get_include_path()); Then

Re: [PHP] another question on setting include paths for a project

2010-03-23 Thread Robert P. J. Day
On Tue, 23 Mar 2010, Richard Quadling wrote: However you want to identify the location, the autoloading techniques will allow you to only need to identify the location once. As compared to every file meticulously maintaining relative links to files. So, for testing, would this not work?

[PHP] another question on setting include paths for a project

2010-03-22 Thread Robert P. J. Day
to recap regarding an earlier question i asked regarding extending include paths, i have an existing project (call it proj currently all under a top-level directory also named proj) which can be SVN checked out anywhere under a user's home directory. so in my case, i might have my svn working

Re: [PHP] another question on setting include paths for a project

2010-03-22 Thread Richard Quadling
On 22 March 2010 14:18, Robert P. J. Day rpj...@crashcourse.ca wrote:  to recap regarding an earlier question i asked regarding extending include paths, i have an existing project (call it proj currently all under a top-level directory also named proj) which can be SVN checked out anywhere

Re: [PHP] another question on setting include paths for a project

2010-03-22 Thread Robert P. J. Day
On Mon, 22 Mar 2010, Richard Quadling wrote: Depending upon what is being included, an autoloader could help here. The main payoffs for autoloading are reduced memory footprint (class are loaded JIT) and no need for each class to know exactly where the other classes are. So, your main

Re: [PHP] another question on setting include paths for a project

2010-03-22 Thread Nilesh Govindarajan
On 03/22/2010 07:48 PM, Robert P. J. Day wrote: to recap regarding an earlier question i asked regarding extending include paths, i have an existing project (call it proj currently all under a top-level directory also named proj) which can be SVN checked out anywhere under a user's home

Re: [PHP] another question on setting include paths for a project

2010-03-22 Thread Paul M Foster
On Mon, Mar 22, 2010 at 10:51:38AM -0400, Robert P. J. Day wrote: On Mon, 22 Mar 2010, Richard Quadling wrote: Depending upon what is being included, an autoloader could help here. The main payoffs for autoloading are reduced memory footprint (class are loaded JIT) and no need for

Re: [PHP] another question on setting include paths for a project

2010-03-22 Thread la...@garfieldtech.com
On 3/22/10 10:25 AM, Paul M Foster wrote: That's the key. You can do anything you want inside __autoload(). If you must consult something in the environment, there are a couple of ways to do it. First, set a variable in the $_SESSION array, and consult it in __autoload(). Second, use a

Re: [PHP] another question on setting include paths for a project

2010-03-22 Thread Richard Quadling
On 22 March 2010 15:28, la...@garfieldtech.com la...@garfieldtech.com wrote: On 3/22/10 10:25 AM, Paul M Foster wrote: That's the key. You can do anything you want inside __autoload(). If you must consult something in the environment, there are a couple of ways to do it. First, set a variable

Re: [PHP] another question on setting include paths for a project

2010-03-22 Thread Richard Quadling
On 22 March 2010 14:51, Robert P. J. Day rpj...@crashcourse.ca wrote: On Mon, 22 Mar 2010, Richard Quadling wrote: Depending upon what is being included, an autoloader could help here. The main payoffs for autoloading are reduced memory footprint (class are loaded JIT) and no need for each

Fwd: Re: [PHP] another question on setting include paths for a project

2010-03-22 Thread Jochem Maas
oops, mailed the OP direct rather than the list. sorry. Originele bericht Onderwerp: Re: [PHP] another question on setting include paths for a project Datum: Mon, 22 Mar 2010 15:58:28 + Van: Jochem Maas joc...@iamjochem.com Aan: Robert P. J. Day rpj...@crashcourse.ca Op 3

[PHP] Dumb Question - Casting

2010-02-18 Thread Chuck
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 8? $a = (int) (0.1 +0.7); echo $a\n; $x = (int) ((0.1 + 0.7) * 10); echo $x\n; $y = (int) (8); echo $y\n;

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Ashley Sheridan
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 8? $a = (int) (0.1 +0.7); echo $a\n; $x = (int) ((0.1 + 0.7)

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Andrew Ballard
On Thu, Feb 18, 2010 at 10:50 AM, Ashley Sheridan a...@ashleysheridan.co.uk 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

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Daniel Egeberg
On Thu, Feb 18, 2010 at 16:47, Chuck chuck.car...@gmail.com 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 8? $a = (int) (0.1 +0.7); echo $a\n; $x =

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Joseph Thayne
According to the PHP manual using the same expression, Never cast an unknown fraction to integer, as this can sometimes lead to unexpected results. My guess is that since it is an expression of floating points, that the result is not quite 8 (for whatever reason). Therefore, it is rounded

Re: [PHP] Dumb Question - Casting

2010-02-18 Thread Nathan Rixham
Daniel Egeberg wrote: On Thu, Feb 18, 2010 at 16:47, Chuck chuck.car...@gmail.com 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 8? $a = (int) (0.1 +0.7);

Re: [PHP] SQL question

2010-01-27 Thread Skip Evans
Kim Madsen wrote: But Skip, as the others say, use a date class, since you're passing a php var on to the SQL anyway, then you could determine the exact days from start to end of donation. Combine this with to_days and you have your solution Yes, this sounds like the best way to go.

[PHP] Re: Question on XML/XSL/PHP/MySQL

2010-01-27 Thread Nathan Rixham
Ryan Park wrote: Hypothetically say that I have MySQL with petabytes of data. I want to use XSL as my template language. But in order to use XSL, I need to make XML filled with petabytes of data. This does not sound elaborate way to use XSL/XML; I would rather use PHP/MySQL/Smarty. Is there a

Re: [PHP] SQL question

2010-01-26 Thread tedd
At 9:54 PM -0600 1/25/10, Skip Evans wrote: Hey all, I have an SQL query that's stumping me. I have two date variables, $start and $end that are in mm/dd/ format and two database fields, start_date and no_donations. The start date is mm/dd/ format and no_donations is an integer that

Re: [PHP] SQL question

2010-01-26 Thread Kim Madsen
Michael A. Peters wrote on 26/01/2010 06:04: I use seconds from epoch in the database simply because it works so well with the php date() function. If you need something where Julian day really is better, I assume it isn't that hard to convert between posix and julian day, though it seems

[PHP] SQL question

2010-01-25 Thread Skip Evans
Hey all, I have an SQL query that's stumping me. I have two date variables, $start and $end that are in mm/dd/ format and two database fields, start_date and no_donations. The start date is mm/dd/ format and no_donations is an integer that represents the number of months from

Re: [PHP] SQL question

2010-01-25 Thread Paul M Foster
On Mon, Jan 25, 2010 at 09:54:40PM -0600, Skip Evans wrote: Hey all, I have an SQL query that's stumping me. I have two date variables, $start and $end that are in mm/dd/ format and two database fields, start_date and no_donations. The start date is mm/dd/ format and no_donations

Re: [PHP] SQL question

2010-01-25 Thread Michael A. Peters
Paul M Foster wrote: Typically, coders try to store dates in unix timestamps internally, and then add 86400 seconds for every day to calculate intervals and such. This is often inaccurate. Julian days are far more accurate.) Paul I use seconds from epoch in the database simply because it

Re: [PHP] SQL question

2010-01-25 Thread Michael A. Peters
Michael A. Peters wrote: If you need something where Julian day really is better, I assume it isn't that hard to convert between posix and julian day, though it seems odd to me that it isn't part of the date() function. It probably should be. Looks like unixtojd() and jdtounix() do it.

[PHP] Re: First time PHP user question

2010-01-07 Thread Nathan Rixham
Rick Dwyer wrote: Hello List. I have been playing around with PHP, running a few tutorials and I came across an error message I could not resolve. The tutorial is Generating One Time URL's by Oreilly: http://www.oreillynet.com/pub/a/php/2002/12/05/one_time_URLs.html Basically the PHP

Re: [PHP] Re: First time PHP user question

2010-01-07 Thread Ashley Sheridan
On Thu, 2010-01-07 at 09:19 +, Nathan Rixham wrote: Rick Dwyer wrote: Hello List. I have been playing around with PHP, running a few tutorials and I came across an error message I could not resolve. The tutorial is Generating One Time URL's by Oreilly:

Re: [PHP] Re: First time PHP user question

2010-01-07 Thread Rick Dwyer
Thanks Ashley Nathan. As it turns out, there is more than one tmp folder... and I was looking in the wrong one. When I SSH'd in the correct one, I created the missing file and it began to work properly. Thanks for chiming in. --Rick On Jan 7, 2010, at 7:58 AM, Ashley Sheridan wrote:

Re: [PHP] Re: First time PHP user question

2010-01-07 Thread Ashley Sheridan
On Thu, 2010-01-07 at 08:32 -0500, Rick Dwyer wrote: Thanks Ashley Nathan. As it turns out, there is more than one tmp folder... and I was looking in the wrong one. When I SSH'd in the correct one, I created the missing file and it began to work properly. Thanks for chiming in.

Re: [PHP] Re: First time PHP user question

2010-01-07 Thread Jim Lucas
Ashley Sheridan wrote: On Thu, 2010-01-07 at 08:32 -0500, Rick Dwyer wrote: Thanks Ashley Nathan. As it turns out, there is more than one tmp folder... and I was looking in the wrong one. When I SSH'd in the correct one, I created the missing file and it began to work properly.

[PHP] [php] Question about jsmin-php code

2009-12-29 Thread hack988 hack988
I'm see some code from jsmin-php like follow: ?php error_reporting(E_STRICT); fwrite(STDERR, memory_get_peak_usage(true).\n); require './jsmin.php'; echo JSMin::minify(file_get_contents('ext-all-debug.js')); fwrite(STDERR, memory_get_peak_usage(true).\n); ? I have some question about code

Re: [PHP] [php] Question about jsmin-php code

2009-12-29 Thread Daniel Egeberg
On Tue, Dec 29, 2009 at 12:07, hack988 hack988 hack...@dev.htwap.com wrote: I have some question about code 1.what is E_STRICT error level mean?I'm found an explain at http://www.php.net/manual/en/errorfunc.constants.php but i don't understand which situation need this level? E_STRICT is an

Re: [PHP] Noob question: Making search results clickable.

2009-11-20 Thread Nathan Rixham
Ford, Mike wrote: -Original Message- From: Nisse Engström [mailto:news.nospam.0ixbt...@luden.se] Sent: 19 November 2009 14:54 To: php-general@lists.php.net Subject: Re: [PHP] Noob question: Making search results clickable. On Wed, 18 Nov 2009 10:31:59 -0500, Paul M Foster wrote

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Nisse Engström
On Wed, 18 Nov 2009 10:31:59 -0500, Paul M Foster wrote: Replace your query with: SELECT title, id FROM videos WHERE topid1 = '$topic' or whatever index you have to select a particular video from your table. Replace your echo statement above with: echo a

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Paul M Foster
On Thu, Nov 19, 2009 at 03:53:55PM +0100, Nisse Engström wrote: On Wed, 18 Nov 2009 10:31:59 -0500, Paul M Foster wrote: Replace your query with: SELECT title, id FROM videos WHERE topid1 = '$topic' or whatever index you have to select a particular video from your table. Replace

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Ashley Sheridan
On Thu, 2009-11-19 at 10:09 -0500, Paul M Foster wrote: On Thu, Nov 19, 2009 at 03:53:55PM +0100, Nisse Engström wrote: On Wed, 18 Nov 2009 10:31:59 -0500, Paul M Foster wrote: Replace your query with: SELECT title, id FROM videos WHERE topid1 = '$topic' or whatever index

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Paul M Foster
On Thu, Nov 19, 2009 at 03:07:42PM +, Ashley Sheridan wrote: On Thu, 2009-11-19 at 10:09 -0500, Paul M Foster wrote: snip Ahem. You are correct. I should have escaped the double quotes. I've *never* made this kind of mistake before. ;-} Paul -- Paul M.

RE: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Ford, Mike
-Original Message- From: Nisse Engström [mailto:news.nospam.0ixbt...@luden.se] Sent: 19 November 2009 14:54 To: php-general@lists.php.net Subject: Re: [PHP] Noob question: Making search results clickable. On Wed, 18 Nov 2009 10:31:59 -0500, Paul M Foster wrote: Replace your

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Bastien Koert
On Thu, Nov 19, 2009 at 11:46 AM, Paul M Foster pa...@quillandmouse.com wrote: On Thu, Nov 19, 2009 at 03:07:42PM +, Ashley Sheridan wrote: On Thu, 2009-11-19 at 10:09 -0500, Paul M Foster wrote: snip     Ahem. You are correct. I should have escaped the double quotes. I've    

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Nisse Engström
On Thu, 19 Nov 2009 17:02:53 -, Ford, Mike wrote: -Original Message- From: Nisse Engström [mailto:news.nospam.0ixbt...@luden.se] Without actually checking, I don't think $row[...] is going to work in double quoted strings. I'm pretty sure it needs to be in braces. You also need

Re: [PHP] Noob question: Making search results clickable.

2009-11-19 Thread Nisse Engström
On Thu, 19 Nov 2009 15:07:42 +, Ashley Sheridan wrote: On Thu, 2009-11-19 at 10:09 -0500, Paul M Foster wrote: Ahem. You are correct. I should have escaped the double quotes. I've *never* made this kind of mistake before. ;-} Gonna go to PHP hell for that faux pas! I'll see you both

[PHP] Noob question: Making search results clickable.

2009-11-18 Thread Paul Jinks
Hi all I'm building a fairly basic php/mySql site but I'm running into problems due to my total lack of experience. I have a database of videos - each has a title, transcript, description and one or more topics. So far I can search the database by topic (using a drop-down menu), like this: ?php

Re: [PHP] Noob question: Making search results clickable.

2009-11-18 Thread Gary Smith
Paul Jinks wrote: Hi all I'm building a fairly basic php/mySql site but I'm running into problems due to my total lack of experience. I have a database of videos - each has a title, transcript, description and one or more topics. So far I can search the database by topic (using a drop-down

Re: [PHP] Noob question: Making search results clickable.

2009-11-18 Thread Paul M Foster
On Wed, Nov 18, 2009 at 03:04:13PM +, Paul Jinks wrote: Hi all I'm building a fairly basic php/mySql site but I'm running into problems due to my total lack of experience. I have a database of videos - each has a title, transcript, description and one or more topics. So far I can

Re: [PHP] Noob question: Making search results clickable.

2009-11-18 Thread Shawn McKenzie
Gary Smith wrote: Paul Jinks wrote: Hi all I'm building a fairly basic php/mySql site but I'm running into problems due to my total lack of experience. I have a database of videos - each has a title, transcript, description and one or more topics. So far I can search the database by topic

Re: [PHP] Noob question: Making search results clickable.

2009-11-18 Thread Gary Smith
Shawn McKenzie wrote: Gary Smith wrote: And changing your query accordingly. For the first piece Gary has it right, but your query needs to include the id also. Yeah, as I mentioned, he'd need to change the query accordingly, either to select id,title or select * Cheers, Gary

Re: [PHP] Noob question: Making search results clickable.

2009-11-18 Thread Shawn McKenzie
Make sure to reply all... Paul Jinks wrote: Thanks to everyone for replying, it's much appreciated. Thanks especially for the final piece of the puzzle, Shawn, I don't think I was going to find it on my own - the display I have in mind is a little different, but I think I can figure it out.

Re: [PHP] Imagick question

2009-11-05 Thread Ashley M. Kirchner
Brady Mitchell wrote: I'm sure it can be done, but without seeing your code we can't really help. Easily solved. From the PHP manual (http://www.php.net/manual/en/function.imagick-roundcorners.php): ?php $image = new Imagick(); $image-newPseudoImage(100, 100,

Re: [PHP] Imagick question

2009-11-05 Thread Ashley Sheridan
On Thu, 2009-11-05 at 12:22 -0700, Ashley M. Kirchner wrote: Brady Mitchell wrote: I'm sure it can be done, but without seeing your code we can't really help. Easily solved. From the PHP manual (http://www.php.net/manual/en/function.imagick-roundcorners.php): ?php

Re: [PHP] Imagick question

2009-11-05 Thread Ashley M. Kirchner
Ashley Sheridan wrote: Fill the background with white before you create the corners. Well, I tried that, with no luck. This is my actual code: $width = 150; $height = 150; $im = new Imagick('original/' . $filename); $im-thumbnailImage($width, $height, true);

Re: [PHP] Newb question about getting keys/values from a single array element

2009-10-09 Thread tedd
At 6:08 PM -0700 10/8/09, Daevid Vincent wrote: I feel like a total newb asking this, but I'm just having a brain fart or something... I'm writing a page where I can either get back a list of items: Array { [1233] = apple, [6342] = apricot, [2345] =

[PHP] Newb question about getting keys/values from a single array element

2009-10-08 Thread Daevid Vincent
I feel like a total newb asking this, but I'm just having a brain fart or something... I'm writing a page where I can either get back a list of items: Array { [1233] = apple, [6342] = apricot, [2345] = banana, ... } where the user then

Re: [PHP] Newb question about getting keys/values from a single array element

2009-10-08 Thread Jonathan Tapicer
One possible solution: ?php $a = array(8575 = 'peach'); list($id, $name) = array_merge(array_keys($a), array_values($a)); echo The ID is $id and the name is $name; ? Prints: The ID is 8575 and the name is peach. Regards, Jonathan On Thu, Oct 8, 2009 at 10:08 PM, Daevid Vincent

Re: [PHP] Newb question about getting keys/values from a single array element

2009-10-08 Thread Paul M Foster
On Thu, Oct 08, 2009 at 06:08:48PM -0700, Daevid Vincent wrote: I feel like a total newb asking this, but I'm just having a brain fart or something... I'm writing a page where I can either get back a list of items: Array { [1233] = apple, [6342] = apricot,

[PHP] Developer Question [DOMDocument]

2009-10-05 Thread Michael A. Peters
I'm hoping someone who knows the answer to this question is on this list. I need to modify either libxml2 and/or php DOMDocument to make a small change. Issue - saveHTML() function predates html5 (which isn't even finalized yet) and thus does not know about it's tags. the source element is

Re: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Ashley Sheridan
On Mon, 2009-10-05 at 01:45 -0700, Michael A. Peters wrote: I'm hoping someone who knows the answer to this question is on this list. I need to modify either libxml2 and/or php DOMDocument to make a small change. Issue - saveHTML() function predates html5 (which isn't even finalized

Re: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Michael A. Peters
Ashley Sheridan wrote: I've not had a look at DOMDocument myself, having only used DomDocument before (there's a slight difference in the capitalisation of the 2nd and 3rd letters which made it a pain in the proverbial to work with at first!) but I would assume that if it might offer a

Re: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Michael A. Peters
Michael A. Peters wrote: Ashley Sheridan wrote: I've not had a look at DOMDocument myself, having only used DomDocument before (there's a slight difference in the capitalisation of the 2nd and 3rd letters which made it a pain in the proverbial to work with at first!) but I would assume

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Andrea Giammarchi
: mpet...@mac.com To: php-general@lists.php.net Subject: [PHP] Developer Question [DOMDocument] I'm hoping someone who knows the answer to this question is on this list. I need to modify either libxml2 and/or php DOMDocument to make a small change. Issue - saveHTML() function predates

Re: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Lupus Michaelis
Ashley Sheridan wrote: I've not had a look at DOMDocument myself, having only used DomDocument before (there's a slight difference in the capitalisation of the 2nd and 3rd letters which made it a pain in the proverbial to work with at first!) Did you never notice that PHP has case

Re: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Ashley Sheridan
On Mon, 2009-10-05 at 13:36 +0200, Lupus Michaelis wrote: Ashley Sheridan wrote: I've not had a look at DOMDocument myself, having only used DomDocument before (there's a slight difference in the capitalisation of the 2nd and 3rd letters which made it a pain in the proverbial to work

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Andrea Giammarchi
search engines aren't case-sensitive! ... try to search php.net or PHP.NET in Google and you'll obtain exactly the same result ... in PHP strtolower and strToLower are exactly the same, as the same is DomDocument, DOMDocument, or DOMDOCUMENT, at least in PHP 5.3 If you used an early

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Andrea Giammarchi
: [PHP] Developer Question [DOMDocument] search engines aren't case-sensitive! ... try to search php.net or PHP.NET in Google and you'll obtain exactly the same result ... in PHP strtolower and strToLower are exactly the same, as the same is DomDocument, DOMDocument, or DOMDOCUMENT

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Ashley Sheridan
On Mon, 2009-10-05 at 13:59 +0200, Andrea Giammarchi wrote: search engines aren't case-sensitive! ... try to search php.net or PHP.NET in Google and you'll obtain exactly the same result ... in PHP strtolower and strToLower are exactly the same, as the same is DomDocument,

RE: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Andrea Giammarchi
2009 13:11:12 +0100 Subject: RE: [PHP] Developer Question [DOMDocument] On Mon, 2009-10-05 at 13:59 +0200, Andrea Giammarchi wrote: search engines aren't case-sensitive! ... try to search php.net or PHP.NET in Google and you'll obtain exactly the same result ... in PHP

Re: [PHP] Developer Question [DOMDocument]

2009-10-05 Thread Michael A. Peters
Ashley Sheridan wrote: I never tried to say that classes are case-sensitive, that was actually mentioned by Lupus who misunderstood what I was trying to say. What I was meaning is exactly what you just said here, that the PECL DomDocument is very different from the more typical DOMDocument. I

Re: [PHP] Parse Question Using list()

2009-10-02 Thread Gerardo Benitez
Use the tool that PHP provides for such problems. http://php.net/fgetcsv fgetcsv is very useful, here a example: ?php $row = 1; /* load file*/ $handle = fopen(log.csv, r); /* read line by line */ while (($data = fgetcsv($handle, 1000, ,)) !== FALSE) { $num = count($data); echo p

[PHP] Parse Question Using list()

2009-10-01 Thread c...@hosting4days.com
newbie import csv question file is like: stuff1,stuff2,stuff3 stuff1,stuff2,stuff3 stuff1,stuff2,stuff3 stuff1,stuff2,stuff3 etc. Problem: when I try to parse out the 3 fields and display them using list() it just gets just 1st char of each field ... Q: How do I get it to set $col1 - 2

Re: [PHP] Parse Question Using list()

2009-10-01 Thread Ben Dunlap
$line = fgets($handle); list($col1, $col2, $col3) = $line; [8] echo c1 is $col1 and c2 is $col2 and c3 is $col3.'br'; // this shows just 1st char of each field That's odd, I would have expected $col1, $col2, and $col3 to be NULL. That's what I get when I try to assign a string to list(). It

Re: [PHP] Parse Question Using list()

2009-10-01 Thread c...@hosting4days.com
On Oct 1, 2009, at 5:02 PM, Ben Dunlap wrote: You could tackle this in a couple of different ways. Either split your string into an array first: $line = fgets($handle); $columns = explode(,, trim($line)); Thanks Ben - the explode() command worked great! - Now a bit of another

Re: [PHP] Parse Question Using list()

2009-10-01 Thread Jim Lucas
c...@hosting4days.com wrote: On Oct 1, 2009, at 5:02 PM, Ben Dunlap wrote: You could tackle this in a couple of different ways. Either split your string into an array first: $line = fgets($handle); $columns = explode(,, trim($line)); Thanks Ben - the explode() command worked great! Use

Re: [PHP] nl2br() question

2009-09-26 Thread tedd
At 11:27 AM -0400 9/26/09, Daniel Brown wrote: On Sat, Sep 26, 2009 at 11:22, tedd t...@sperling.com wrote: I am using PHP Version 5.2.10 whereas the `is_xhtml` parameter was added in 5.3.0. And 5.3.0 5.2.10. ;-P -- /Daniel P. Brown Ahhh, I didn't look far enough down the

Re: [PHP] nl2br() question

2009-09-26 Thread Daniel Brown
On Sat, Sep 26, 2009 at 11:22, tedd t...@sperling.com wrote: Hi gang: The manual says:   http://www.php.net/nl2br That I could use the function like so (Example #2):   $new = nl2br($string, false); But when I do, I get:   Warning: Wrong parameter count for nl2br() in /home... What's

RE: [PHP] nl2br() question

2009-09-26 Thread HallMarc Websites
Tedd, -Original Message- From: tedd [mailto:t...@sperling.com] Sent: Saturday, September 26, 2009 11:23 AM To: PHP General List Subject: [PHP] nl2br() question Hi gang: The manual says: http://www.php.net/nl2br That I could use the function like so (Example #2

[PHP] nl2br() question

2009-09-26 Thread tedd
Hi gang: The manual says: http://www.php.net/nl2br That I could use the function like so (Example #2): $new = nl2br($string, false); But when I do, I get: Warning: Wrong parameter count for nl2br() in /home... What's up with that? I am using PHP Version 5.2.10 Cheers, tedd --

Re: [PHP] nl2br() question

2009-09-26 Thread Ashley Sheridan
On Sat, 2009-09-26 at 11:22 -0400, tedd wrote: Hi gang: The manual says: http://www.php.net/nl2br That I could use the function like so (Example #2): $new = nl2br($string, false); But when I do, I get: Warning: Wrong parameter count for nl2br() in /home... What's

[PHP] Re: Question: Sorting through table headers?

2009-09-14 Thread Tony Marston
What you are trying to do is ridiculously easy, and something which I accomplished years ago. Basically every column heading needs to be output as a hyperlink which repeats the current page with the addition of orderby=column_name in the URL. This information appears in the $_GET array, so you

Re: [PHP] Re: Question: Sorting through table headers?

2009-09-14 Thread Marcus Gnaß
Tony Marston wrote: You cannot do this in a separate class as it requires action in both the presentation (UI) and data access layers, and a single class is not allowed to operate in more than one layer. You can, but you shouldn't if you want to write your classes according to the MVC

Re: [PHP] Re: Question: Sorting through table headers?

2009-09-14 Thread Bastien Koert
On Mon, Sep 14, 2009 at 3:29 PM, Marcus Gnaß gona...@gmx.de wrote: Tony Marston wrote: You cannot do this in a separate class as it requires action in both the presentation (UI) and data access layers, and a single class is not allowed to operate in more than one layer. You can, but you

Re: [PHP] Re: Question: Sorting through table headers?

2009-09-14 Thread Bastien Koert
On Mon, Sep 14, 2009 at 3:57 PM, Bastien Koert phps...@gmail.com wrote: On Mon, Sep 14, 2009 at 3:29 PM, Marcus Gnaß gona...@gmx.de wrote: Tony Marston wrote: You cannot do this in a separate class as it requires action in both the presentation (UI) and data access layers, and a single class

[PHP] htaccess question

2009-09-11 Thread tedd
Hi gang: Is there a way I can use a htaccess directive to require a php script to be included within each file contained within that directory? For example, let's say I have a directory with 100 scripts in it, but I want each script within that directory to pass through an authorization

Re: [PHP] htaccess question

2009-09-11 Thread Sudheer Satyanarayana
Is there a way I can use a htaccess directive to require a php script to be included within each file contained within that directory? For example, let's say I have a directory with 100 scripts in it, but I want each script within that directory to pass through an authorization script

Re: [PHP] htaccess question

2009-09-11 Thread J DeBord
On Fri, Sep 11, 2009 at 4:46 PM, tedd t...@sperling.com wrote: Hi gang: Is there a way I can use a htaccess directive to require a php script to be included within each file contained within that directory? For example, let's say I have a directory with 100 scripts in it, but I want each

[PHP] Beginner question

2009-08-25 Thread mike bode
I am trying to use PHP on my web site I am developing now. I have installed Apache 2.2 and PHP 5.2. My problem is that I can execute PHP code embedded in my HTML code, but I can't execute the same cose when I put it into a separate .php file that i then call from within the html code. for

Re: [PHP] Beginner question

2009-08-25 Thread Ashley Sheridan
On Mon, 2009-08-24 at 23:16 -0600, mike bode wrote: I am trying to use PHP on my web site I am developing now. I have installed Apache 2.2 and PHP 5.2. My problem is that I can execute PHP code embedded in my HTML code, but I can't execute the same cose when I put it into a separate .php

RE: [PHP] Beginner question

2009-08-25 Thread abdulazeez alugo
To: php-general@lists.php.net From: mikebo...@hotmail.com Date: Mon, 24 Aug 2009 23:16:02 -0600 Subject: [PHP] Beginner question I am trying to use PHP on my web site I am developing now. I have installed Apache 2.2 and PHP 5.2. My problem is that I can execute PHP code embedded

Re: [PHP] Beginner question

2009-08-25 Thread mike bode
Well, as I said: Beginner ... I am actually trying to implement some html code that I found on the web, which uses php (see: http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm). They use the method I tried to call a function php and then display a photo album. Well, that doesn't

Re: [PHP] security question of ZCE exam

2009-08-25 Thread Daniel Brown
On Tue, Aug 25, 2009 at 00:07, Augusto Flavioafla...@gmail.com wrote: Answers: (choose 2)    Error messages will contain sensitive session information    Error messages can contain cross site scripting attacks    Security risks involved in logging are handled by PHP X    Error messages give

RE: [PHP] Beginner question

2009-08-25 Thread Arno Kuhl
-Original Message- From: mike bode [mailto:mikebo...@hotmail.com] Sent: 25 August 2009 07:16 AM To: php-general@lists.php.net Subject: [PHP] Beginner question I am trying to use PHP on my web site I am developing now. I have installed Apache 2.2 and PHP 5.2. My problem is that I can

Re: [PHP] Beginner question

2009-08-25 Thread tedd
At 11:16 PM -0600 8/24/09, mike bode wrote: I get a blank page. this is probably something really stupid, but I have been wrecking my head for days now, and I can't figure it out. anybody has an idea? Mike: Here's an idea -- try this: http://sperling.com/examples/include-demo/ If you

Re: [PHP] Beginner question

2009-08-25 Thread mike bode
Thanks. I will surely do that. In the meantime I have found out that it really is not a problem with the code. I uploaded the (non-functioning code) from my PC to a public web server, and lo and behold, the code works. It thus appears that there is something wrong with my php-apache setup.

Re: [PHP] Beginner question

2009-08-25 Thread mike bode
news:a6c65a0610f9485787e31f7161cb7...@point01... -Original Message- From: mike bode [mailto:mikebo...@hotmail.com] Sent: 25 August 2009 07:16 AM To: php-general@lists.php.net Subject: [PHP] Beginner question I am trying to use PHP on my web site I am developing now. I have installed Apache

Re: [PHP] Beginner question

2009-08-25 Thread tedd
At 2:45 PM -0600 8/25/09, mike bode wrote: I see. PHP runs on the server and cannot directly interact with my browser, only through Javascript. Kind of. PHP runs on the server and can create html, css, javascript et al. However, PHP will complete it's task before the browser see's anything.

[PHP] security question of ZCE exam

2009-08-24 Thread Augusto Flavio
Hi all, i'm discutting with my friend about this question for 30 min and i do not agree with he. Here is the question: Why is it important from a security perspective to never display PHP error messages directly to the end user, yet always log them? Answers: (choose 2) Error messages

Re: [PHP] DB Question | A hotel reservation scenario

2009-08-20 Thread Behzad
Good questions, I need to talk to the client to determine the exact requirements and specifications. Thank you every one for helping me to figure out the potential db-scheme and for opening my view with your answers :) On Wed, Aug 19, 2009 at 10:39 PM, Bob McConnell r...@cbord.com wrote: From:

<    1   2   3   4   5   6   7   8   9   10   >