PDA

View Full Version : Learning Programming Using php


viscousmemories
08-20-2004, 10:25 PM
I want to learn programming using php. A lot of people have told me that it's better to learn something old first (like perl or C) or something object oriented but more prevalent (like C++ or Java) but I don't wanna! The primary reason for this is that vBulletin is written in php. It may not be the optimal language, but as much as I've always been interested in programming for its own sake, I'm more interested in the practical benefit of knowing php. If I knew how to program in php, not only could I customize the FF more but I could peddle my abilities elsewhere on the 'net and make enough money sitting here to avoid having to go outside and find a job.

So...

I've done several php tutorials on line start to finish. I've installed numerous hacks to this site and to the previous phpBB sites I've worked on (like HH). However, I'm stuck and I don't know how to move forward. There seems to be a big gap between what I know and what I need to know to make even the simplest changes to the vBulletin code, but I'm not even sure if that gap is logical or physical (or for that matter if that even makes sense).

So for you computer programmers out there (and I know you're out there) can you tell me what to do? I've already looked at the local college course catalog and they offer only perl, javascript and C++ classes. I could buy a For Dummies or Sam's teach yourself Rocket Science in 15 minutes book, but something tells me that won't carry me much further (farther?).

Anyway. Help!

JoeP
08-21-2004, 01:04 AM
I'm with you on this.

Don't necessarily agree you should learn C or whatever first. But I do think you would benefit from learning php on its own and keeping the vbulletin specifics out of the way to start with. Installing a vb hack is a very different thing from writing a program/page in php.

My strategy (which I have hardly pursued since our last conversation on the subject) is to try things out on my personal website, which I've realised has php support. And just to mess around.

Have you done any programming? Even visual basic?

Goliath
08-21-2004, 01:14 AM
Sorry, but I can't really help you. I know very little programming (most of what I've learned and not completely forgotten is Mathematica and LaTeX (if you cound LaTeX as a "language")).

Programming tends to frustrate me to no end. I always enter crap in just slightly wrong over and over again until I'm screaming at the compiler, saying something like "I COULD'VE DONE THIS BY HAND BY NOW!!!"

:P

viscousmemories
08-21-2004, 01:17 AM
I'm with you on this.

Don't necessarily agree you should learn C or whatever first. But I do think you would benefit from learning php on its own and keeping the vbulletin specifics out of the way to start with. Installing a vb hack is a very different thing from writing a program/page in php.
Definitely. Besides, Jelsoft provides absolutely no technical documentation with the software. Not even a list of the available conditionals or functions. So I don't know how I could possibly get a solid grip on it without having a solid grip on php first.

My strategy (which I have hardly pursued since our last conversation on the subject) is to try things out on my personal website, which I've realised has php support. And just to mess around.
I do have a copy of the software installed on my home server to mess around with, and I've done a fair amount of that. Unfortunately I honestly can't figure out the simplest things. I can make template modifications because that doesn't involve actual coding, just HTML and some conditionals, etc. But when it comes to a change that involves editing the php files I'm pretty much lost.

Have you done any programming? Even visual basic?
No, not really. Nothing worth mentioning anyway. Half a college-level intro to Pascal. That's part of my problem. I kinda suspect I have as much technical knowledge to do some superficial hacking (after all I know what a loop, array, and everything else you can learn from an intro tutorial is and how they basically function) but I completely lack knowledge of programming logic.

viscousmemories
08-21-2004, 01:44 AM
Sorry, but I can't really help you. I know very little programming (most of what I've learned and not completely forgotten is Mathematica and LaTeX (if you cound LaTeX as a "language")).

Programming tends to frustrate me to no end. I always enter crap in just slightly wrong over and over again until I'm screaming at the compiler, saying something like "I COULD'VE DONE THIS BY HAND BY NOW!!!"

:P
Yeah, I'm the same way except for some reason I still like it. I'll occasionally install a hack or something and make a minor error, then spend the entire day and night - while chewing on my tongue and pondering whether it would be more efficient use of my time and money to patch holes in the walls or buy a new monitor, of course - trying to figure out what's wrong. But in the end when I find the glitch the feeling that I Am A Genius actually dwarfs all the anger and frustration. :yup:

Goliath
08-21-2004, 02:14 AM
Yeah, the feeling of finding an error is kinda cool. Awhile back, I wrote a rather lenghty program in Mathematica to help me with my research. Once I start getting off my lazy ass and continue with it, the program will help me form some conjectures for some research that should make a good paper.

viscousmemories
08-21-2004, 02:26 AM
Yeah, the feeling of finding an error is kinda cool. Awhile back, I wrote a rather lenghty program in Mathematica to help me with my research.
Honestly I swear I've never even heard of Mathematica. Is it a derivitive of another language or something?

Once I start getting off my lazy ass and continue with it, the program will help me form some conjectures for some research that should make a good paper.
Well don't let it interefere with the article you're working on for us! :P

JoeP
08-21-2004, 06:06 PM
But in the end when I find the glitch the feeling that I Am A Genius actually dwarfs all the anger and frustration. :yup:
I know that feeling - vm is a genius I am a genius! After hours or days of struggle. Of course, sometimes it's "I'm an idiot" when the solution is something blindingly obvious.

So, to the matter: how are we going to turn you into a professional and sought-after programmer?

Paging farren who actually is one.

Tutorials - and college courses and everything - don't actually teach you to be a programmer. You have to take on programming challenges and beat them. So you need a programming task that means something to you, that you actually need to do ... but is not as big as "rewrite vbulletin". What do you feel a need for?

wade-w
08-21-2004, 06:31 PM
Honestly I swear I've never even heard of Mathematica. Is it a derivitive of another language or something?


Well don't let it interefere with the article you're working on for us! :P

Mathematica is a professional grade software package for doing Mathematics made by Wolfram Research. At it's most basic, it'll do calculus and differential equations, and similar types of stuff. You can also get add on modules to do more advanced things like linear algebra or differential geometry. It's a pretty powerful package, and it's programmable, with it's own "language".

The only reason I know about it is that I was once spent about 3 1/2 years as the lead IT person for the Mathematics and Computer Science departments at a large university. I had to support both Mathematica and Maple.

viscousmemories
08-22-2004, 12:36 AM
I know that feeling - vm is a genius I am a genius! After hours or days of struggle. Of course, sometimes it's "I'm an idiot" when the solution is something blindingly obvious.
Hmm... nope. Not for me. It's always I'm A Genius! :)

Okay okay. It's usually "I'm an idiot". :(

So, to the matter: how are we going to turn you into a professional and sought-after programmer?

Paging farren who actually is one.
I'd love to find a programmer who will actually answer that question in a useful way. I haven't yet, and not for a lack of trying. :P

Tutorials - and college courses and everything - don't actually teach you to be a programmer. You have to take on programming challenges and beat them. So you need a programming task that means something to you, that you actually need to do ... but is not as big as "rewrite vbulletin". What do you feel a need for?
Excellent point and question. Hmm... the only thing I can thing of off the top of my head is I'd like to somehow separate the "Who's Online" list from the "Mark forums read" in the cookie settings. :didi:

viscousmemories
08-22-2004, 12:37 AM
The only reason I know about it is that I was once spent about 3 1/2 years as the lead IT person for the Mathematics and Computer Science departments at a large university. I had to support both Mathematica and Maple.
Ah, thanks. Now that you put it that way it sounds vaguely familiar. I used to work in retail sales at a software store in a college town, and I think we might've sold that. I didn't work there long enough to become intimately familiar with the products.

JoeP
08-22-2004, 01:21 PM
Excellent point and question. Hmm... the only thing I can thing of off the top of my head is I'd like to somehow separate the "Who's Online" list from the "Mark forums read" in the cookie settings. :didi:
Good need ... but still one that relies on knowing vb. I meant something that could stand on its own on a web page. I must admit I'm drawing a blank myself, unless it's something with a database (and my hosting option doesn't include that so I'll have to download apache + php + mysql and run it on my own machine. One day)

