Author Topic: Anyone here a PHP nut?  (Read 798 times)

Offline Denholm

  • Plutonium Member
  • *******
  • Posts: 9667
      • No. 603 Squadron
Anyone here a PHP nut?
« on: November 05, 2008, 01:02:12 PM »
Hey there,

I just recently got into the Webmaster spirit and decided to advance my skills. I recently installed Apache, PHP, and MySQL. This is so I can test web-pages on my system before uploading them to servers.

I would like to know if there are any of you out there that can provide hints, tips, or perhaps even tutorials in helping someone such as me get started. I have already setup an authentication script through the helpful assistance of some tutorials. However my problem comes when I am trying to setup the, "Remember Me" cookie. I just don't know enough PHP to experiment with it.

I recently stumbled across this tutorial to help me set up such a system. Yeah, it looks great. Too bad when I went in to configure it to work with my database the pages wouldn't load. I'll keep playing with it. But until then, any tips or tutorials to help an inexperienced user such as me would be appreciated.

Thanks!
Get your Daily Dose of Flame!
FlameThink.com
No. 603 Squadron... Visit us on the web, if you dare.

Drug addicts are always disappointed after eating Pot Pies.

Offline RTHolmes

  • Plutonium Member
  • *******
  • Posts: 8260
Re: Anyone here a PHP nut?
« Reply #1 on: November 05, 2008, 01:47:00 PM »
PHP rules :rock  try phpbuilder.com - great stuff on there from code chunks to wider scope articles about programme structure etc. the PHP docs themselves are really good too with useful examples.


edit: if you want something to read, Philip and Alex's Guide to Web Publishing is just about the most useful book out there for web applications - its quite old and not LAMP-specific but the principles all still apply, and its the best written coading book Ive ever read :)
« Last Edit: November 05, 2008, 01:53:53 PM by RTHolmes »
71 (Eagle) Squadron

What most of us want to do is simply shoot stuff and look good doing it - Chilli

Offline Denholm

  • Plutonium Member
  • *******
  • Posts: 9667
      • No. 603 Squadron
Re: Anyone here a PHP nut?
« Reply #2 on: November 05, 2008, 01:53:52 PM »
*Sigh*


I was asking here because I'm tired of no assistance from them. :mad:
Get your Daily Dose of Flame!
FlameThink.com
No. 603 Squadron... Visit us on the web, if you dare.

Drug addicts are always disappointed after eating Pot Pies.

Offline RTHolmes

  • Plutonium Member
  • *******
  • Posts: 8260
Re: Anyone here a PHP nut?
« Reply #3 on: November 05, 2008, 02:06:33 PM »
Quote
Introduction

I just started programming with PHP and MySQL this week and the first script I wanted to write was a login script.

I think that explains why you should avoid this bit of coad. 99% of the problems people have with PHP are actually due to lack of knowlege about programming or server configuration, not PHP.

First off make sure your AMP setup is working properly by testing it with some simple examples. Next start at <phpbuilder> and use their stuff because its all tested and seems to be written to basic standards, or (better) build it from scratch yourself using the PHP docs - you'll learn 10x as much 10x as fast, although it will take longer to produce working apps.
71 (Eagle) Squadron

What most of us want to do is simply shoot stuff and look good doing it - Chilli

Offline Fishu

  • Gold Member
  • *****
  • Posts: 3789
Re: Anyone here a PHP nut?
« Reply #4 on: November 05, 2008, 04:24:33 PM »
I started with the same setup, except I changed to PostgreSQL shortly afterwards.

Login stuff is not the simpliest thing to begin with. There are several ways to accidentally create a backdoor if you don't know what you're doing. The worst case is that your database becomes accessible to malicious users. The most common problem is that there's a backdoor past the login.

In the beginning it'll be more secure to handle logins with .htaccess

Offline Denholm

  • Plutonium Member
  • *******
  • Posts: 9667
      • No. 603 Squadron
Re: Anyone here a PHP nut?
« Reply #5 on: November 06, 2008, 09:01:42 AM »
Well, I'll try your suggestions for as long as I can. Yet seeing as this is a job, I'm trying hard to get this one done.

EDIT: What is the AMP setup?

...First off make sure your AMP setup is working properly by testing it with some simple examples...
« Last Edit: November 06, 2008, 09:09:50 AM by Denholm »
Get your Daily Dose of Flame!
FlameThink.com
No. 603 Squadron... Visit us on the web, if you dare.

Drug addicts are always disappointed after eating Pot Pies.

