php-general Digest 21 Feb 2011 01:21:45 -0000 Issue 7192

Topics (messages 311459 through 311480):

Re: Array from one form to other?
        311459 by: Tamara Temple
        311460 by: Yogesh
        311475 by: Tamara Temple

Submitting data to MySQL database using HTML/PHP form
        311461 by: Nazish
        311462 by: Daniel Brown
        311463 by: Donovan Brooke
        311464 by: Andre Polykanine
        311465 by: Nazish
        311468 by: Nazish
        311469 by: Andre Polykanine
        311470 by: Andre Polykanine
        311471 by: admin.buskirkgraphics.com
        311472 by: Nazish
        311473 by: Tamara Temple
        311474 by: Andre Polykanine

Re: Connection Handling - unreliable at best?
        311466 by: James Green

Re: New to list and to PHP
        311467 by: tedd
        311477 by: Richard Quadling
        311478 by: Richard Quadling
        311479 by: tolga
        311480 by: Tamara Temple

Re: 9970318527584
        311476 by: Richard Quadling

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---

On Feb 19, 2011, at 6:38 PM, Yogesh wrote:
I have two forms. One form helps read an input file into an array. And the
other form needs this array as an input.
I am able to read the input file into an array, but how do I pass it over to
the other form.

Both forms have PHP file as 'action'.

I don't entirely understand this; Dan Brown gave you solution to use curl to pass the array to the second "form" (do you mean script here?). That would certainly work, but I'm wondering if it wouldn't be more secure to spool out the array to a file from the first script after it has processed it, and then read it in to the second script when it starts. This assumes the two scripts are running on the same server, of course. The second script could be called after the first script finishes by using a header redirect. I'm curious about people's thought on the security and efficacy of different ways of sharing data between scripts when you're not using sessions.



--- End Message ---
--- Begin Message ---
Hi Tamara,


I don't entirely understand this; Dan Brown gave you solution to use curl to
>> pass the array to the second "form" (do you mean script here?). That would
>> certainly work, but I'm wondering if it wouldn't be more secure to spool out
>> the array to a file from the first script after it has processed it, and
>> then read it in to the second script when it starts. This assumes the two
>> scripts are running on the same server, of course. The second script could
>> be called after the first script finishes by using a header redirect. I'm
>> curious about people's thought on the security and efficacy of different
>> ways of sharing data between scripts when you're not using sessions.
>
>
>
I am quite new to PHP. (I am having trouble to understand how HTML, PHP and
Javascript work together). Right now I just wanted to get the job done. But
if you can suggest me a more efficient way to do it, I will definitely look
into it.

Thanks,

-Yogesh

--- End Message ---
--- Begin Message ---

On Feb 20, 2011, at 10:51 AM, Yogesh wrote:

I don't entirely understand this; Dan Brown gave you solution to use curl to pass the array to the second "form" (do you mean script here?). That would certainly work, but I'm wondering if it wouldn't be more secure to spool out the array to a file from the first script after it has processed it, and then read it in to the second script when it starts. This assumes the two scripts are running on the same server, of course. The second script could be called after the first script finishes by using a header redirect. I'm curious about people's thought on the security and efficacy of different ways of sharing data between scripts when you're not using sessions.


I am quite new to PHP. (I am having trouble to understand how HTML, PHP and Javascript work together). Right now I just wanted to get the job done. But if you can suggest me a more efficient way to do it, I will definitely look into it.

Are you also new to programming in general? If so, I suggest spending some time studying up on programming concepts and design patterns. I do understand the idea of "just get the job done", but without basic knowledge, the result is not going to be very good, and likely lead to maintenance nightmares down the road.

As I don't really understand what it is you're trying to do, it's hard to make concrete suggestions. From your very brief description, it sounds like you have one script that takes the form submission and populates an array, which you want to share with another script. Typically, data sharing between scripts is accomplished in a few different ways:

1) use of session variables (which requires the script to invoke session management)

B) storing the information in a persistent data base (e.g. MySQL)

iii) storing the information in a transient data store (e.g. a temporary file). There are different ways to format the data in the file, including as php script (so you can include the file), JSON, YAML, etc.

