Re: [PHP] Uniquely identifying an array... as a key to another array

2009-06-15 Thread Stuart
acheConnector::getInstance() check for > self::$instances[serialize($serverArray)] seems a huge waste of both ram and > CPU time.  Is there a better way? Why not give each set of servers a name? Surely they're grouped together for a reason, so give that reason a name. -Stuart -- http://s

Re: [PHP] Link to .php page with session

2009-06-16 Thread Stuart
te_close [1] function. Note that after calling that you won't be able to make any other changes to the session data in that request. -Stuart [1] http://php.net/session_write_close -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] sloppiness & stupidity

2009-06-17 Thread Stuart
should "fix" it and submit a patch to the documentation team. The only way open source stuff gets better is if you contribute changes when you think something can be improved. And with that I'm off to the zoo for the day! -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] populate form input option dropdown box from existing data

2009-06-17 Thread Stuart
ot work! - al least not > without better explanation. > > And here's another goodie -- I cannot get var_dump() to print out nor > print_r  $selected when there are no categories listed > > This code: > if ( ( $results = mysql_query($sql, $db) ) !== false ) { >        while ( $row = mysql_fetch_assoc($results) ) { >            $selected = ($id == $row['id'] ? 'selected="selected"' : ''); >        echo " ".$selected.">".$row['category'].""; >            } >        } > > works but doesn't highlight the correct categories; > I have checked the db tables and they are correct; > and if I uncomment the var_dump line below --- and the categories are empty, > I get an undefined variable for the $selected: > > // do categories > $sql = "SELECT id, category FROM categories, book_categories >        WHERE book_categories.bookID = '$idIN' && > book_categories.categories_id = categories.id"; >    if ( ( $results = mysql_query($sql, $db) ) >= 0 ) { >        while ( $row = mysql_fetch_assoc($results) ) { >            $selected[] = $row['id']; >            } >        } >    else $selected = ""; > > //var_dump($selected); > > I suspect there is something wrong with the code for the categories for > book id=11 are 6, 14, 20, and 34; but the one field that is highlighted > is 11... hmmm ? > Ok, so I traced it down to this - the highlighting is coming from the id > of the book.id - I fixed that. > But in the end, and I think I have the problem fixed, the highlighting > is definitely lilnked to the the name attribute - in my case it is > categoriesIN[] as that is related to the sessions and the queries in > some mysteious way... :-) Step back from the code and consider the steps you need to perform... 1) Get an array of the categories, ideally in the form $cats[] = categoryname. 2) Get an array of the category IDs that should be selected, i.e. $selectedcats = array(3, 5, 7, 9). 3) Start the HTML select element 4) foreach ($cats as $id => $catname) 5) Determine whether it should be selected. e.g. $selected = (in_array($id, $selectedcats) ? 'selected="selected"' : ''. 6) Output the HTML option element, like $catname, escaping where appropriate. 7) End of loop, job done. If your code doesn't have that structure then you may want to consider starting again. Secondly, check that you're not using the same variable name twice. In one of your previous emails you used $selected to hold the array of selected categories, and in another you used it for the text to be inserted into the option element. The latter will blat over the former leading to no more than 1 option selected, and even then only if it's the first option displayed. If you're still stuck please post more of your code in a single chunk including all the elements in my step-by-step above. The snippets you're currently posting are not giving us enough context to spot even the most common mistakes. And if anyone cares... the zoo was great!! -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Disclaimer

2009-06-17 Thread Stuart
2009/6/17 Daniel Brown : > On Wed, Jun 17, 2009 at 10:37, Jay Blanchard wrote: >> >> Whoa! Totally unintentional dude! > >    DON'T PANIC! Mr Mannering! What do you mean it's the wrong reference? &Mr Mannering! Better? (sorry, it's late!) -Stuart --

Re: [PHP] Disclaimer

2009-06-17 Thread Stuart
2009/6/18 Ashley Sheridan : > On Thu, 2009-06-18 at 01:06 +0100, Stuart wrote: >> 2009/6/17 Daniel Brown : >> > On Wed, Jun 17, 2009 at 10:37, Jay Blanchard wrote: >> >> >> >> Whoa! Totally unintentional dude! >> > >> >    DON'T

Re: [PHP] populate form input option dropdown box from existing data

2009-06-17 Thread Stuart
ead put $selected = array(); before the mysql_query line. Not sure why you want an element 0 => '0' in there, I'm guessing it's one of your attempts to get rid of the notice. > Problem #2) in the second query, the selected is in the source code but > it is not highlited. Several times I did get the categories highlighted, > but I could never catch what it was that made it work. Can you post the HTML you're getting for this select using the above code. If the selected attributes are in the code correctly then there must be a syntax error in there somewhere and the easiest way to find it will be by looking at the HTML. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] populate form input option dropdown box from existing data

2009-06-18 Thread Stuart
2009/6/18 PJ : > Stuart wrote: >> 2009/6/18 PJ : >> >>> I snipped to make it short... continue at bottom... >>> >>>> Step back from the code and consider the steps you need to perform... >>>> >>>> 1) Get an array of the categori

