Re: [PHP] Re: My experience with the "Forms Generation and Validation" class

2009-11-24 Thread Martin Scotta
> revealing unrelated with the class. > > Anyway, I am not upset. I am just sorry that you made many criticisms > without giving real examples to demonstrate your points. That way it > will not be helpful to anybody. > > > -- > > Regards, > Manuel Lemos > > Find and post PHP jobs > http://www.phpclasses.org/jobs/ > > PHP Classes - Free ready to use OOP components written in PHP > http://www.phpclasses.org/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] Multiple file upload

2009-11-11 Thread Martin Scotta
.. > > ... > foreach($_FILES[' UPLOADIMAGE3 '] as $file_name => $file_array) { > ... > > Thanks for reading! > Matt Cheezoid > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Your foreach does exactly what you are asking. foreach($_FILES as $file_name => $file_array) The keys in $_FILES are the in your form. If you have 3 files... then count( $_FILES ) should be 3 -- Martin Scotta

Re: [PHP] Suppress Right-Click and Hide hover URL

2009-11-09 Thread Martin Scotta
but I find this works quite well: > > > > The way you are hiding the actual link URL will work for people who > navigate solely with their mouse, but you might want to add an onfocus() > handler in there as well for people who tab between links. > > At the end of the day though, none of this will stop someone from > viewing your source code for the link, or using a browser plugin like > Firebug to determine what it is. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > Why I will let you to hide things on my browser? The browser is mine... -- Martin Scotta

Re: [PHP] Anyone using Aptana and Xdebug? Or other debugger recommendations besides Zend?

2009-11-09 Thread Martin Scotta
ou can use any text editor. I use SciTE. It is free and open source. It does not provide any tool of any kind. It just allow me to write code, and that's all I need. Also there are a lot of tools for development. And IDE is just a fat text editor with lot of tools on it, and in some cases it can make your development slower. You can improve your development with a set of lightweight tools, this is the linux style. -- Martin Scotta

Re: [PHP] Re: What PHP version are you using?

2009-11-02 Thread Martin Scotta
ust finishing testing against 5.2.10 down to 5.2.4. I am not sure how > many people are still using versions between 5.2.0 and 5.2.3 > > I would like to know those ones too > > -- > "Good Enough" is not good enough. > To give anything less than your best is to sacrifice the gift. > Quality First. Measure Twice. Cut Once. > Hi! I develop for 4.3.10 and 5.2.6 at work. At home I use 5.2.9, it was installed by xubuntu Our hosting providers have 5.2.0 or 5.2.4 -- Martin Scotta

Re: [PHP] Classes and Functions

2009-11-02 Thread Martin Scotta
et/get_included_files > > -- > Larry Garfield > la...@garfieldtech.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > You can use the tokenizer's functions to parse the files and recover the information. They are easy to understand and make the perfect tool for this kind of scenario. I'd like to know how do you solve this. cheers -- Martin Scotta

Re: [PHP] Re: UrlRewrite htaccess confusion

2009-10-29 Thread Martin Scotta
ething'; > > > > Or the simplist approach is to define at constant at app initialization > and use it: > > echo 'Something'; > > -- > Thanks! > -Shawn > http://www.spidean.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Fwd: [PHP] Assignment in Conditional - How are they evaluated?

2009-10-29 Thread Martin Scotta
echo 'Anonymous'; > } > > ?> > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Templating Framework for PHP > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php &g

Re: [PHP] Assignment in Conditional - How are they evaluated?

2009-10-29 Thread Martin Scotta
hen $data's value is evaluated (to > true or false), or is the actual assignment tested (does the assignment > fail, etc)? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > The code is interpreted this way... $data = somefunc(); if ($data) -- Martin Scotta

Re: [PHP] [php] INSERT and immediately UPDATE

2009-10-28 Thread Martin Scotta
ow WHERE *show_id = '$id'*;"; > $result3 = mysql_query($query3) or die('Record cannot be located!' . > mysql_error()); > $row3 = mysql_fetch_array($result3); > $show_id = $row3['show_id']; > > How do I select the item I just inserted to obtain the ID number?? > mysql_insert_id <http://ar.php.net/manual/en/function.mysql-insert-id.php> mysqli->insert_id <http://ar.php.net/manual/en/mysqli.insert-id.php> -- Martin Scotta

Re: [PHP] How to Get the Sub Classes of a Parent Class

2009-10-27 Thread Martin Scotta
r = new ReflectionClass($name); > print_r($r->getSubClasses()); > > Many Thanks > > ------ > *From:* Martin Scotta > > *To:* Raymond Irving > *Cc:* David Otton ; PHP-General List < > php-general@lists.php.net> > *Sent:* Mon, October

Re: [PHP] How to Get the Sub Classes of a Parent Class

2009-10-26 Thread Martin Scotta
> Just having FUN, do not take me serious : ) function getInstanceRandom() { $classes = get_declared_classes(); $index = array_rand( $classes ); return new $classes[ $index ](); } $obj = getInstanceRandom(); echo get_class( $obj ); This is way you NEVER know which class you will instantiate! -- Martin Scotta