viscousmemories
08-22-2004, 03:23 PM
Good need ... but still one that relies on knowing vb. I meant something that could stand on its own on a web page. I must admit I'm drawing a blank myself, unless it's something with a database (and my hosting option doesn't include that so I'll have to download apache + php + mysql and run it on my own machine. One day)
We've got plenty of space on our vps, as well as shell and ftp access, unlimited databases, etc. and the ability to install any software we want. So if you can think of a project you want to work on I can set you up.

JoeP
08-22-2004, 08:16 PM
We've got plenty of space on our vps, as well as shell and ftp access, unlimited databases, etc. and the ability to install any software we want. So if you can think of a project you want to work on I can set you up.
:pant: :pant: :pant:

Let's work on a keyword facility for smilies.

How many do you have? I thought you said 200+ but there are waaaaay more than that!

viscousmemories
08-22-2004, 08:46 PM
:pant: :pant: :pant:

Let's work on a keyword facility for smilies.

How many do you have? I thought you said 200+ but there are waaaaay more than that!
Heheh... well that's really liv's department, but IIRC it was nearly 1000 at last count. :)

livius drusus
08-22-2004, 08:52 PM
955 to be precise, gentlemen. I make no guarantees that the number will remain constant. :groucho:

JoeP
08-23-2004, 11:13 PM
... I can set you up.
So have you set me up? The :pant: smilie was not idly chosen.

viscousmemories
08-23-2004, 11:26 PM
So have you set me up? The :pant: smilie was not idly chosen.
:D

I haven't had a chance yet. Do you want a test vb installation to mess with or just access to the server at this juncture? Or...?

JoeP
08-24-2004, 10:14 AM
If by access to the server you mean I could mess it up ... then maybe a test installation would be a safer first step :)

JoeP
08-24-2004, 10:58 PM
btw, don't strain yourself on my account. where have I heard this recently? I'm going away on Saturday and will be Without Internet Access :eek: :violin: for a whole week.

viscousmemories
08-24-2004, 11:03 PM
btw, don't strain yourself on my account. where have I heard this recently? I'm going away on Saturday and will be Without Internet Access :eek: :violin: for a whole week.
:jawdrop: Well that's really too bad. Now all I have to feel guilty about is not getting around to job hunting. Thanks a lot.

Corona688
08-27-2004, 03:49 PM
I'm not sure that php would be the best language to START programming with. Correct me if I'm wrong, but isn't php completely tied to web servers? That means when something goes wrong it's bitching hard to debug. Perl at least, you can drop to command prompt and run the script directly when the server starts telling you 'the server has had an internal error', most useless error message ever :fuming:

...OK, not quite the most useless. The most useless is 'Error: No error', or maybye 'Not enough memory to completely display the'.

JoeP
08-27-2004, 11:12 PM
'User error: replace user and continue'

JoeP
08-27-2004, 11:55 PM
I'm going away on Saturday and will be Without Internet Access :eek: :violin: for a whole week.
Holiday starts now. :D See you guys next weekend. :wink:

viscousmemories
08-27-2004, 11:58 PM
Holiday starts now. :D See you guys next weekend. :wink:
Okay, Joe! Good luck! I'll leave a light on for ya, really. :)

MinorityReport
08-28-2004, 01:30 AM
I'm not sure that php would be the best language to START programming with. Correct me if I'm wrong, but isn't php completely tied to web servers? That means when something goes wrong it's bitching hard to debug. Perl at least, you can drop to command prompt and run the script directly when the server starts telling you 'the server has had an internal error', most useless error message ever :fuming:

...OK, not quite the most useless. The most useless is 'Error: No error', or maybye 'Not enough memory to completely display the'.

PHP runs from the command line, too, but it's mostly used as a module in a web server such as Apache. You can use PHP to do just about anything you'd use Perl for, although the different languages have their strengths and weaknesses.

I have to admit that I don't understand vm's problem, but this may be because I've been a programmer now for twice as long as I wasn't a programmer (and most of that previous time was spent acquiring the skills I needed to start being a programmer).

Here's an example of some tiny PHP programming that I did with another PHP-based forum package, PHPBB, in order to make it impossible for non-members to snoop. I use the standard "example.com" domain in my examples, as per RFC 2606. This is not a real domain owned by anyone, it's specifically designated for use in examples, so nobody is inconvenienced if someone mistakenly clicks on a link or types these URLs into a browser.