Re: [PHP] populate form input option dropdown box from existing data

2009-06-18 Thread Stuart
uld work... or am I >>     supposed to know something that is not clear in the examples... ? >> >> >>     -- >>     Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." >>     ----- >>  

Re: [PHP] isset question

2009-06-18 Thread Stuart
rt\n" : " "; > > I get > > The mortgage amount is > > What am I missing here? A variable "isset" even if it's empty. Either compare it to an empty string or test the result from strlen against 0. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] CSV file

2009-06-24 Thread Stuart
Do it in bytes rather than lines, then you don't waste time loading the file twice and you'll get the same end result. -Stuart -- http://stut.net/ > On Wed, Jun 24, 2009 at 11:12 AM, Richard Heyes wrote: >> Hi, >> >>> You can read the whole file (file_get_content

Re: [PHP] Re: Progressbar

2009-06-25 Thread Stuart
tudio took a major leap downhill when they switched to the Eclipse platform which is why I no longer use it. Take a look by all means, but don't get your hopes up. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Progressbar

2009-06-25 Thread Stuart
2009/6/25 Eddie Drapkin : > On Thu, Jun 25, 2009 at 9:58 AM, Stuart wrote: >> 2009/6/25 tedd : >>> At 8:30 AM +0100 6/25/09, Colin Guthrie wrote: >>>> >>>> 'Twas brillig, and tedd at 24/06/09 15:24 did gyre and gimble: >>>>> >>&

Re: [PHP] Re: Progressbar

2009-06-25 Thread Stuart
2009/6/25 Eddie Drapkin : > On Thu, Jun 25, 2009 at 10:29 AM, Stuart wrote: >> 2009/6/25 Eddie Drapkin : >>> On Thu, Jun 25, 2009 at 9:58 AM, Stuart wrote: >>>> 2009/6/25 tedd : >>>>> At 8:30 AM +0100 6/25/09, Colin Guthrie wrote: >>>>>

Re: [PHP] Socket error

2009-06-28 Thread Stuart
create a listening socket server that binds to a port on the > local machine. > > Thanks in advance for any help! What port are you trying to bind to? If it's <= 1024 then you need to run it as a privileged user. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Managed job chains

2009-06-30 Thread Stuart
et support for that. Log in to the Zend website and raise a support ticket. However, this particular error message is pretty self-explanatory - your PHP installation does not have the domxml extension installed, so you need to install it. How to do that depends greatly on how your server is set up

Re: [PHP] exasperated again - shot in the foot

2009-07-01 Thread Stuart
In general this is known as defensive programming. Never assume anything, handle every eventuality you can think of including the "this will never happen" cases, and always make sure you have a catch-all for stuff you can't think of. Learn to do this early and you'll hav

Re: [PHP] my first order job on manages jobs

2009-07-01 Thread Stuart
gt; 5. >        Here also I found that the job chain and order are in red color with > "x" mark on it. > > Please advice me to get rid of all these errors and get success in executing > this sample program. This would appear to be relating to a specific product and not PHP in ge

Re: [PHP] Sessions

2009-07-03 Thread Stuart
file to server side include a file file to all >> files under an admin folder or something and another to destroy the >> session. I'm thinking of smaller, low-traffic sites. >> I know people are going to say, if they're small sites, why can't you only >>

Re: [PHP] Writing to a file

2009-07-03 Thread Stuart
"username"; > $password = "password"; > > ?> > > How would I go about adding stuff at the end of the file, but before the > ?> tag? Remove the ?> tag - it's not required if it's the last thing in the file. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] exasperated again