Re: [PHP] How to Get the Sub Classes of a Parent Class

2009-10-26 Thread Martin Scotta
ss Beer extends Bar {} Class Pier extends Bar {} function get_subclasses($class) { $sub = array(); foreach(get_declared_classes() as $name ) { $rClass = new ReflectionClass($name); if( $rClass->isSubclassOf( $class )) { $sub[] = $name; } } return $sub; } print_r( get_subclasses( 'Foo' )); print_r( get_subclasses( 'Bar' )); -- Martin Scotta

Re: [PHP] Array

2009-10-24 Thread Martin Scotta
le, it's public properties are used on the loop. foreach($object as $prop => $value ) //php translates the foreach into something like this... foreach(get_object_vars($object) as $prop => $value ) -- Martin Scotta

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

2009-10-22 Thread Martin Scotta
On Thu, Oct 22, 2009 at 8:40 AM, Thodoris wrote: > > >> >>> I don't think it is about readability: >>> >>> $arr[3] = 'test'; >>> $test = 3; >>> >>> //This prints "$test" >>> echo "This doesn't work: $$arr[3]"; >>> >>> //This prints 3 >>> echo "This works: ${$arr[3]}"; >>> >>> Using the same type

Re: [PHP] How to pronounce PHP code over the phone?

2009-10-16 Thread Martin Scotta
-is-what.com > > http://gibberish.co.il > > > Not that I know of, and trying to explain any sort of code over the > phone is just going to lead to a disaster down the line! > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Martin Scotta

Re: [PHP] FILTER_VALIDATE_INT - newbie question

2009-10-07 Thread Martin Scotta
Ben > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] Insult my code!

2009-10-07 Thread Martin Scotta
tabase engine => change the loader/persister. You need to add/remove/modify some new rules in your business logic => change the models Why don't you allow the view to use the model? This way you have... # the controller is responsible to instantiate the model(s) and view(s) # the model is responsible for the business logic # the view is responsible for the presentation -- Martin Scotta

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

2009-10-06 Thread Martin Scotta
ide effect but in other situations it really matter. Does these behaves exactly? for($i=0; $i<10; ++$i) for($i=0; $i<10; $i++) There is no side effect on the incremental section because the result is not evaluated. and what about these? $array[ $index++ ] = $elem; $array[ ++$index ] = $elem; You can read more about the side effect at http://en.wikipedia.org/wiki/Side_effect_%28computer_science%29 -- Martin Scotta

Re: [PHP] Re: Class variable value lost