The problem:

I wanted to make it impossible for a person who hadn't logged in to do anything but log in. So nobody who didn't come to the site with a valid username and password could possibly find out what was going on.
Normally, PHPBB permits people who aren't logged in (guests) to see the list of users, to register, and so on. It's possible to forbid guests to see posts, but they can still snoop around and find out a bit about who is using the forum. They may go through all the trouble of filling out the registration form, only to find that they won't be allowed to join.

Formulating a solution

So I formulated what I wanted to do as a bit of logic, which expressed in pseudocode or structured english is:

if user is a guest then
Redirect to login page
endifIf I stick this in front of every web page that I don't want guests to see, I reasoned, this would do the job.

Making the solution work

So now I needed to find out five things:

How to find out whether the current user is logged in. If not, he's a guest.
How to make PHP cause a redirection from one page to another (this means that if you typed the url of one page into the browser, the server would tell it to load another page instead).
The URL of the login page.
The PHP files containing all the pages that I want to redirect to the login page
Where in each PHP file to stick my "test and redirect" code.

I poked around in the code looking for likely bits, until I found that the way to test to see if a user was logged in (in PHPBB, though not in other PHP-based forum packages, which are all different) was:

if (!$userdata['session_logged_in'])
{
// User is not logged in if we get here
}And the way to redirect in PHP is to use the header() function to send a HTTP 'Location:' header to the browser. For example:

header('Location: http://www.example.com/somewheretogo.php');The URL of the login page for any PHPBB website is of the form:

http://www.example.com/exampleforum/login.phpI found the URLs of all the files in question by snooping my site and finding places I could get in that I thought a guest shouldn't, and noting the URL. The filename was always the final part of the URL (eg: register.php).

The code fragment to be added was thus something like:

if (!$userdata['session_logged_in'])
{
// User is not logged in if we get here
header('Location: http://www.example.com/exampleforum/login.php');
}Where to put it? Well as early as possible, obviously. Well before any of the web page was constructed--because you cannot send HTTP headers in this way after parts of the web page have been sent to the browser. But it must be after the $userdata array was populated, otherwise testing $userdata['session_logged_in'] would not give a valid result.

Fortunately in most of the PHP files I wanted to edit, there was a section that went:

init_userprefs($userdata);On investigating my expectation that the init_userprefs() function populates the $userdata array was confirmed. By a process that I won't go into here, this code looks to see if there's a certain cookie on the user's browser, and if so it retrieves certain items of data from its database concerning the session. If there is no cookie, the user must not be logged in.

So the next (and final) thing to do was to insert my code fragment after the init_userprefs() call in each of the files memberlist.php, register.php and so on. The result was perfect. Clicking on the standard navigations (Search, memberlist, register, etc) at the head of the PHPBB page when not logged in always took the user back to the login page.

Confession

Please bear in mind that I have compressed several hours work here, and have omitted the many blind alleys, the wrong guesses, the failures, and the cycles of testing that went into producing a working solution. Here I'm trying to illustrate how it's possible to combine a rudimentary understanding of PHP with a basic understanding of HTTP and a willingness to scan the source code to find out how it functions and how it can be modified to produce a desired result.

viscousmemories
08-28-2004, 04:08 AM
Wow. That's a really great post, Minority Report. Having installed a number of hacks (including a phpBB hack that does almost exactly what you describe) much of it was familiar to me. But seeing the whole process laid out like that makes the logic much more clear to me. Plus there are a couple parts I just wouldn't have thought of, like making sure the userdata array is populated before inserting that code snippet. This post will definitely help me along the road to being a better hacker. Thanks. :yup:

MinorityReport
08-28-2004, 01:50 PM
Yes, I think the methods are easy enough to learn but are not necessarily taught in coding courses that concentrate on introducing a programming language. The basic tool is analytical decomposition. I had a vague idea of what I needed to do early on, and to turn that into a solution I had to break it down into those five small investigations I list at the beginning of the "Making it work" section.

You become good at this by experience. For instance, write a basic "Hello world" page and then find out how to alter it to permit the user to then enter his name, and greet the person by name. This breaks down into three parts:

Produce a HTML page that permits a user to enter his name and send it to the server using either the HTTP GET or HTTP POST method.
Produce PHP that detects when a user has entered a name via the appropriate HTTP method.
Embed PHP to write the name into the HTML page as part of the greeting.

So even at the most basic level it pays to decompose a task into smaller ones, and the skills learned in this exercise would be applicable to nearly every piece of PHP code you are likely to write in future.

Incidentally I do agree that PHP is a more generally useful language than most. Unless you intend to specialize in large scale, high reliability server applications or desktop applications written in C++ or C, the compiled languages are less suitable for development because of their very low-level nature. Scripting languages such as Perl, PHP and even ASP provide most of the linguistic richness you get from these languages, but also come with a much more complete set of practical high level constructs. Provided you can live with the relatively brittle nature of scripted applications, they're more suitable for performiing practical day-to-day tasks.

ceptimus
08-31-2004, 11:46 PM
Problem with learning PHP as your first computer language, is that it is mostly used to produce HTML so you need to know HTML too. Also PHP usually works in harness with a database (often MySQL) and you'll need to learn that as well.

The basics of the PHP language is almost exactly the same as C (which is almost exactly the same as java) except for the variables. Variables in PHP are the same as the ones in Perl.

But the main thing with learning a computer language is motivation. If you are motivated to learn PHP, then that is the one for you. Once you learn any computer language, you'll find learning the next and subsequent ones easier.

My advice is, if you don't know any HTML, learn a bit of that first - this could be seen as the first rung on the ladder of learning PHP.

A good reference is the 'Bible' book - "PHP5 and MySQL Bible" or one of the other editions.

viscousmemories
09-01-2004, 12:21 AM
Problem with learning PHP as your first computer language, is that it is mostly used to produce HTML so you need to know HTML too. Also PHP usually works in harness with a database (often MySQL) and you'll need to learn that as well.
Well fortunately I know HTML very well, so that's not an issue. I don't know much about databases, but as much as was necessary to set up phpBB and vBulletin, plus use phpmyadmin to mess around with the data.

The basics of the PHP language is almost exactly the same as C (which is almost exactly the same as java) except for the variables. Variables in PHP are the same as the ones in Perl.
Interesting. I didn't know that.

But the main thing with learning a computer language is motivation. If you are motivated to learn PHP, then that is the one for you. Once you learn any computer language, you'll find learning the next and subsequent ones easier.
To me that's the key. I am definitely most motivated to learn php because of this site and other forum sites I've worked on and/or will work on in.

My advice is, if you don't know any HTML, learn a bit of that first - this could be seen as the first rung on the ladder of learning PHP.

A good reference is the 'Bible' book - "PHP5 and MySQL Bible" or one of the other editions.
I'll look for those when I'm able to get a book. Any good online resources you know of? I'm already aware of php.net, phpfreaks, and a couple others...

livius drusus
09-03-2004, 06:24 AM
955 to be precise, gentlemen. I make no guarantees that the number will remain constant.

Did I say 955? I meant 968. Sorry. Typo. :giggle:

viscousmemories
09-06-2004, 11:29 PM
Yes, I think the methods are easy enough to learn but are not necessarily taught in coding courses that concentrate on introducing a programming language. The basic tool is analytical decomposition. I had a vague idea of what I needed to do early on, and to turn that into a solution I had to break it down into those five small investigations I list at the beginning of the "Making it work" section.

You become good at this by experience. For instance, write a basic "Hello world" page and then find out how to alter it to permit the user to then enter his name, and greet the person by name. This breaks down into three parts:

Produce a HTML page that permits a user to enter his name and send it to the server using either the HTTP GET or HTTP POST method.
Produce PHP that detects when a user has entered a name via the appropriate HTTP method.
Embed PHP to write the name into the HTML page as part of the greeting.

So even at the most basic level it pays to decompose a task into smaller ones, and the skills learned in this exercise would be applicable to nearly every piece of PHP code you are likely to write in future.