Offline RTHolmes

  • Plutonium Member
  • *******
  • Posts: 8260
Re: Anyone here a PHP nut?
« Reply #6 on: November 06, 2008, 09:24:35 AM »
What is the AMP setup?

= Apache + MySQL + PHP :)

by basic testing I mean do a <?php echo phpinfo(); ?> to test PHP is working properly, then make sure you can read and write to the database using a PHP page.
71 (Eagle) Squadron

What most of us want to do is simply shoot stuff and look good doing it - Chilli

Offline Denholm

  • Plutonium Member
  • *******
  • Posts: 9667
      • No. 603 Squadron
Re: Anyone here a PHP nut?
« Reply #7 on: November 06, 2008, 10:05:39 AM »
I already know it's in working condition because I have already done what you said, test to see if I can read/write things to the database via simple scripts. It's working properly.
Get your Daily Dose of Flame!
FlameThink.com
No. 603 Squadron... Visit us on the web, if you dare.

Drug addicts are always disappointed after eating Pot Pies.

Offline RTHolmes

  • Plutonium Member
  • *******
  • Posts: 8260
Re: Anyone here a PHP nut?
« Reply #8 on: November 06, 2008, 12:21:29 PM »
ok I'll bite, what problems are you having with it (ie. what error messages)?
71 (Eagle) Squadron

What most of us want to do is simply shoot stuff and look good doing it - Chilli

Offline MotleyCH

  • Nickel Member
  • ***
  • Posts: 633
Re: Anyone here a PHP nut?
« Reply #9 on: November 06, 2008, 01:33:29 PM »
Make sure the $path is correct and $hostname is your url without http or www  ($hostname = 'yourdomain.com';

Offline Denholm

  • Plutonium Member
  • *******
  • Posts: 9667
      • No. 603 Squadron
Re: Anyone here a PHP nut?
« Reply #10 on: November 06, 2008, 03:09:15 PM »
ok I'll bite, what problems are you having with it (ie. what error messages)?
I am having a problem, but I'm not here to discuss that. I was asking for suggestions in getting started, which you already gave me. I was also asking if anyone knew of any free tutorials out there that help a newcomer such as me go from a limited knowledge of PHP to a more broad understanding of the language.
Get your Daily Dose of Flame!
FlameThink.com
No. 603 Squadron... Visit us on the web, if you dare.

Drug addicts are always disappointed after eating Pot Pies.

Offline Gaidin

  • Silver Member
  • ****
  • Posts: 1191
Re: Anyone here a PHP nut?
« Reply #11 on: November 06, 2008, 03:52:45 PM »
A few places I have gotten PHP help over the years.

http://www.tizag.com/phpT/
http://us2.php.net/manual/en/tutorial.php
http://www.w3schools.com/PHP/DEfaULT.asP

There are many others out there. 

http://phpnuke.org/

Great for using PHPNuke.
Death is but a doorway to life, only those who fear life fear its opening.

Ingame: 68Gaidin

Proud Member of the CM Team
FSO - Admin

Offline Denholm

  • Plutonium Member
  • *******
  • Posts: 9667
      • No. 603 Squadron
Re: Anyone here a PHP nut?
« Reply #12 on: November 06, 2008, 04:32:49 PM »
Thanks guys, I'll dig through all of this in hopes of getting a better understanding of the language. :)
Get your Daily Dose of Flame!
FlameThink.com
No. 603 Squadron... Visit us on the web, if you dare.

Drug addicts are always disappointed after eating Pot Pies.

Offline FireDragon

  • Zinc Member
  • *
  • Posts: 99
Re: Anyone here a PHP nut?
« Reply #13 on: November 07, 2008, 11:46:38 AM »
Did you try "youtube".....might find what your looking for

Offline Denholm

  • Plutonium Member
  • *******
  • Posts: 9667
      • No. 603 Squadron
Re: Anyone here a PHP nut?
« Reply #14 on: November 07, 2008, 12:53:44 PM »
Well... I have found what I'm looking for. The trouble comes when I'm customizing it, obviously because I don't know what I'm looking for and the only knowledge I have to guide me is my ability to interpret HTML code. So I'm merely guessing the values that must be updated to include extra forms for registration and such.

Anyways, thanks for the responses. I'll get into that, eventually. Still swamped with scholarship applications, college admissions, and trying to earn money at the same time. :rolleyes:
Get your Daily Dose of Flame!
FlameThink.com
No. 603 Squadron... Visit us on the web, if you dare.

Drug addicts are always disappointed after eating Pot Pies.