2009-09-09 Thread Martin Scotta
hleysheridan.co.uk > Unless you store the object state your application will not be able to remember it. There is a design pattern specially designed for this, the Memento Pattern ( http://en.wikipedia.org/wiki/Memento_pattern) There are many ways to persist an object: sessions, xml, text files, databases. Pick the one that fits better and you'll be fine. -- Martin Scotta

Re: [PHP] Overwrite value of true or false in PHP

2009-09-07 Thread Martin Scotta
tp://www.ashleysheridan.co.uk > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > I think php convert the boolean variable to string before print its content. That's why... echo true; # prints '1' echo false; # does not prints anything, or prints '' $bool = false; var_dump( (string) $bool, (int) $bool ); -- Martin Scotta

Re: [PHP] Overwrite value of true or false in PHP

2009-09-07 Thread Martin Scotta
ing types while comparing values. $a = 'false'; $b = true; var_dump( $a == $b, # <-- true $a === $b # <-- false ); This happens because values are converted before comparison so, 'false' becomes true. PHP converts everything different to an empty string as *true* This also affect any type of variable. -- Martin Scotta

Re: [PHP] how to strip empty lines out of a txt using preg_replace()

2009-09-04 Thread Martin Scotta
explode($code) { $lines = array(); $buffer = ''; for($i=0, $len = strlen($code); $i<$len; ++$i) switch( $code{$i} ) { case "\r": case "\n": if( $i+1 == $len ) break 2; if( "\r" == ($next = $code{ $i+1 }) || "\n" == $next ) { ++$i; } $lines[] = $buffer; $buffer = ''; break; default: $buffer .= $code{$i}; } if( '' !== $buffer ); $lines[] = $buffer; return $lines; } -- Martin Scotta

Re: [PHP] IRC and English

2009-09-01 Thread Martin Scotta
y el mutuo beneficio a través de "compartir conocimiento" se realize semejante acotación; aunque mucho mas triste es que una persona oficialmente perteneciente a dicha comunidad se sume a dicho reclamo. Please do not reply that It's a English based list. Or is it allowed to discriminate here? As a non-english speaker I feel very uncomfortable with this thread. With the best intentions for the community, sincerely yours, Martin Scotta Spanish Speaker

Re: [PHP] LoginShare | How to authenticate once, and login to different websites

2009-09-01 Thread Martin Scotta
er is not able to navigate to private areas in both sites. Avoid doing things like a form-post from SiteA to SiteB. This kind of things only make holes to your application security system. User credentials MUST not be handled at client-side. Keep them safetily at server-side where you are who decide which action should be taken. -- Martin Scotta

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

2009-08-28 Thread Martin Scotta
s by count( $_POST ) > 0 but this only applies for application/x-www-form-urlencoded forms. Other content-type will not populate the $_POST and therefore need to be validated by other method. PHP provides non-yet-standard HttpRequest class that can handle this perfectly -- Martin Scotta

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

2009-08-28 Thread Martin Scotta
p;& $_POST['username'] != '') > { ... > > > >> > >> I'm sure that this is not the best/recommended way to do this but I'm > >> hoping someone here will point me in the right direction. > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- Martin Scotta

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

2009-08-28 Thread Martin Scotta
On Fri, Aug 28, 2009 at 10:39 AM, Ashley Sheridan wrote: > On Fri, 2009-08-28 at 10:34 -0300, Martin Scotta wrote: > > Actually there aren't a safe way to make a redirect > > > > We have 4 alternatives (correct me if I miss anything) to do a safe > > redirec

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

2009-08-28 Thread Martin Scotta
/*<![CDATA[*/ // redirect by javascript (3) window.location = '<?php echo $url ?>'; /*]]>*/ You are about to be redirected to in 2 seconds Click here if your browser do not redirect automatically It's recommended that your use a common redirect method in your site, this is not mandatory but it is a good practice. This simple script also helps to prevent session problems under some evil web-server by closing the session before any output. -- Martin Scotta

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

2009-08-27 Thread Martin Scotta
of DB you can use, and if you use an open source alternative then it's legal, that's mean you, or your client, do not have to pay for use it. I'm not going to say *that* DB is better that *this* other, this is a matter of taste. -- Martin Scotta

Re: [PHP] Sockets (reading)

2009-08-27 Thread Martin Scotta
g along these lines, but I wrote a much more efficient > way to make sure I grab all the data of a known length... > > function readSocketForDataLength ($socket, $len) > { >$offset = 0; >$socketData = ''; > >while ($offset < $len) { >if (($data = @socket_read ($socket, $len - $offset, > PHP_BINARY_READ)) === false) { >return false; >} > >$offset += strlen ($data); >$socketData .= $data; >} > >return $socketData; > } > ?> > > If not all the data is obtained on a read, it will loop until the amount of > data is the same as the length requested. This is working quite well. > > Thanks Bob and the others! > > ~Philip > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > socket related: Does this solution work on both, blocking and non-blocking sockets ? And what about different read method? solution related: Does strlen works fine with binary data? Does this snippet work for sending/receiving multibytes strings? -- Martin Scotta

[PHP] DOMNode children iteration (was Re: array() returns something weird)

2009-08-25 Thread Martin Scotta
-- Forwarded message -- From: Martin Scotta Date: Tue, Aug 25, 2009 at 6:24 PM Subject: Re: [PHP] DOMNode children iteration (was Re: array() returns something weird) To: webmas...@strefarytmu.pl Fatal error: Call to a member function getAttribute() on a non-object in testme.php

Re: [PHP] __destruct() not called ! we shot us in the foot try the script

2009-08-25 Thread Martin Scotta
t( $c ); > > $d->doSomething(); > > echo "script ending now ..."; > > ?> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] PHP 5.x magic mathods quick question

2009-08-21 Thread Martin Scotta
ting one (like __set() ) ovewrites the standard one? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

[PHP] PHP_SAPI

2009-08-14 Thread Martin Scotta
inuity, embed, isapi, milter, nsapi, phttpd, pi3web, roxen, thttpd, tux,webjames should I look at php source-code for these values? -- Martin Scotta

Re: [PHP] Re: ini files as config - hidden

2009-08-14 Thread Martin Scotta
files .php so, database.ini will be database.php 2) Put in the top of your script this line ; So, when the file is opened as an ini file the semilcolon indicates that it's a comment. But, when the browser call for this file... php just exit's in the first line. Our data will be safe as long as the first line will remains there. -- Martin Scotta

Re: [PHP] session variables - help

2009-08-14 Thread Martin Scotta
ble fields only for > > values which can be changed, but *must* then contain hidden fields for > all > > the other values which were originally passed in the $_POST array. This > > arrangement means that the process form always receives a full complement > of > > values in the $_POST array -- either from the original form, or from > hidden > > fields posted back to itself. > > > > This is all just coming off the top of my head, and I'm sure there are > > improvements/other solutions to be offered. Hope this will give you some > > things to think about, and maybe a pointer or two towards a satisfactory > > solution. > > > > > > Cheers! > > > > Mike > > -- > > Mike Ford, > > Electronic Information Developer, Libraries and Learning Innovation, > > Leeds Metropolitan University, C507, Civic Quarter Campus, > > Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom > > Email: m.f...@leedsmet.ac.uk > > Tel: +44 113 812 4730 > > > > > > > > > > > > To view the terms under which this email is distributed, please go to > > http://disclaimer.leedsmet.ac.uk/email.htm > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > I didn't know that session_* were deprecated. is this for all session_* functions? Anyways.. here you have the same code fixed $value) if( ('0' == $value || '' == $value) && array_key_exists( $key, $_SESSION) ) { unset( $_SESSION[ $key ] ); } -- Martin Scotta