Incidentally I do agree that PHP is a more generally useful language than most. Unless you intend to specialize in large scale, high reliability server applications or desktop applications written in C++ or C, the compiled languages are less suitable for development because of their very low-level nature. Scripting languages such as Perl, PHP and even ASP provide most of the linguistic richness you get from these languages, but also come with a much more complete set of practical high level constructs. Provided you can live with the relatively brittle nature of scripted applications, they're more suitable for performiing practical day-to-day tasks.
Btw, this was another really helpful post Minority Report. It just occurred to me that I never said as much despite thinking it. Thanks. :)

EvilYeti
09-15-2004, 04:05 AM
So for you computer programmers out there (and I know you're out there) can you tell me what to do? I've already looked at the local college course catalog and they offer only perl, javascript and C++ classes. I could buy a For Dummies or Sam's teach yourself Rocket Science in 15 minutes book, but something tells me that won't carry me much further (farther?).


Well, first of all, do you have a apache/php you can play on without worrying about breaking anything important? The best way to learn programming is by doing, especially doing dangerous things. And personally, I feel php is a fine language to learn to program with. It's higher level then C and sports a much cleaner design that perl.

While I don't know much about your background, I would say the real problem you are facing is that you don't have a solid grasp of the underlying theory of programming. That and you are probably also going to encounter what I call "minutae overload", i.e. dozens of annoying little technical details that will get in the way of whatever you are trying to do. All I can say about the latter is have patience, persistence and google.

Regarding the former, well thats a tough one. People go to school for four years to learn software engineering skills; its a process that you cannot really shortcut. A good way to start is to check out the language reference for php @ http://www.php.net/manual/en/langref.php . Go through each line item one at a time and look it up if you don't understand what it means. It's helpful here if you have a friend with a comp. sci. education to help you out.

For example, consider "types". If you don't know what that means relative to php, figure it out before continuing. Once you understand that, look through the types available to php (e.g. boolean, integers, floats, strings, etc) and make sure you understand what each one of those means. And I mean really understand, i.e. you see where each would be applicable is solving a problem in the real world.

Once you have a solid understanding of the programming contructs available to you, try writing out the some pseudocode or flowcharts for a simple program. Once you have the basic design down, try writing little bits of it and getting them to work first. Its imperative that you figure out how to see errors from php, to help you debug your programs. A good way to do this is use the command-line interpreter first. See if you can find a guru that can help you get past any road blocks you encounter. Once you get one fragment working, start on the next. Use the php.net to research functions and language features and particluar attention to the comments, they are very helpful.

Now that I think about it, probably what you want is an into to computer science/programming book or course. Unfortunately I'm not aware of any that specifically use php, but the language really doesn't matter. I hear some colleges are using python, which is another great langugage, so if you can find something like that it will serve you well.

Also check out the php entry @wikipedia, http://en.wikipedia.org/wiki/Php
... especially the tutorials section.

viscousmemories
09-15-2004, 06:11 AM
Well, first of all, do you have a apache/php you can play on without worrying about breaking anything important? The best way to learn programming is by doing, especially doing dangerous things. And personally, I feel php is a fine language to learn to program with. It's higher level then C and sports a much cleaner design that perl.
I do. I have a 'nix server at home with a web server set up, plus this site is hosted on a vps with plenty of room, so I have a live test environment too. Did you see this thread (http://www.freethought-forum.com/forum/showthread.php?t=422) about the smilie project we're working on? So far JoeP is doing the bulk of the coding, but he's annotating the code nicely so I can get a feel for what does what. I've already learned a lot.

While I don't know much about your background, I would say the real problem you are facing is that you don't have a solid grasp of the underlying theory of programming. That and you are probably also going to encounter what I call "minutae overload", i.e. dozens of annoying little technical details that will get in the way of whatever you are trying to do. All I can say about the latter is have patience, persistence and google.
You're right that I don't have any background in programming theory. I worked as a Novell network engineer for about 8 years so I have a lot of hands on computing experience, but nothing really focused on programming. I don't have patience but I do have obsessive (er... persistent) and Google. ;)

Regarding the former, well thats a tough one. People go to school for four years to learn software engineering skills; its a process that you cannot really shortcut. A good way to start is to check out the language reference for php @ http://www.php.net/manual/en/langref.php . Go through each line item one at a time and look it up if you don't understand what it means. It's helpful here if you have a friend with a comp. sci. education to help you out.
Reading the language reference is an excellent idea. I'll start on that right away. Since I'm working with php here with vBulletin I started by reading the vBulletin code standards. I actually found a bug in the logic of one of their simple examples and submitted a Bug report (now marked fixed and closed) at their website. I was pretty pleased with myself for that one.

For example, consider "types". If you don't know what that means relative to php, figure it out before continuing. Once you understand that, look through the types available to php (e.g. boolean, integers, floats, strings, etc) and make sure you understand what each one of those means. And I mean really understand, i.e. you see where each would be applicable is solving a problem in the real world.
Roger.

Once you have a solid understanding of the programming contructs available to you, try writing out the some pseudocode or flowcharts for a simple program. Once you have the basic design down, try writing little bits of it and getting them to work first. Its imperative that you figure out how to see errors from php, to help you debug your programs. A good way to do this is use the command-line interpreter first. See if you can find a guru that can help you get past any road blocks you encounter. Once you get one fragment working, start on the next. Use the php.net to research functions and language features and particluar attention to the comments, they are very helpful.
I didn't even know there was a command-line interpreter for php...

Now that I think about it, probably what you want is an into to computer science/programming book or course. Unfortunately I'm not aware of any that specifically use php, but the language really doesn't matter. I hear some colleges are using python, which is another great langugage, so if you can find something like that it will serve you well.
Well a book and/or course are unfortunately out of the question at the moment, as I'm broke. But I think you're right. As soon as I can I'll get something. Actually my housemate might have something like that. I'll check.

Also check out the php entry @wikipedia, http://en.wikipedia.org/wiki/Php
... especially the tutorials section.
Cool, I love wikipedia but I hadn't thought to look there for php info. Thanks. :)

Oh, and :welcome: to the FF. Good to see ya here.

seebs
09-16-2004, 08:13 AM
Hi. I'm a programmer, and I didn't ever get taught. I got lucky; my parents never told me I couldn't program, so I just did it anyway.

http://www.plethora.net/~seebs/c/growup.html

Dennis Ritchie once told me that he thought I was the only other person he'd ever met who never had to learn C.

seebs
10-02-2004, 09:00 PM
Ironically, I already know programming, and now I have a need to learn PHP very quickly. I'm setting up a web page for the studio my wife is in, and I want to use PHP for some stuff, because it will reduce the hassle of doing CGI scripts. (Suexec doesn't scale well to my context.)