2009-07-04 Thread Stuart
development area and "you will see the errors of >>>> your ways..." >>>> >>>> >>> The error reporting is always on as you suggested and I use it all the time. >>> But error reporting cannot report a non-existing error - a human stupid >

Re: [PHP] exasperated again

2009-07-04 Thread Stuart
2009/7/4 PJ : > Stuart wrote: >> 2009/7/4 PJ : >> >>> Ashley Sheridan wrote: >>> >>>> On Sat, 2009-07-04 at 10:47 -0400, PJ wrote: >>>> >>>> >>>>> Jim Lucas wrote: >>>>> >>>>> >

Re: [PHP] Function parameter passed by reference with default value to null

2009-07-06 Thread Stuart
passing a literal value, something you can't do when the function is expecting a reference. See the manual for more info on the null type: http://php.net/null -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Call to object function, want to PHP interpret returned string

2009-07-06 Thread Stuart
2009/7/6 John Allsopp : > David Robley wrote: >> >> John Allsopp wrote: >> >> >>> >>> Hi >>> >>> At the top of a webpage I have: >>> >>> >> include_once("furniture.php"); >>> $myFurniture = new furniture(); >>> echo $myFurniture->getTop("my company title"); >>> ?> >>> >>> to deliver the first lines

Re: [PHP] Function parameter passed by reference with default value to null

2009-07-06 Thread Stuart
2009/7/6 Lupus Michaelis : > Stuart a écrit : > >> You appear to be using the definition of null that comes from the >> world of C. > >  I didn't. The point is I'm allowed to set a default value to null for a > referenced parameter (what I can do in C for a p

Re: [PHP] What is this called?

2009-07-06 Thread Stuart
#x27;re not doing this for display purposes. If you're wanting to lighten the load on the server while you process the 16,000 rows you might want to look into mysql_unbuffered_query which requires a lot less memory than mysql_query. See the manual for details. -Stuart -- http://stut.net/ --

Re: [PHP] Obeying the rules (was Simple login form with cookies)

2009-07-09 Thread Stuart
7;s all been left after someone's contribution) to get the context. Plus it creates an archive that has the same benefit. 3) Feel free to do your own thing because it's a free world, but the minimal respect I had for you after our previous discussions on this list has just been

Re: [PHP] Obeying the rules (was Simple login form with cookies)

2009-07-09 Thread Stuart
you know what the rule/convention is. It's worth noting that bottom-posting without efficient quoting is just as bad IMHO as top-posting. Anyway, it's clear that you're not willing to do the polite thing on this issue, so I don't see any point in continuing to discuss

Re: [PHP] mysql_real_escape_string wants a string or a "resource"?

2009-07-11 Thread Stuart
the first function name. > p.s. what is a "resource" compared to a string? A resource is a variable type. See http://php.net/language.types.resource -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql_real_escape_string wants a string or a "resource"?

2009-07-11 Thread Stuart
a string? >> >> A resource is a variable type. See http://php.net/language.types.resource > > as in a db connection That's one example of a resource, but in general terms it's a reference to an external resource of some sort, specific to a particular extension. -Stu

Re: [PHP] MySql Injection advice

2009-07-11 Thread Stuart
ntation also clearly states. As far as security goes prepared statements offer nothing more than a reasonable and, IMHO, necessary amount of due diligence on the part of the developer will also achieve. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php.ini and cli

2009-07-13 Thread Stuart
restarted for them to see any changes. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Doubts concerning a general Insert method

2009-07-13 Thread Stuart
er goes to the next > (line/element/index)... ? > > We then execute the prepared statement, but I don't get what are we passing > as a param? I mean, what kind of think does the execute PDO method expects > as a param? > Why $stmt->execute($vals); and not only $stmt-&g

Re: [PHP] Doubts concerning a general Insert method

2009-07-13 Thread Stuart
> send the statement to the database). > $stmt->execute(array('animal_name'=>'bruce', 'animal_type'=>'kanguro'). > > So this execute will do A LOT, it will take away the 'array(' part, will see > the keys of these arrays (e.g. animal_name and animal_type) compare them with > the placeholder names given on the prepare statement and, replace the > placeholder names with the values inside on each of this array keys. > > > Is this correct? Indeed. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] why is this SIMPLE elseif not firing?