Re: [PHP] design pattern

2009-08-13 Thread Martin Scotta
ects using many designs patterns. By example the RecursiveDirectoryIterator and it's family use the decorator pattern. Also features such as "late static binding" were added because a design pattern. I think there will be some "separation" in the community, those who will stay using scripts and those who will use heavily OOP. I do not know who the "dark side" will be, xD -- Martin Scotta

[PHP] literal strings vs variable strings

2009-08-13 Thread Martin Scotta
Hi all. Is this going to save me anything? something() ) return true; something() ) return true; -- Martin Scotta

Re: [PHP] Re: Design Patterns

2009-08-12 Thread Martin Scotta
On Wed, Aug 12, 2009 at 6:27 PM, Ralph Deffke wrote: > it would help if u would tell us what u want to accomplish with this > ativity > > cheers > ralph_def...@yahoo.de > > "Martin Scotta" wrote in message > news:6445d94e0908121323x721254c4ja389978d67b

[PHP] Design Patterns

2009-08-12 Thread Martin Scotta
attached through this list... so, if you want a copy just reply to this message. Any bug, comment, or anything you like to say is welcome! -- Martin Scotta

Re: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Martin Scotta
> > would be interesting to see. > > I personaly woudn't spend the time on logs, a computer is logical, I try to > be logical, and I would > try to create code which is logical speedy. I expect the database kernel > programmer the same. > > I think then we are on th

Re: [PHP] Calendar Problem

2009-08-12 Thread Martin Scotta
gt; > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Well, this was a nice experiment. What do we must learn about this? performance < legibility Stuart solutions look that's the faster, but in the other hand Shawn's solution 2 looks the most legible (so far). -- Martin Scotta

Re: [PHP] Re: Is select_db necessary?

2009-08-12 Thread Martin Scotta
Mandriva Linux Contributor [http://www.mandriva.com/] > >PulseAudio Hacker [http://www.pulseaudio.org/] > >Trac Hacker [http://trac.edgewall.org/] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > ', $link ); What SQL was sent to the database? Looking at bin logs I've found this. 1. use database => mysql_select_db 2. use database: SELECT * FROM => mysql_query The DB is usually a common bottle-neck for most applications. You can have several webservers, but can't do that with the DB... of course, you can have multiples slaves but just 1 master. is this the best way to send queries? What's the better and faster way? -- Martin Scotta

Re: [PHP] Calendar Problem

2009-08-12 Thread Martin Scotta
On Wed, Aug 12, 2009 at 10:25 AM, Robert Cummings wrote: > > > tedd wrote: > >> At 4:08 PM -0400 8/11/09, Robert Cummings wrote: >> >>> tedd wrote: >>> Hi gang: I want to show the dates for all Fridays +-30 days from a specific date. For example, given today's date (8/11/2

[PHP] Single quoted strings (was: ereg_replace to preg_replace translation)

2009-08-11 Thread Martin Scotta
e legible. $sql = preg_replace('|\n#[^\n]*\n|', '', $sql); Personally I try to not use double quoted. PHP parses single quoted very much faster. # for this echo "Hi, $name, wellcome $home"; # I use echo 'Hi, ', $name, ', wellcome ', $home; # or printf( 'Hi, %s, wellcome %s', $name, $home ); And of course, this is a matter of taste! -- Martin Scotta

Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-11 Thread Martin Scotta
ray( 'even', 'odd' ); # after new requirements it is... $styles = array( 'white', 'white', 'gray' ); foreach($items as $item) { printf( '%s', current( $styles ), $item ); next( $styles ) or reset( $styles ); } The simplest solution is always the best choice. This provides maintainability and flexibility to changes ( that we don't know yet ) -- Martin Scotta

Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-10 Thread Martin Scotta
t; TIA! -G > > > > > > > > > > > > > $arr = range(1, 10); > > > > $i = 0; > > foreach ( $arr AS $row ) { > > > > $row_color = ( ( $i++ % 2 ) ? 'green' : 'red'); > > > > echo $row_color; > > > > } > > > > ?> > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] Embedding foreach loops

2009-08-10 Thread Martin Scotta
> Is this something I need to have in a database to work? > >> > > > > no, you can do it with the arrays... but it may be easier to work with > > over the long run if that data was in a db. > > > > Anyway right after you finish creating the array and it's embedded > arrays, > > in your code, then add this: > > var_dump($shows); //--so you can see what you just created. If it looks > > right, THEN go on bothering to try and parse it with your (embedded) > > foreach's { > > > > > > John Butler (Govinda) > > govinda.webdnat...@gmail.com > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- Martin Scotta

Re: [PHP] how to say "inverse your value" (to a boolean)?

2009-08-10 Thread Martin Scotta
or find now) in PHP > how to say "inverse your value" (to a boolean). > ? > > TIA! -G > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

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