d) passing the information to the second script via a query string or a post data buffer

Any of these things require understanding of the mechanisms and implementation idioms involved. Choosing a particular implementation depends on several variables in your overall design and implementation environment. A mailing list is a poor way to transmit this information, which is why most of it is documented elsewhere.
--- End Message ---
--- Begin Message ---
Hi there,

I am creating a login page for my website. The users' information will be
stored in a MySQL database. I have a registration form on my home page, and
a separate file called "login.php" to process the user values. However, the
entries are not going to the MySQL database (however, the values can be
entered successfully using the command line).

I'd appreciate your insight on why the form entries are not making their way
to the MySQL database. Much thanks in advance!

This is the code for the form:

<form action='login.php' method='POST'>
      Username: <input type='text' name='login'><br>
    Password: <input type='password' name='password'><br>
    <input type='submit' value='Submit'>
</form>

This is the code in login.php:

<?php
// Connect to server and select database.
$host = "localhost";
$user = "root";
$password = "abc";
$db = "directory";

mysql_connect("$host", "$user", "$password") or die("could not connect!");
mysql_select_db("$db") or die(mysql_error());


// username and password sent to table user_info in mysql

$login = $_POST['login'];
$password = $_POST['password'];

$insert = "INSERT INTO user_info
                (login, password)
                VALUES
                ("$login",
                "$password");
mysql_query($insert);

>?

It's a simple form which I will develop further once the basic submission
process has been ironed out... Thanks again for any insight!

--- End Message ---
--- Begin Message ---
On Sun, Feb 20, 2011 at 12:55, Daniel Brown <danbr...@php.net> wrote:
> On Sun, Feb 20, 2011 at 12:53, Daniel Brown <danbr...@php.net> wrote:
>>
>>    If the value isn't that of your database password, there's your
>> problem: register_globals.  A simpler way is to check the output of
>> phpinfo(); to see if register_globals is enabled, but either method
>> will work.
>
>    Actually, disregard my answer: I misread your original email about
> where each line of code was placed.  My answer is not correct in this
> case.

    Does your login.php file actually use the following closing tag: >?

    If so, that's backwards, which will cause a parse error on
login.php.  Closing tags should be ?>, but if it's the last line in a
file, you can safely (and perhaps should) omit them.

    Also, some other pointers:

        * ALWAYS sanitize user input.  At the very least, look into
mysql_real_escape_string().
        * Don't use the same variable name for multiple things unless
you need to do so.  It makes debugging more difficult in complex
scripts.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

--- End Message ---
--- Begin Message ---
This is probably a post better sent to the php-db list... but

Whenever you work with MySQL, it's good to retrieve the actual error from mysql to help you troubleshoot.

I posted this php_mysql lib a while back which is what I used on my last project.

http://www.euca.us/downloads/euca_phpmysql.zip (4KB)

it will show use of mysql_error()

Other than that, use some basic troubleshooting.

What is $insert parsing to exactly? Does it look correct?

Donovan


--
D Brooke

--- End Message ---
--- Begin Message ---
Hello Nazish,

first  of  all, I'd suggest you to remove all of the quotes around the
variables:

mysql_connect($host, $user, $password) or die("could not connect!");

the same is to be done with the query itself.