2009-07-15 Thread Stuart
should: > elseif (($EditExistingClient) || ($CreateClient)) //we just created a > client, OR edited a client > { > echo ''."\n"; > } > > what ridiculously simple thing am I missing? The only possibility I can see is that $EditExistingClient is getting modi

Re: [PHP] why is this SIMPLE elseif not firing?

2009-07-15 Thread Stuart
Oops, clearly too early in the morning to be looking at code. Sorry. -Stuart 2009/7/16 Stuart : > 2009/7/15 Govinda : >> Sorry this is isn't good 'ninja' material..  but I gotta start where I am. >> >> this: >> >> echo 'is set (EditExist

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-18 Thread Stuart
T.  Sometimes hosts allow this file.  If allowed, you will then > be able > to set any php.ini configuration option you want. > > Give it a shot!  What do you have to loose at this point? Lose not loose, and php.ini has no control over what file types get parsed by PHP. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
nation is too tightly coupled to the data source to be separate. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
on my classe Pagination, I will end up, on the Pagination Class, with so > many properties as pagination objects... :s Pagination is the generically applicable class - it should know nothing about what specifically it's paginating. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
this functionality it's as simple as two arguments to the method that gets data, $page and $perpage. Setting both to false would retrieve all rows. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Newbie: Composition by Association - Pagination Class general question.

2009-07-19 Thread Stuart
... } Obviously this is highly simplified but should give you the general idea. If you still don't get it I suggest you find something open source that does pagination (any blogging system should work as an example) and look at the source code. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] need to get .html files parsed by PHP. -- WAS: why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Stuart
nd even if it's clean it certainly doesn't mean your code will be secure. If you really want to hide the fact that you're using PHP you need to make sure that... * You're not using the .php extension * You turn expose_php off in your php.ini * You turn display_errors off in yo

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-19 Thread Stuart
le, it simply echo's anything not inside PHP tags. In general web servers don't know or care about the format of the files they serve. You configure certain extensions to be passed to certain modules, even in the case of something like SSI. The web server itself doesn't usua

Re: [PHP] why does PHP parse "*.html" files in one subdir/ but not in another?

2009-07-20 Thread Stuart
2009/7/19 Paul M Foster : > On Sun, Jul 19, 2009 at 07:18:34PM +0100, Stuart wrote: > >> 2009/7/19 Paul M Foster : >> > On Sun, Jul 19, 2009 at 09:30:33AM +0530, kranthi wrote: >> > >> >> >> >> > You do realize that PHP does not parse HTM

Re: [PHP] Traffic throttling

2009-07-21 Thread Stuart
yte, which let me know to count the REAL  traffic  a > client produce... > > OK, now the script works perfectly and I am able to  delay  the  sending > between two chunks, but what I need is a milisecond timer, because 1s is > definitively to long. > > Is there something in p

Re: [PHP] Renaming all variables in a repository

2009-07-23 Thread Stuart
important thing is not what they are, just that they exist and are observed by everybody. This sounds like a colossal waste of time, whether you can find an automated method or not, for no apparent gain. Seriously, what's the benefit of using camel over underscores? Sounds like a decision made by

Re: [PHP] Re: Dan Brown

2009-08-03 Thread Stuart
Congratulations to you and your wife and best wishes for the future. That's quite a few issues to have to deal with at once and I'm happy to see you emerge from the other side more or less ok. -Stuart 2009/8/3 Daniel Brown : >    ALL: > >    It's far easier to drop a l

Re: [PHP] underscore in php functions?

2009-08-03 Thread Stuart
Could anyone help me? Absolutely. But some developers use it as a convention for private methods or some other indicator. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Calendar Problem

2009-08-12 Thread Stuart
ider Shawn's solutions -- sorry Shawn. > > However, it appears that mine is still the fastest in most test. Check this: > > http://php1.net/b/fridays/ Bit late to this party, but give this a whizz... http://dev.stut.net/php/fridays.php -Stuart -- http://stut.net/ -- PHP Gener

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Stuart
variable did not cause the object to be destructed then it's highly likely that there is another variable somewhere that is holding a reference to that object. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] unset( $anobject) does not invoce __destruct()