2009-08-10 Thread Martin Scotta
the conditions to their > respective boolean results before evaluating the logical operators. > > Andrew > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

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

2009-08-10 Thread Martin Scotta
; Interesting that it works (without notice) if we check against the isset () > one first. It makes if() look more intelligent that I would think... as if > it saying, "good now that we've established that the var isset, now is it > also equal to '___'., as opposed to just, "is var set, and is var equal to > "___'. -- Martin Scotta

Re: [PHP] Pattern Matching

2009-08-06 Thread Martin Scotta
tly appreciated. > > Thanks! > Floyd > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] "PHP 6 and MySQL 5 for Dynamic Web Sites" Book

2009-08-06 Thread Martin Scotta
surprised if the feature stays the same at all. Just take a > look at http://wiki.php.net/summits/pdmnotesmay09 and see what they're > cooking up. Like I said before, PHP6 isn't feature-complete, and I > don't suspect it's near it either, so it's definitely way premature to > write a book on PHP6 and silly to buy one. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] "PHP 6 and MySQL 5 for Dynamic Web Sites" Book

2009-08-06 Thread Martin Scotta
> PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > That probably seems silly to you... but there are authors (and editors) who thinks writing a book about the last version of PHP is a good business, and don't care if the language is full featured or even "released" It is up to you to read the book or not. -- Martin Scotta

Re: [PHP] Displaying user data and picture

2009-08-06 Thread Martin Scotta
;> http://www.nabble.com/file/p24839092/guest-book.zip guest-book.zip >> -- >> View this message in context: > http://www.nabble.com/Displaying-user-data-and-picture-tp24839092p24839092.html >> Sent from the PHP - General mailing list archive at Nabble.com. >> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] dynamically naming PHP vars on the fly?

2009-08-05 Thread Martin Scotta
;$Fruit_apple"; // I want this to return "organic" > > Or how are you guys dynamically naming PHP vars on the fly? > > > John Butler (Govinda) > govinda.webdnat...@gmail.com > > > > > -- > PHP General Mailing List (http://www.php.net

Re: [PHP] navigation include not functioning (RESOLVED)

2009-08-05 Thread Martin Scotta
out" == $page) > > Then if you mis-type "==" as "=", PHP will fail immediately with a parse > error. > > It feels a little weird but if it saves a lot of head-desk moments it's > probably worth it. Now if only I could get into the habit myself... >

Re: [PHP] navigation include not functioning

2009-08-05 Thread Martin Scotta
on. >>>> >>>> >>>> >>>> >>>> On Wed, Aug 5, 2009 at 10:10 AM, Jerry Wilborn >>> >>>>> >wrote: >>>>> >>>>> Look >>>>> >>>> >>>> >>>>  I'm having trouble understanding your description of the problem.  Can >>>> >>>>> you >>>>>> tell us what you're seeing and what you expect to see? >>>>>> Jerry Wilborn >>>>>> jerrywilb...@gmail.com >>>>>> >>>>>> >>>>>> >>>>>> On Wed, Aug 5, 2009 at 12:00 PM, Allen McCabe >>>>> >wrote: >>>>>> >>>>>> I am trying to generate pages by importing content in includes, and >>>>>> using >>>>>> >>>>>>> my >>>>>>> navigation include to tell PHP to replace a $thisPage variable which >>>>>>> all >>>>>>> the >>>>>>> includes use >>>>>>> >>>>>>> The idea behind it (I know tons of people do it, but I'm new to this >>>>>>> concept), is to have a 'layout' page where only a variable changes >>>>>>> using >>>>>>> $_GET on an href (index.php?page=services or index.php?page=about) to >>>>>>> load >>>>>>> the new 'pages'. >>>>>>> >>>>>>> PROBLEM: >>>>>>> All my links are displaying the current page state, and links are not >>>>>>> building around the link text (hrefs are built conditionally with if >>>>>>> $thisPage != services then build the link, otherwise leave it as >>>>>>> normal >>>>>>> text). Same thing with the background image behind the link text (to >>>>>>> indicate a page's current position). If the condition is not true, all >>>>>>> the >>>>>>> links (except the true current 'page') are supposed reload index.php >>>>>>> and >>>>>>> pass a variable to itself to place into $thisPage using >>>>>>> href="index.php?page=" (after which I have a variable which stores >>>>>>> "about" >>>>>>> or "services" within the if statement near the link text. >>>>>>> >>>>>>> If this sounds like something you are familiar with (former issues and >>>>>>> whatnot) please let me know what I'm doing wrong. I would be happy to >>>>>>> give >>>>>>> you any code you want to look at (index.php or navigation.php, >>>>>>> whatever). >>>>>>> >>>>>>> Thanks again for your help PHP gurus! >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] navigation include not functioning

2009-08-05 Thread Martin Scotta
xt (to >>> indicate a page's current position). If the condition is not true, all the >>> links (except the true current 'page') are supposed reload index.php and >>> pass a variable to itself to place into $thisPage using >>> href="index.php

Re: [PHP] Warning: OutsourcingRoom.com

2009-08-05 Thread Martin Scotta
11:14 AM, Ashley Sheridan wrote: > On Wed, 2009-08-05 at 11:10 -0300, Martin Scotta wrote: >> Nobody can actually do anything. This happen all the time. >> >> Sites like facebook or myspace send invitations to all your mail's >> contacts, but that's not the problem

Re: [PHP] Warning: OutsourcingRoom.com

2009-08-05 Thread Martin Scotta
Ho hum... >> > >> > Thanks, >> > Ash >> > http://www.ashleysheridan.co.uk >> > >> > >> > -- >> > PHP General Mailing List (http://www.php.net/) >> > To unsubscribe, visit: http://www.php.net/unsub.php >> > >> > >> >> Har har.  This was not a mindless 411 scam.  It is a bit different >> when an actual site people use gets hacked and their personal >> information stolen.  I too received one of these emails and it was >> very convincing.  It has my exact username from the Elance site and >> was crafted in such a way that it seems this new site was a partner >> with Elance somehow. >> >> -- >> http://www.ericbutera.us/ >> > Is there nothing that anybody can actually do about this? Where is the > new company based? Are there laws in that country about this sort of > thing? > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Dan Brown

2009-08-03 Thread Martin Scotta
est in this, please exercise your > email-delete capabilities at this time. > >    Thanks! > > -- > > daniel.br...@parasane.net || danbr...@php.net > http://www.parasane.net/ || http://www.pilotpig.net/ > Check out our great hosting and dedicated server deals at > http://twitter.com/pilotpig > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP 5.2.9 + NCurses

2009-07-30 Thread Martin Scotta
any set of classes that handle ncurses easily? -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] PHP as Language

2009-07-24 Thread Martin Scotta
Hi all Is there a formal definition for the php language? Where I can found it? I've STW with no results. -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Renaming all variables in a repository

2009-07-23 Thread Martin Scotta
is and could > either point me in the right direction or just down and out tell me > how to do it. > > Thanks so much > --Eddie > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] Re: unsetting a referenced parameter in a function