Second, add an "or die" to the query:
mysql_query($insert)  or  die  ("Unable  to  add user to the database:
".mysql_error());

This  way  you'll know what exactly _MySql_ says for an error if there
is any.

and third just tiny thing... it's not >? but ?> :-).

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

------------ Original message ------------
From: Nazish <naz...@gmail.com>
To: php-gene...@lists.php.net
Date created: , 7:44:24 PM
Subject: [PHP] Submitting data to MySQL database using HTML/PHP form


      Hi there,

I am creating a login page for my website. The users' information will be
stored in a MySQL database. I have a registration form on my home page, and
a separate file called "login.php" to process the user values. However, the
entries are not going to the MySQL database (however, the values can be
entered successfully using the command line).

I'd appreciate your insight on why the form entries are not making their way
to the MySQL database. Much thanks in advance!

This is the code for the form:

<form action='login.php' method='POST'>
      Username: <input type='text' name='login'><br>
    Password: <input type='password' name='password'><br>
    <input type='submit' value='Submit'>
</form>

This is the code in login.php:

<?php
// Connect to server and select database.
$host = "localhost";
$user = "root";
$password = "abc";
$db = "directory";

mysql_connect("$host", "$user", "$password") or die("could not connect!");
mysql_select_db("$db") or die(mysql_error());


// username and password sent to table user_info in mysql

$login = $_POST['login'];
$password = $_POST['password'];

$insert = "INSERT INTO user_info
                (login, password)
                VALUES
                ("$login",
                "$password");
mysql_query($insert);

>?

It's a simple form which I will develop further once the basic submission
process has been ironed out... Thanks again for any insight!


--- End Message ---
--- Begin Message ---
Thanks everyone! However, when I click the "submit" button, the url simply
moves to http://localhost/login.php (from home.php) and it is a blank page
(apart from asking whether it should remember the password for future use).
The values still do not move to the database.

I included most of your suggestions

a) added mysql _error()
b) different names for the variables
c) removed double quotes
d) changed ?> (silly error!)
e) modified the $insert query

The code now looks like this:

<?php

// Connect to server and select database.
$host = "localhost";
$user = "root";
$mysql_pass = "abc";
$db = "directory";

mysql_connect($host, $user, $mysql_pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());

// username and password sent to mysql database

$login = $_POST['login'];
$password = $_POST['password'];

$insert = "INSERT INTO user_info
       (login, password)
        VALUES

('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($password)."')";

mysql_query($insert)
or  die  ("Unable  to  add user to the database:".mysql_error());

?>


I could insert the values using the command line, and it was updated in
MySQL, but it doesn't work through the form... it just goes to a blank page
on login.php. I'd appreciate any insights on why that's happening.

--- End Message ---
--- Begin Message ---
Update:

I added "echo" statements after mysql_connect and mysql_select_db to check
where the code was broken. These statements show up on the login.php page
after submitting the form, which means the MySQL connection works. So, the
problem seems to lie with the *$insert *query... ideas?


On Sun, Feb 20, 2011 at 3:04 PM, Nazish <naz...@gmail.com> wrote:

> Thanks everyone! However, when I click the "submit" button, the url simply
> moves to http://localhost/login.php (from home.php) and it is a blank page
> (apart from asking whether it should remember the password for future use).
> The values still do not move to the database.
>
> I included most of your suggestions
>
> a) added mysql _error()
> b) different names for the variables
> c) removed double quotes
> d) changed ?> (silly error!)
> e) modified the $insert query
>
> The code now looks like this:
>
>
> <?php
>
> // Connect to server and select database.
> $host = "localhost";
> $user = "root";
> $mysql_pass = "abc";
> $db = "directory";
>
> mysql_connect($host, $user, $mysql_pass) or die(mysql_error());
>
> mysql_select_db($db) or die(mysql_error());
>
> // username and password sent to mysql database
>
>
> $login = $_POST['login'];
> $password = $_POST['password'];
>
> $insert = "INSERT INTO user_info
>        (login, password)
>         VALUES
>
> ('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($password)."')";
>
>
> mysql_query($insert)
> or  die  ("Unable  to  add user to the database:".mysql_error());
>
> ?>
>
>
> I could insert the values using the command line, and it was updated in
> MySQL, but it doesn't work through the form... it just goes to a blank page
> on login.php. I'd appreciate any insights on why that's happening.
>
>

--- End Message ---
--- Begin Message ---
Hello Nazish,

Try to do the following in your login.php:

<?php
print_r($_POST);
// assign your variables
echo "<br>$login<br>$password<br>$insert<br>";

                                 So we'll see the result.

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

------------ Original message ------------
From: Nazish <naz...@gmail.com>
To: php-gene...@lists.php.net
Date created: , 10:04:07 PM
Subject: [PHP] Submitting data to MySQL database using HTML/PHP form


      Thanks everyone! However, when I click the "submit" button, the url simply