2009-08-24 Thread Stuart
s are passed by reference unless explicitly cloned. This means that assigning an object variable to another variable does nothing more than assign a reference and increment the referece count. What exactly in the manual leads you to believe that after the unset the refcount should be 0? -Stuart

Re: [PHP] Re: unset() something that doesn't exist

2009-08-25 Thread Stuart
ong. > "Tom Worster" wrote in message > news:c6b87877.11463%...@thefsb.org... >> is it the case that unset() does not trigger an error or throw an > exception >> if it's argument was never set? Absolutely. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: unset() something that doesn't exist

2009-08-25 Thread Stuart
2009/8/25 Ralph Deffke : > of course its a syntax error, because unset() IS NOT A FUNCTION its a > language construct FFS, stop talking out of your rear end and post line 42 of testCrapp6.php. Or not, your choice. -Stuart -- http://stut.net/ > "Stuart"

Re: [PHP] Re: unset() something that doesn't exist

2009-08-25 Thread Stuart
ction! doen't exist its a language construct > > http://us.php.net/manual/en/function.unset.php Seriously? What part of "expecting something" confuses you? While it is true that it's a language construct and not a function that doesn't mean it's intelligent enough to

Re: [PHP] Re: unset() something that doesn't exist

2009-08-25 Thread Stuart
OP said "is it the case that unset() does not trigger an error or throw an exception if it's argument was never set?". That does not say "if you don't give an argument". Not even close. -Stuart -- http://stut.net/ > ____ > Von

Re: [PHP] Re: unset() something that doesn't exist

2009-08-25 Thread Stuart
2009/8/25 tedd : > At 2:31 PM +0100 8/25/09, Stuart wrote: >> >> Please don't reply directly unless you intend to pay me for my time. >> >> 2009/8/25 Ralph Deffke : >>> >>>  sorry but its about the top topic it say it never does an error if u >&

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

2009-08-26 Thread Stuart
ed to > string in D:\Inetpub\wwwroot\evaluations\lookup2.php on line 176 That error indicates that you're not getting NULL since NULL is easily converted to a string. Try this... $var = $rs->Fields(22); var_dump($var); ...and tell us what you get. -Stuart -- http://stut.net/

Re: [PHP] Re: unset() something that doesn't exist

2009-08-26 Thread Stuart
a reason for the behaviour you were seeing with absolutely nothing to back it up whatsoever. And then, despite being corrected you repeated it. That's what I really objected to - anyone can misunderstand a question, but filling in the blanks from thin air helps nobody. Ever. And

Re: [PHP] Re: unset() something that doesn't exist

2009-08-26 Thread Stuart
2009/8/26 tedd : > At 11:34 PM +0100 8/25/09, Stuart wrote: >> >> 2009/8/25 tedd : >> >>  > I can't believe that you are wasting time on this. This guy is beyond >>> >>>  clueless. >> >> To be fair tedd English is clearly not h

Re: [PHP] Re: unset() something that doesn't exist

2009-08-26 Thread Stuart
2009/8/26 tedd : > At 2:12 PM +0100 8/26/09, Stuart wrote: >> >> 2009/8/26 tedd : >> >>  > And, we all need a holiday... >> >> Apparently a holiday is out of the question, so I've decided to change >> jobs instead. A new environment, that&#

Re: [PHP] parse_ini_file problem