2009-07-23 Thread Martin Scotta
? > > > > when you state it in those terms (which are clearly correct) i wouldn't. > > > > but if the way i think is "unset() destroys the specified variables" (as > the > > manual puts it) then i expect that the specified variable would be > > destroyed, not the reference. > > > > so, as i said, i was a bit surprised when the variable wasn't destroyed. > > once i understood what was happening, i thought it a bit confusing to > have > > such scope-dependent differences in behavior of a language element. > > > > > It might be easier to understand if you don't use the same var names: > > function foo(&$arg) { > $arg = 42; > unset($arg); > $arg = 'meaning'; > } > > $a = 0; > foo($a); > print("$a\n"); > > > -- > Thanks! > -Shawn > http://www.spidean.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] Re: unsetting a referenced parameter in a function

2009-07-22 Thread Martin Scotta
; > RTM: http://php.net/unset The behavior of *unset()* inside of a function can vary depending on what type of variable you are attempting to destroy. If a globalized variable is *unset()* inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before *unset()* was called. / ... / If a variable that is PASSED BY REFERENCE is *unset()* inside of a function, only the local variable is destroyed. The variable in the calling environment will retain the same value as before *unset()* was called. I think the manual is very clear about unset. -- Martin Scotta

Re: [PHP] Re: newbie question - php parsing

2009-07-22 Thread Martin Scotta
t; > 2009/7/23 Shane Hill > > > 2009/7/22 João Cândido de Souza Neto > > > > > You made a mistake in your code: > > > > > > > > > > > > must be: > > > > > > > > > > > > > > > Short tag and not recommended as its deprecated now, would be void at PHP > 6.0 > -- Martin Scotta

Re: [PHP] Invalid Argument why?

2009-07-16 Thread Martin Scotta
thing like this: > > // Always better to be plural when you have an array. > $rows = whatever_your_rows_come_from(); > > foreach($rows as $row) > { > $inType = $row['inType']; > echo $inType . ''; > } > > > HTH, > Kyle > -- Martin Scotta

[PHP] Add php.net to my browser search box

2009-07-16 Thread Martin Scotta
Quick search in PHP.net! php quick search http://php.net/images/logos/php-icon-white.gif http://search.php?pattern={searchTerms}"/> UTF-8 false I know php.net use method="POST", but it's quite easy to provide a GET mechanism. is this the correct place for posting this? -- Martin Scotta

Re: [PHP] Alphabetical pagination (RESOLVED)

2009-07-16 Thread Martin Scotta
On Thu, Jul 16, 2009 at 12:01 PM, Miller, Terion < tmil...@springfi.gannett.com> wrote: > > One question I still have...I had help with this script of course and I'm > confused with the %s what does it do? > > On 7/16/09 9:53 AM, "Martin Scotta" wrote: &g

Re: [PHP] Alphabetical pagination (RESOLVED)

