Jump to content

[SOLVED] need advice on learning php please , php is my dream goal


silverglade

Recommended Posts

hi, my dream in life is to be a great php programmer, and at this point it seems impossible now, so im pretty depressed. the only code i fully understood was this guestbook which was very simple code, but when i went to put the "captcha" code to my guestbook i had no clue. im always running into code that is way over my head when i try to do a project in php. i went through the w3schools.com tutorials and php.net functions and dont know any sql commands, but the captcha code is so advanced. i was wondering if anyone could give me advice on how to understand the more complex code when it goes over my head, because at this point , i stopped studying and just sat around all day depressed because i cant figure out the code. please, if anyone can give me some advice on exactly how to proceed and what i should do exactly in steps i would FOREVER be grateful, because at this point im at the end of my rope. thank you in advance. sorry for posting similar subjects but i dont think i was as clear in my last posts about this. thank you. derek

Link to comment
Share on other sites

Go to the w3school php tutorials and follow them exactly as they are laid out. They go from simple to advanced for a reason :D

 

My advice would be to just create a very simple website, and as you learn more add more. Don't try to jump into the advanced stuff until you are really happy with the results of your simple stuff. Besides you can always make your simple scripts more advanced and badass over time.

 

Hope that helps!

Link to comment
Share on other sites

hmmm as far as giving you specific projects, maybe try looking for online courses or something. I know of w3schools and tizag (two of my favorite php tutorial sites) but those are more or less how to use certain functions, and not really entire projects starting from small to large. However they do have very good examples, so you could use the examples they give as sort of starting points for projects, and go from there.

 

However if you want my advice for where to start on a project I would create a site with a simple login system. Perhaps add a news system. then slowly add more and more things for users to be able to do, like edit their profile, comment on stuff, etc. etc. and then when you understand the core basics, you can start tackling harder stuff like discussion forums, uploading pictures/avatars, creating administrative functions, etc.

Link to comment
Share on other sites

Also, keep in mind that failure is a part of being a programmer.  Even experienced programmers make mistakes.  That's why the debugging process is so important - things fall through the cracks.  The key is to not get discouraged (easier said than done, I know), and realize that failing is merely an indication that you need to learn more, or need to remember to address certain things while coding.  Even the pros don't always get it right the first time.

 

If you can afford a book on the subject, I recommend PHP For The World Wide Web.

Link to comment
Share on other sites

thank you all for the GREAT feedback! i just bought the book PHP BIBLE for $8 bucks on amazon, what a great deal! i will buy the other books when i have more money. also, im going to try to get online lessons from this guy named davidj. i saw his video tutorials and hes cool. here is a message i posted on another board about my situation.

 

 

"

my main problem isnt learning the syntax , i learn that from w3schools.com. my main problem is that past learning the syntax. i try to do a project, and they start out way over my head, even just making more than the basic guestbook, im lost, i cant add to it, or embellish it, i wouldnt know where to start.

 

the implementation of the language into projects are my problem. and every time i ask, someone says "do this project" or that project, and when i try it, it is too complicated. and i dont understand that specific implementation of the language. i also havent studied sql yet on w3schools. i followed david's video tutorial on installing WAMP, and EMS SQL manager , but i dont see a point of installing a database on my own computer when i dont want my computer to be the server, and my host startlogic.com doesnt let me use EMS SQL Manager to connect to the server, they make me use their MYSQL admin to make databases, is that a problem?"

Link to comment
Share on other sites

but i dont see a point of installing a database on my own computer when i dont want my computer to be the server,

 

You should be developing and testing on your local machine.  Your local environment should mirror your live one.

Link to comment
Share on other sites

but i dont see a point of installing a database on my own computer when i dont want my computer to be the server,

 

You should be developing and testing on your local machine.  Your local environment should mirror your live one.

 

At the starting stage, you can develop on local machine and can use xampp package.. Its url is:

 

http://www.apachefriends.org/en/xampp.html

 

It contains everything needed to run a php page such as server (apache), mysql, phpmyadmin etc.

 

Does the phpfreaks need to start a separate section in the forum for beginners ? With some video tutorials

Link to comment
Share on other sites

does that mean i would have to make 2 databases, one for my local one and one for the live one? that would be twice the work wouldnt it. or is that the proper way? i have been making my php scripts add tables to the database, by uploadiing them to my hosted server. its slower, but i just have to do it once. should i make 2 databases like you are saying? thanks. derek