2009-08-27 Thread Stuart
2009/8/26 Richard H Lee : > Hi all, > > I think I'm having a problem with parse_ini_file in php. I am using wamp on > two machines. I'm installing a Digishop e-commerce package. > > The blah.ini.php file starts with > > > > > > [SOMETITLE] > some_setting="Ok, I Have Completed This

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Stuart
1) if (isset($_POST['username'])) // Specific to any given form 2) if (count($_POST) > 0) // Just tests whether any data was POSTed There are other ways to do it but I usually use one of these two. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Stuart
ng day) >> >> if (array_key_exists('username',$_POST)) > > Here is another way > > if (isset($_POST['username'])  && $_POST['username'] != '') > { ... If you use this method then you'll completely ignore a form submission if they've forgotten to enter a username. Detection and validation are two distinct steps and should be treated as such. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Error when execute header('location: otherpage.php') after email been sent out. Any Workaround?

2009-08-28 Thread Stuart
lient understands and will correctly process a 301/302 response is one of the safer assumptions. It's certainly safer than assuming the client will respect a meta tag or javascript. If you really try to deal with every possible client to that extent you'll never ship anything. Yes it's important to be as supportive as possible, but care should be taken to pick the battles that are worth fighting. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Date Comparison

2009-08-28 Thread Stuart
rry, your next evaluation date cannot be in the past, > Click BACK to continue."; >        exit; > > } RTFM. The strtotime function will give you a timestamp, getdate will give you an array, so your comparison is non-sensical. Use the time function to get the current date/time as a t

Re: [PHP] Re: Best way to test for form submission?

2009-08-28 Thread Stuart
2009/8/28 Eric : > > - Original Message - > From: "Stuart" > To: "Eric" > Cc: ; "Adam Jimerson" > Sent: Friday, August 28, 2009 10:10 PM > Subject: Re: [PHP] Re: Best way to test for form submission? > > > 2009/8/28 Eric

Re: [PHP] Calling extension function from another

2009-08-29 Thread Stuart
2009/8/28 leledumbo : > > Is it possible to call a function that resides in an extension from another > extension? It's certainly possible but I've never needed to do it so I don't know how. I suggest you ask this question on the PHP Internals list. -Stuart -- http://st

Re: [PHP] Date Comparison

2009-09-03 Thread Stuart
es them to continue to rely on this list rather than learning how to find the answer themselves and to only use this list as a last resort. I make no apology for my attitude towards this type of question, and if you don't like it you can stick it where the sun don't shine. -Stuart -- ht

Re: [PHP] PHP and Javascript escape character problem, --> those who like to solve things can try to solve this issue, its tricky I think ;)

2009-11-02 Thread Stuart
et me post my thread because it regards it as an illegal >> tag lol. B-)B-) >> >> Thank you very much :) , >> The Ace >> >> >> -- >> View this message in context: >> http://old.nabble.com/PHP-and-Javascript-escape-character-problem%2C---%3E-those-who-lik

Re: [PHP] Shoutbox suggestion needed

2009-11-16 Thread Stuart
tbox. They're private (although I'm sure some have a public option) and they will provide a much better system for the admin to track multiple conversations. I really think a shoutbox is the wrong solution for this particular problem. -Stuart -- http://3ft9.com/ -- PHP General Mail

Re: [PHP] Require_once return value on error?

2004-04-30 Thread Stuart
h a return statement then you will get that if it succeeds. If not you'll get the value 1 if it succeeds. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Is Curl GZIP support broken?

2004-05-05 Thread Stuart
pired. 2) Does it work using the CLI curl? -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Simple MySQL/PHP Query

2004-05-20 Thread Stuart
xt to append" will update all rows in the table. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Seems Simple enough

2004-01-26 Thread Stuart
exists and is actually set to 1? -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Seems Simple enough

2004-01-26 Thread Stuart
hat one row and use it!! if($Balance >= 10001) { echo "\$$Balance\n"; } elseif($Balance <= ) { echo "\$$Balance\n"; } else { echo "\$$Balance\n"; } -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Seems Simple enough

2004-01-26 Thread Stuart
;Balance"]; " it works fine. Well, duh! If you add periods and commas it will make it a text variable and will no longer equate to 10000. You need to format it after the comparisons. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] order by

2004-01-27 Thread Stuart
christian tischler wrote: Is there a way wuth php to create a list ordered by more than one column like in excel or access. something like "ORDER BY points AND score" Use http://php.net/usort and use both 'columns' in the comparison function. -- Stuart -- PHP Genera

Re: [PHP] Writing CRON jobs!

2004-01-27 Thread Stuart
Hamid Hossain wrote: Is there any good reference on how to use CRON (I mean on the net)? I need to fire some PHP pages at scheduled time daily or weekly, ... so on. http://www.google.com/search?q=cron+tutorial+php -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

Re: [PHP] Googlebot

2004-01-27 Thread Stuart
Hartley, Matt wrote: Is Googlebot (or any other bot) able to follow links that are php? e.g. Contact Us Yes. Is there a way to invite bots to your site? For most, yes. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Googlebot