2009-07-16 Thread Martin Scotta
> My point of view: # i'll use constants for these values assert( ord('A') == 0x41 ); assert( ord('Z') == 0x5A ); # 1. get the ascii code of the 1st character or from A=0x41 $letter = ord( array_key_exists('letter', $_GET) ? strtoupper( $_GET['letter']{0} ) : 'A' ); # 2. different solutions # 2.a check if it is range ussing <= ussing constants (faster) $letter = chr( 0x41<= $letter && $letter <= 0x5A ? $letter : 0x41 ); # 2. different solutions # 2.b check if it is range min/max and with constants (faster) $letter = chr( min( max(0x41, $letter), 0x5A) ); I'd use the 2.b but this has different behaviour when $letter > Z (should this ever happen?) In the other hand I think it is the faster one. -- Martin Scotta

Re: [PHP] Sub Menu System?

2009-07-16 Thread Martin Scotta
arting over at this point, but I'm hoping there is > something I can just purchase, so I can concentrate on the rest of the > sitehopefully the menu system would support PHP and ASP. > > Thanks for any information! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] Exception not being caught

2009-07-16 Thread Martin Scotta
class A could not be converted to > > string." > > > > If it's catchable, why isn't it caught in my example? > > It's not an exception, it's a "fatal error". Fatal errors are caught > by error handling functions, not by catch blocks. > > Consequence of having (at least) two separate error handling > mechanisms in the same language. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

[PHP] boolean vs int comparison

2009-07-15 Thread Martin Scotta
, $boolean ? ' ': ' ' , $test ,' $int === ' , bol2string($_test[-1]), $_test[0] !== $_test[-1] ? ' / $int !== 0' : '' , PHP_EOL; ?> -- Martin Scotta

Re: [PHP] I have an idea

2009-07-15 Thread Martin Scotta
On Wed, Jul 15, 2009 at 12:29 PM, tedd wrote: > At 1:21 AM -0300 7/15/09, Martin Scotta wrote: >> >> Hi >> >> Do you noted that all the discussion here are about problems, bugs, or >> just "urgent pleaaase help me" >> I have an idea. It is not rea

Re: [PHP] I have an idea

2009-07-15 Thread Martin Scotta
ea, as simple as it looks, is really difficult to implement >> specially about security >> >> so, do you like me idea? >> >> -- Martin Scotta >> > > > sorry if this is getting OT: > > Martin, I wrote a really fun and charming remake of a great that 2 others

Re: [PHP] Re: I have an idea

2009-07-15 Thread Martin Scotta
On Wed, Jul 15, 2009 at 4:55 AM, Carlos Medina wrote: > Martin Scotta schrieb: >> >> Hi >> >> Do you noted that all the discussion here are about problems, bugs, or >> just "urgent pleaaase help me" >> I have an idea. It is not really THE idea... b

Re: [PHP] Alphabetical pagination

2009-07-15 Thread Martin Scotta
eneral idea is correct. >> >> 2)  It implements numeric pagination, which is usually based on a >> fixed number of rows per page. The OP wanted alphabetical pagination >> (like an address book) with each page containing all entries that >> begin with the selected letter. >> >> >> Andrew > > I just had a query doing the same thing one time, and that did take it's time > (about 2-3 seconds) but it did have a few million records to look at, so I > can understand why it was slow! > > And it was on MSSQL, with no indexes set up :( I nearly cried when I saw what > I was dealing with! > > -- > Thanks, > Ash > http://www.ashleysheridan.co.uk > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] I have an idea

2009-07-14 Thread Martin Scotta
You can do a lot of things with him, even have fun with it. My idea is to make a simple game where your have to write some AI to beat the other players AI The idea, as simple as it looks, is really difficult to implement specially about security so, do you like me idea? -- Martin Scotta -- PHP

Re: [PHP] [GD] Image errors

2009-07-14 Thread Martin Scotta
( $this->updir . $id . '.png' ); } hey, look, just 2 lines! On Tue, Jul 14, 2009 at 2:20 PM, Ashley Sheridan wrote: > On Tue, 2009-07-14 at 14:16 -0300, Martin Scotta wrote: >> On Tue, Jul 14, 2009 at 1:48 PM, Ashley >> Sheridan wrote: >> > On Tue, 2009-0

Re: [PHP] [GD] Image errors

2009-07-14 Thread Martin Scotta
On Tue, Jul 14, 2009 at 1:48 PM, Ashley Sheridan wrote: > On Tue, 2009-07-14 at 13:41 -0300, Martin Scotta wrote: >> He is calling the function by variable >> >> something like this >> >> $func = 'var_dump'; >> >> $func( new Foo ); >>

Re: [PHP] [GD] Image errors

2009-07-14 Thread Martin Scotta
He is calling the function by variable something like this $func = 'var_dump'; $func( new Foo ); On Tue, Jul 14, 2009 at 1:30 PM, Ashley Sheridan wrote: > On Tue, 2009-07-14 at 13:27 -0300, Martin Scotta wrote: >> $immagine = $tipo($this->updir.$id.'.png'); >

Re: [PHP] [GD] Image errors