moves to http://localhost/login.php (from home.php) and it is a blank page
(apart from asking whether it should remember the password for future use).
The values still do not move to the database.

I included most of your suggestions

a) added mysql _error()
b) different names for the variables
c) removed double quotes
d) changed ?> (silly error!)
e) modified the $insert query

The code now looks like this:

<?php

// Connect to server and select database.
$host = "localhost";
$user = "root";
$mysql_pass = "abc";
$db = "directory";

mysql_connect($host, $user, $mysql_pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());

// username and password sent to mysql database

$login = $_POST['login'];
$password = $_POST['password'];

$insert = "INSERT INTO user_info
       (login, password)
        VALUES

('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($password)."')";

mysql_query($insert)
or  die  ("Unable  to  add user to the database:".mysql_error());

?>


I could insert the values using the command line, and it was updated in
MySQL, but it doesn't work through the form... it just goes to a blank page
on login.php. I'd appreciate any insights on why that's happening.


--- End Message ---
--- Begin Message ---
Hello Nazish,

Echo the $insert variable.

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

------------ Original message ------------
From: Nazish <naz...@gmail.com>
To: php-gene...@lists.php.net
Date created: , 10:53:35 PM
Subject: [PHP] Submitting data to MySQL database using HTML/PHP form


      Update:

I added "echo" statements after mysql_connect and mysql_select_db to check
where the code was broken. These statements show up on the login.php page
after submitting the form, which means the MySQL connection works. So, the
problem seems to lie with the *$insert *query... ideas?


On Sun, Feb 20, 2011 at 3:04 PM, Nazish <naz...@gmail.com> wrote:

> Thanks everyone! However, when I click the "submit" button, the url simply
> moves to http://localhost/login.php (from home.php) and it is a blank page
> (apart from asking whether it should remember the password for future use).
> The values still do not move to the database.
>
> I included most of your suggestions
>
> a) added mysql _error()
> b) different names for the variables
> c) removed double quotes
> d) changed ?> (silly error!)
> e) modified the $insert query
>
> The code now looks like this:
>
>
> <?php
>
> // Connect to server and select database.
> $host = "localhost";
> $user = "root";
> $mysql_pass = "abc";
> $db = "directory";
>
> mysql_connect($host, $user, $mysql_pass) or die(mysql_error());
>
> mysql_select_db($db) or die(mysql_error());
>
> // username and password sent to mysql database
>
>
> $login = $_POST['login'];
> $password = $_POST['password'];
>
> $insert = "INSERT INTO user_info
>        (login, password)
>         VALUES
>
> ('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($password)."')";
>
>
> mysql_query($insert)
> or  die  ("Unable  to  add user to the database:".mysql_error());
>
> ?>
>
>
> I could insert the values using the command line, and it was updated in
> MySQL, but it doesn't work through the form... it just goes to a blank page
> on login.php. I'd appreciate any insights on why that's happening.
>
>


--- End Message ---
--- Begin Message ---
I see an errors in the syntax.

$insert = "INSERT INTO user_info (login, password) VALUES
('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($passwor
d)."')";

Issues resolved.
$insert = "INSERT INTO user_info (login, password) VALUES
('".mysql_real_escape_string($login)."','".mysql_real_escape_string($passwor
d)."')";

Here is the issue

,"'.mysql_real_escape_string($password)."'

Your escaping incorrectly.

It should be 
,'".mysql_real_escape_string($password)."'

The double quote is in the wrong place.





-----Original Message-----
From: Nazish [mailto:naz...@gmail.com] 
Sent: Sunday, February 20, 2011 3:54 PM
To: php-gene...@lists.php.net
Subject: Re: [PHP] Submitting data to MySQL database using HTML/PHP form

Update:

I added "echo" statements after mysql_connect and mysql_select_db to check
where the code was broken. These statements show up on the login.php page
after submitting the form, which means the MySQL connection works. So, the
problem seems to lie with the *$insert *query... ideas?


On Sun, Feb 20, 2011 at 3:04 PM, Nazish <naz...@gmail.com> wrote:

> Thanks everyone! However, when I click the "submit" button, the url simply
> moves to http://localhost/login.php (from home.php) and it is a blank page
> (apart from asking whether it should remember the password for future
use).
> The values still do not move to the database.
>
> I included most of your suggestions
>
> a) added mysql _error()
> b) different names for the variables
> c) removed double quotes
> d) changed ?> (silly error!)
> e) modified the $insert query
>
> The code now looks like this:
>
>
> <?php
>
> // Connect to server and select database.
> $host = "localhost";
> $user = "root";
> $mysql_pass = "abc";
> $db = "directory";
>
> mysql_connect($host, $user, $mysql_pass) or die(mysql_error());
>
> mysql_select_db($db) or die(mysql_error());
>
> // username and password sent to mysql database
>
>
> $login = $_POST['login'];
> $password = $_POST['password'];
>
> $insert = "INSERT INTO user_info
>        (login, password)
>         VALUES
>
>
('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($passwor
d)."')";
>
>
> mysql_query($insert)
> or  die  ("Unable  to  add user to the database:".mysql_error());
>
> ?>
>
>
> I could insert the values using the command line, and it was updated in
> MySQL, but it doesn't work through the form... it just goes to a blank
page
> on login.php. I'd appreciate any insights on why that's happening.
>
>


--- End Message ---
--- Begin Message ---
Issue resolved!

It turned out to be the use of quotations. Instead of double quotations to
surround the $insert variable, it worked with single quotations:

$insert = ' INSERT INTO user_info
       (login,password)
       VALUES
       ("'.$login.'", "'.$password.'") ' ;


With the real_escape_string, this version worked (double quotation on the
outside, single quotation on the inside):

( " '.mysql_real_escape_string($login).' ",  "
'.mysql_real_escape_string($password).' ")';


I'm not sure why the use of quotations works differently in different cases?


Thanks for your insights! It really helped with diagnostics. Much
appreciated!



On Sun, Feb 20, 2011 at 3:59 PM, <ad...@buskirkgraphics.com> wrote:

> I see an errors in the syntax.
>
> $insert = "INSERT INTO user_info (login, password) VALUES
>
> ('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($passwor
> d)."')";
>
> Issues resolved.
> $insert = "INSERT INTO user_info (login, password) VALUES
>
> ('".mysql_real_escape_string($login)."','".mysql_real_escape_string($passwor
> d)."')";
>
> Here is the issue
>
> ," '.mysql_real_escape_string($password)." '
>
> Your escaping incorrectly.
>
> It should be
> ,' ".mysql_real_escape_string($password)." '
>
> The double quote is in the wrong place.
>
>
>
>
>
> -----Original Message-----
> From: Nazish [mailto:naz...@gmail.com]
> Sent: Sunday, February 20, 2011 3:54 PM
> To: php-gene...@lists.php.net
> Subject: Re: [PHP] Submitting data to MySQL database using HTML/PHP form
>
> Update:
>
> I added "echo" statements after mysql_connect and mysql_select_db to check
> where the code was broken. These statements show up on the login.php page
> after submitting the form, which means the MySQL connection works. So, the
> problem seems to lie with the *$insert *query... ideas?
>
>
> On Sun, Feb 20, 2011 at 3:04 PM, Nazish <naz...@gmail.com> wrote:
>
> > Thanks everyone! However, when I click the "submit" button, the url
> simply
> > moves to http://localhost/login.php (from home.php) and it is a blank
> page
> > (apart from asking whether it should remember the password for future
> use).
> > The values still do not move to the database.
> >
> > I included most of your suggestions
> >
> > a) added mysql _error()
> > b) different names for the variables
> > c) removed double quotes
> > d) changed ?> (silly error!)
> > e) modified the $insert query
> >
> > The code now looks like this:
> >
> >
> > <?php
> >
> > // Connect to server and select database.
> > $host = "localhost";
> > $user = "root";
> > $mysql_pass = "abc";
> > $db = "directory";
> >
> > mysql_connect($host, $user, $mysql_pass) or die(mysql_error());
> >
> > mysql_select_db($db) or die(mysql_error());
> >
> > // username and password sent to mysql database
> >
> >
> > $login = $_POST['login'];
> > $password = $_POST['password'];
> >
> > $insert = "INSERT INTO user_info
> >        (login, password)
> >         VALUES
> >
> >
>
> ('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($passwor
> d)."')";
> >
> >
> > mysql_query($insert)
> > or  die  ("Unable  to  add user to the database:".mysql_error());
> >
> > ?>
> >
> >
> > I could insert the values using the command line, and it was updated in
> > MySQL, but it doesn't work through the form... it just goes to a blank
> page
> > on login.php. I'd appreciate any insights on why that's happening.
> >
> >
>
>