2004-01-27 Thread Stuart
, but it depends on the purpose of the spider and the philosophy it follows. There are many, many, many, many, many, ..., many, many resources on search engine optimisation all over the web. Use them. Find them with... you guessed it... Google! -- Stuart -- PHP General Mailing List (http://www.ph

Re: [PHP] Using unset with $_SESSION

2004-01-27 Thread Stuart
[EMAIL PROTECTED] wrote: I am trying to find a reliable method to clean out all session variables and start clean. http://php.net/session_destroy -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Using unset with $_SESSION

2004-01-27 Thread Stuart
[EMAIL PROTECTED] wrote: On 27 Jan 2004 Stuart wrote: I am trying to find a reliable method to clean out all session variables and start clean. http://php.net/session_destroy That destroys the file but (at least the docs say) does not clean out the global variables, and does not seem to work in

Re: [PHP] newbie issues with control structures & HTML form

2004-01-27 Thread Stuart
o statements as some sort of arrays. How do I actually write the equivalent code to evaluate if the variable has been passed/set, then do either this or that? if (isset($_GET['guessnumb'])) { ... } -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] path problems

2004-01-27 Thread Stuart
filesystem path does not begin with / then it's relative to the current directory (usually the script directory in the case of PHP scripts). Hope that helps. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Googlebot

2004-01-28 Thread Stuart
ontent. Check the archives for info on how to get rid of query strings from your site. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

php-general@lists.php.net

2004-01-28 Thread Stuart
Diana Castillo wrote: is there any function that will always replace a "&" with a "&" in a string? $string = str_replace('&', ' ', $string); -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

php-general@lists.php.net

2004-01-28 Thread Stuart
Stuart wrote: Diana Castillo wrote: is there any function that will always replace a "&" with a "&" in a string? $string = str_replace('&', ' ', $string); Forgot to mention the htmlentities and htmlspecialchars functions, but they do more t

php-general@lists.php.net

2004-01-28 Thread Stuart
David T-G wrote: Stuart, et al -- ...and then Stuart said... % % Diana Castillo wrote: % >is there any function that will always replace a "&" with a "&" in a % >string? % % $string = str_replace('&', ' ', $string); Clearly I must n

php-general@lists.php.net

2004-01-28 Thread Stuart
Gerard Samuel wrote: On Wednesday 28 January 2004 09:32 am, Stuart wrote: Diana Castillo wrote: is there any function that will always replace a "&" with a "&" in a string? $string = str_replace('&', ' ', $string); Just a heads up on using t

Re: [PHP] path problems

2004-01-28 Thread Stuart
Scott Taylor wrote: $file_two = 'archive/newsletters/Dec03PostPress.pdf'; Try replacing this line with... $file_two = $_SERVER['DOCUMENT_ROOT'].'/archive/newsletters/Dec03PostPress.pdf'; -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] Ideas Kindly

2004-01-28 Thread Stuart
sure and share it with us :) -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Storing MS Word documents

2004-01-29 Thread Stuart
MSSQL you repeat them. Try this instead... $data = str_replace("'", "''", $filecontent); -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Size of Arrays

2004-01-29 Thread Stuart
this development machine with 512meg RAM running WinXP). To the OP, why do you need to store all the items in memory at the same time? Can't you read some, process them then read the next lot, process them, read the next lot etc? -- Stuart -- PHP General Mailing List (http://www.php.net/) To u

Re: [PHP] form action does not give var value's through.

2004-01-29 Thread Stuart
ated. Read about it here: http://php.net/register_globals -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Am I missing Something

2004-01-30 Thread Stuart
reading helmet at home today. How about sharing some code. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Size of Arrays

2004-01-30 Thread Stuart
nals of PHP too well, but I'd be surprised if I was. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Am I missing Something

2004-01-30 Thread Stuart
that the indexes of the array are not what you think they are. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Create a new directory on server.

2004-01-31 Thread Stuart
[EMAIL PROTECTED] wrote: is there in PHP a function that create a new directory on server? RTFM - http://php.net/mkdir -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] formated text after Submit in MySQL/PHP

2004-01-31 Thread Stuart
x27;t call the people you are asking names. It generally doesn't work. Unless you're going to pay us in which case you can call me whatever you want!! -- Stuart Wise Ass in Training (Loathed though I am to help someone with your attitude, you may find your answer in the PHP manual. T

Re: [PHP] Simple script but confusion with comparing strings

2004-01-31 Thread Stuart
instead of strcmp. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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