2009-07-14 Thread Martin Scotta
itle sets to > "picture.php (JPEG image)" and if i right-click it and click on > "Proprieties" i get "0px × 0px (resized as 315px × 19px)". > > P.S.: I get the same result when I write $immagine = > imagecreatefromjpeg(...) > > (Sorry for my engl

Re: [PHP] Need Help.

2009-07-14 Thread Martin Scotta
javascript Click to lalalal I've said it is not for a php thread On Tue, Jul 14, 2009 at 10:29 AM, Bob McConnell wrote: > From: Martin Scotta >> >> hahahahahaha >> >> How are you to delete my history? >> The fact that you "develop" a website does not

Re: [PHP] Scope of Variables and use of global and this->var

2009-07-14 Thread Martin Scotta
the function as static by using " public static > function calculateRectangle($width, $height) { " > then you can access the method by using just 1 call: > $area = SomeMathFunctions::calculateRectange(10,15); > > So for creating utility functions its better to use static m

Re: [PHP] Need Help.

2009-07-14 Thread Martin Scotta
/www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySql Injection advice

2009-07-14 Thread Martin Scotta
cy services! > > Also, IP addresses can be converted to IP numbers with the long2ip() > function of PHP, which means you can store them as long ints and do > normal number comparisons on them, great for matching an IP address to a > range of 'valid' ones. > > Thanks > Ash > www.ashleysheridan.co.uk > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] RFC/Survey for Our Newer Folks (Including Lurkers)

2009-07-13 Thread Martin Scotta
uck with > me :p > > -- > Thanks, > Ash > http://www.ashleysheridan.co.uk > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] runtime access to static variable

2009-07-10 Thread Martin Scotta
PHP - General mailing list archive at Nabble.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > if you need to access to a class constant use the built-in function if( defined( get_class($myClass) .'

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

2009-07-09 Thread Martin Scotta
and the value of their > contribution and spend their time and talents where they are appreciated and > not waste them on such nonsense. > > Cheers, > > tedd > > -- > --- > http://sperling.com  http://ancientstones.com  http://earthstones.com > > -- >

Re: [PHP] Simple login form with cookies

2009-07-08 Thread Martin Scotta
they > provide the password again (even though they are already > authenticated) on the same form with the new username. Then you can do > the same encrypt/compare that you do for authentication, and if it > matches you just update the username and the hash at the same time. > > Andrew > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] namespace keyword

2009-07-02 Thread Martin Scotta
"NAMESPACE" in the class? Is it a reserved word? -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Removing empty values from array

2009-06-25 Thread Martin Scotta
way to do it? -- Martin Scotta -- 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 Martin Scotta
ike there are always updates to some > component or other, many of which I do not use and some of which would > not actually install. > > When I went looking for an IDE, I wanted a good code editor with > features like syntax checking and code completion, and I wanted a > debugger that I could step through code to figure out why something > wasn't working as I expected. There were a couple that were close, but > I chose Zend Studio at the time because it seemed to have the most > complete/accurate code completion not only of the core language, but > also recognizing functions and classes declared within the PHP code in > the project itself (especially when you include a basic phpdoc block > that describes the function @params and @return). Perhaps the new > version still does all that wonderfully well, but as I said I've found > it to be not worth the hassle. Perhaps, to be fair, I need to take > some time to get familiar with the new paradigm, but that furthers my > point: I want an editor that I can be productive with more or less out > of the box. > > Andrew > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] modifying within foreach

2009-06-23 Thread Martin Scotta
the elements you want to keep into a new array. >>>>> >>>>> Kirk >>>>> >>>> What about passing it by reference? >>>> >>>> foreach($results as &$key => &$item) >>>> { >>>> // modify items he

Re: [PHP] Re: XSS Preventing.

2009-06-23 Thread Martin Scotta
waste of performance anyway. > > > > > > Cons: > > --- > > Instead "&" you'll see "&" ... is that a problem? Not for me and I > > believe 80% of others who use DB to store & view on web. > > > > > > > > Martin > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- Martin Scotta

Re: [PHP] Re: isset question

2009-06-18 Thread Martin Scotta
sage >> news:ea.e8.08167.6ac8a...@pb1.pair.com... >> >> >>> I have a form that gives the submitter a choice or either one set of >>> questions, or another. I am still getting the message even if the input was >>> left blank. So on the line below, >>> >>> $msg.= isset($_POST['mort']) ? "The mortgage amount is $mort\n" : " "; >>> >>> I get >>> >>> The mortgage amount is >>> >>> What am I missing here? >>> >>> Thanks >>> >>> Gary >>> >>> >>> >> >> >> >> >> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

Re: [PHP] Re: Can someone tell me why this is not working?

2009-06-18 Thread Martin Scotta
27;howlong']); > > > > if ($purchprice) { > > echo "Purchase Price:$ $purchprice"; > > } > > if ($newmort) { > > echo "Mortgage Amount:$ $newmort"; > > } > > if ($howlong) { > > echo "How Long has seller owned property: $howlong"; > > } > > > > Thanks > > > > Gary > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Martin Scotta

  1   2   >