--- End Message ---
--- Begin Message --- I'm wondering if anyone is going to comment on the transmittal and storage of plain text passwords....


--- End Message ---
--- Begin Message ---
Hello Tamara,

:-)) I assume that was a testcase...

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

------------ Original message ------------
From: Tamara Temple <tamouse.li...@gmail.com>
To: PHP General
Date created: , 12:27:46 AM
Subject: [PHP] Submitting data to MySQL database using HTML/PHP form


      I'm wondering if anyone is going to comment on the transmittal and  
storage of plain text passwords....


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Hm.

Commented out the line & re-tested. Absolutely no change whatsoever :(
Even made it false.

I'm really hoping I've been an idiot on this one. Makes no sense
otherwise but this is where I am.

Hope to hear further suggestions.

James

On 20 February 2011 03:05, Daniel Brown <danbr...@php.net> wrote:
> On Fri, Feb 18, 2011 at 10:21, James Green <james.mk.gr...@gmail.com> wrote:
>> Been reading through
>> http://uk.php.net/manual/en/features.connection-handling.php and
>> trying to implement a solution using it. So far the documented
>> behaviour rarely occurs.
>>
>> This code is a minimal test case: http://codepad.org/GqNlcWiM
>>
>> I run this behind Apache 2.2 with PHP 5.3 on Linux. The in-line
>> comments explain the problem. I load in the browser and hit stop
>> pretty much immediately but PHP does not get signalled that the user
>> has aborted and continues.
>>
>> From memory of having to restart apache after hitting long-running
>> scripts in the past, I don't ever believe I've had a script terminate
>> on a user abort. And I've never switched the behaviour from default.
>>
>> I read several people explain this behaviour would only ever work in
>> writing back to the client and to flush the buffer, which is included
>> in the test case. I've also removed any compression from within
>> Apache.
>>
>> Can anyone explain what I've seeing? I've tried this using Lighttpd/Windows 
>> too.
>
>    Look at line #4.  You're telling PHP that you don't give a damn if
> someone tries to quit, you're going to continue anyway.  You storm
> trooper, you.
>
>    If PHP is instructed to ignore the user's (futile) attempts to
> abort, why should it try to gentlemanly and politely respect a
> shutdown function?  Essentially, you're damning it to zombiehood.
>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> Documentation, Webmaster Teams
> http://www.php.net/
>

--- End Message ---
--- Begin Message ---
At 2:03 PM -0500 2/18/11, Pete Woodhead wrote:
Hi I'm Pete Woodhead.  I'm new to the list and to PHP.  To be honest I very
new to code writing.
Thought this would be a good way to learn good habits as well as good code
writing.
Looking forward to learning and participating.

Pete:

Welcome to the gang.

Minor points:

1. It's not "code writing", it's "coding".

2. You are not a "code writer", but rather a "coder".

You can also be called a "computer programmer" or a "programer" for short -- not to mention some of the other names we are often called. :-)

Cheers,

tedd

--
-------
http://sperling.com/

--- End Message ---
--- Begin Message ---
On 18 February 2011 19:03, Pete Woodhead <pete.woodhea...@gmail.com> wrote:
> Hi I'm Pete Woodhead.  I'm new to the list and to PHP.  To be honest I very
> new to code writing.
> Thought this would be a good way to learn good habits as well as good code
> writing.
> Looking forward to learning and participating.
>

Assume that all the data you get from the user is out to get you. It
probably isn't. Most of the time. But when it does, it'll be your
fault. Unless you've left the company by then.