JoeP
10-02-2004, 10:27 PM
You'll find it easy enough, using www.php.net/manual, and if you like tutorials, the links vm's posted above.

... vm, are you ready for another project?

viscousmemories
10-02-2004, 10:48 PM
You'll find it easy enough, using www.php.net/manual, and if you like tutorials, the links vm's posted above.

... vm, are you ready for another project?

Sure thing. Watcha got on your mind?

seebs
10-03-2004, 12:28 AM
What's actually kicking my ass so far is that I really want Apache to run virtual servers ENTIRELY as the specified user; I want PHP scripts and everything to run as that user, not just suexec for CGI scripts. But this cannot be.

More subtly, I had the idea of having www.example.com/user go to ~user, but this breaks suexec; it wants www.example.com/user to be run as the ID associated with the virtual host, and I can't say "but this path gets special treatment". Waah!

But I'm making progress, by accepting that PHP scripts will need group privs to scribble on databases.

One last thing to figure out, which is PHP scripts trying to get at a PostgreSQL database hanging indefinitely, and I can have the stuff I promised the girls up and running.

JoeP
10-03-2004, 12:43 AM
... vm, are you ready for another project?

Sure thing. Watcha got on your mind?

One you do by yourself (but on the test system so I can see your code and template), calling for help in the form of answers in English rather than in code - you know what I mean here - show how not do it for you. *Various proverbs and witticisms apply here.*

I was thinking of something probably trivially simple - make a panel to edit multiple smilie keywords at once. (And then package up this feature as something for the wider vb community.) Do we discuss this here or at the test forum?

viscousmemories
10-03-2004, 01:13 AM
Sounds good. Let's discuss at the test forum. :)