Link to comment
Share on other sites

No, you would need some kind of structured quey language, markup such as (X)HTML or XML and some kind of styling language like CSS. Although you could make the same kind of site with these anguages they also use javascript/Jscript, AJAX for the chat system and I assume they have some PHP extensions written in C and maybe other languages too.

Link to comment
Share on other sites

does that mean i would have to make 2 databases, one for my local one and one for the live one? that would be twice the work wouldnt it. or is that the proper way? i have been making my php scripts add tables to the database, by uploadiing them to my hosted server. its slower, but i just have to do it once. should i make 2 databases like you are saying? thanks. derek

 

It's definitely worth the work, it's pretty much necessary.  What if you have users on your site and you break something?  You're just going to let your users suffer while you're trying to fix it?  No, you develop and test locally, once you're satisfied, push it live.

Link to comment
Share on other sites

hi, my dream in life is to be a great php programmer

 

Aim on being a great overall programmer, not a great PHP programmer. PHP is a tool, a means to the goal, but not the goal itself :)

 

Learning PHP specifically is not so important. That is just syntax and knowing some useful library functions. What is far more important is methodology, troubleshooting/debugging skills and problem solving skills. When you are coding you're solving a problem. You may have very complex problems or easy problems. What you need to learn is how to break the complex problems into smaller and easier problems that you already know how to solve.

Link to comment
Share on other sites

well you can do a captcha without needing to understand sql, but it wouldn't nearly be as secure.

 

when you're way in over your head think in little step by steps and first consider what a captcha does and then try replicate it if you can't understand the code because it is too complex

 

captcha randomly displays a picture that contains random letters and/or numbers

 

design like 10 pictures with microsoft paint each picture containing a different word

 

then with php script a function that gives a random number between 1 and 10, this number should correspond to one of the ten pictures. So say the script gives you a 1, then display picture 1, and if it is 2, display picture 2.

 

for example:

 

$picturenum = (rand(1,9));
switch ($picturenum){
case 1:
echo "<P class='left'><IMG SRC='pictures/random1.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
break;
case 2:
echo "<P class='left'><IMG SRC='pictures/random2.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
break;
case 3:
echo "<P class='left'><IMG SRC='pictures/random3.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
break;
case 4:
echo "<P class='left'><IMG SRC='pictures/random4.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
break;
case 5:
echo "<P class='left'><IMG SRC='pictures/random5.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
break;
case 6:
echo "<P class='left'><IMG SRC='pictures/random6.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
break;
case 7:
echo "<P class='left'><IMG SRC='pictures/random7.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
break;
case 8:
echo "<P class='left'><IMG SRC='pictures/random8.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
break;
default:
echo "<P class='left'><IMG SRC='pictures/random9.gif' BORDER=0 WIDTH=100 HEIGHT=50>";
}

 

 

 

In the login form or registration form or whatever form you are working with, have a hidden part of the form keep the random number and have this hidden feature (which is just plain html code of course) posted (yes POST, not GET for security reasons, don't want people to be aware of what is hidden, of course they can still see it when they open the source) along with whatever else is posted in the form. Then when you're validatind form data use an IF-ELSE construction to check if the answer they provided in the form matches with the correct hidden form variable. If it does match, then proceed to login, registration or whatever and if it doesn't then kick them or whatever else suits your needs

 

 

remember this is like catching burglars with a camera with no film in it, it might ward of people who thinks the camera works, but as soon as people are aware it has no film, then they'll won't stop.

 

Here is reaso why you need knowledge of sql to make captcha work. Remember that hidden variable can be seen in html code when open up the source view... well eventually someone will find out which number matches with what picture. spambots can then simply beat the captcha because they can read the hidden variable in html code and hence always have the right answer which of course defeats the purpose of your captcha. If you just store the random variable in a sql database instead of having to post it along with the other form variables, then the bots won't be able to get the right answer. The bots can read any html code, but not pictures (only human eyes can do that, though i hear spammers are busy developing bots that will be able to read text in say gif or jpeg pictures in the future, but luckily that's the future and not today)

Link to comment
Share on other sites

sqlnoob...

 

 

That is most definitely not the best way to make a CAPTCHA.  What's wrong with dynamically generating them using the GD library?  Also, why is a database necessary?  What's wrong with sessions?  Also, there are already programs that can read some CAPTCHAs.  While not perfect by far, they do greatly increase the chances of a positive read as opposed to random guessing.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.