Also, poka-yoke is a great concept to learn about (thanks to a great
article in php|Architect all the way back when).

Richard.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
On 20 February 2011 23:34, Richard Quadling <rquadl...@gmail.com> wrote:
> On 18 February 2011 19:03, Pete Woodhead <pete.woodhea...@gmail.com> wrote:
>> Hi I'm Pete Woodhead.  I'm new to the list and to PHP.  To be honest I very
>> new to code writing.
>> Thought this would be a good way to learn good habits as well as good code
>> writing.
>> Looking forward to learning and participating.
>>
>
> Assume that all the data you get from the user is out to get you. It
> probably isn't. Most of the time. But when it does, it'll be your
> fault. Unless you've left the company by then.
>
> Also, poka-yoke is a great concept to learn about (thanks to a great
> article in php|Architect all the way back when).
>
> Richard.
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>

http://www.phparch.com/magazine/2006-2/february/ in case anyone was wondering.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---
--- Begin Message ---
21.02.2011 01:41, Richard Quadling yazmış:
On 20 February 2011 23:34, Richard Quadling<rquadl...@gmail.com>  wrote:
On 18 February 2011 19:03, Pete Woodhead<pete.woodhea...@gmail.com>  wrote:
Hi I'm Pete Woodhead.  I'm new to the list and to PHP.  To be honest I very
new to code writing.
Thought this would be a good way to learn good habits as well as good code
writing.
Looking forward to learning and participating.

Assume that all the data you get from the user is out to get you. It
probably isn't. Most of the time. But when it does, it'll be your
fault. Unless you've left the company by then.

Also, poka-yoke is a great concept to learn about (thanks to a great
article in php|Architect all the way back when).

Richard.

--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

http://www.phparch.com/magazine/2006-2/february/ in case anyone was wondering.

i'm interested in php about 3 maybe 4 years but i still couldnt get the logic of classes. it makes no sense to me. i couldnt understand whats about classes good at or how to use or write it. and i can say that " is 'class' really necessery? "
--- End Message ---
--- Begin Message ---

On Feb 20, 2011, at 5:51 PM, tolga wrote:

21.02.2011 01:41, Richard Quadling yazmış:
On 20 February 2011 23:34, Richard Quadling<rquadl...@gmail.com> wrote:
On 18 February 2011 19:03, Pete Woodhead<pete.woodhea...@gmail.com> wrote:
Hi I'm Pete Woodhead. I'm new to the list and to PHP. To be honest I very
new to code writing.
Thought this would be a good way to learn good habits as well as good code
writing.
Looking forward to learning and participating.

Assume that all the data you get from the user is out to get you. It
probably isn't. Most of the time. But when it does, it'll be your
fault. Unless you've left the company by then.

Also, poka-yoke is a great concept to learn about (thanks to a great
article in php|Architect all the way back when).

Richard.

--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

http://www.phparch.com/magazine/2006-2/february/ in case anyone was wondering.

i'm interested in php about 3 maybe 4 years but i still couldnt get the logic of classes. it makes no sense to me. i couldnt understand whats about classes good at or how to use or write it. and i can say that " is 'class' really necessery? "

a class is construct of Object Oriented PHP. If you don't understand object oriented programming, you'll likely not understand the use of object and classes in PHP, either. There are good reasons to use object oriented principles in PHP and other langages, and good reasons to use procedural principles in PHP as well. Learning when to use either is important. Learning how to use classes someone else implements is also important to keep from re-re-re-re-re-reinventing the wheel.


--- End Message ---
--- Begin Message ---
On 20 February 2011 12:24, Vlatko Šurlan <mrdo...@gmail.com> wrote:
> John Taylor-Johnston wrote:
>>
>> 9970318527584

Not an ISBN number. In fact Google only shows this thread for this number.

The hex value is uninspiring 0x911654B4C60

As is the octal 0221054522646140 and binary
10010001000101100101010010110100110001100000

Base64 OTk3MDMxODUyNzU4NA==, base36 3j8au840w ... nada.

Nothing about this number is jumping out at me.




-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

--- End Message ---

Reply via email to