10 Replies - 1816 Views - Last Post: 12 July 2012 - 04:10 PM Rate Topic: -----

#1 hopelesslybaffled  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-July 12

question about getting started with php

Posted 10 July 2012 - 11:24 AM

Hi all. I've recently decided to try and expand my knowledge around general web design. In the past I've used Serif WebPlus to develop very basic websites which are visually quite nice, but have little in the way of functionality barring forums and similar things that Serif have built into the software.
I'm trying now to start work on a dynamic website (I have 0 prior knowledge). I have spent around 12 hours watching SQL tutorials on youtube and practising with MySQL workbench, so I have a basic understanding of how it works and how to perform basic tasks with it. My problem is this:

While reading up on step by step guides on how to create tools such as a register/login function, all the guides seem to assume I know where PHP code would even go! I know this is probably stupidly basic and beneath most of you, but I just can't find a "total beginner's" instruction/tutorial at all.

If anyone could even point me in the direction of very basic instructional reading material it would be appreciated.

I've included information on what I'm currently using, so if anyone can recommend something more "noob friendly" it would be appreciated:

Web Host: One.com (supports PHP5, has PHPMyadmin in their control panel etc.)
Software: WebPlus X6, MySQL Workbench 5.2 CE, MySQL Server 5.1

ANY and all help, advice or pointers would be hugely appreciated and probably save me a mild brain aneurysm in the near future.

Is This A Good Question/Topic? 0
  • +

Replies To: question about getting started with php

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10803
  • View blog
  • Posts: 40,273
  • Joined: 27-December 08

Re: question about getting started with php

Posted 10 July 2012 - 11:26 AM

Check out my thread Getting Better at Programming PHP. We don't have any Stage 1 tutorials, but those should give you a good idea of how to learn the language. Then proceed onto Stage 2.
Was This Post Helpful? 3
  • +
  • -

#3 CarDriver  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 65
  • View blog
  • Posts: 431
  • Joined: 17-February 11

Re: question about getting started with php

Posted 10 July 2012 - 02:33 PM

PHP files are fed through an interpreter that reads your PHP code (that is often embedded in HTML inside <?php //code ?> tags) and then spits out regular HTML. Here's an example of embedding PHP in HTML:

<?php
include 'phpfile.php';
$name = 'Bob';
// or:
$name = get_name_from_database(); // maybe a function you have in another file

?>
<html>
	<body>
		<p>Welcome to my website, <?php echo($name); ?>!</p>	
	</body>
</html>


When you look at the page in a web browser, it would read "Welcome to my website, Bob!"
Was This Post Helpful? 1
  • +
  • -

#4 blazexhacker  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 10-July 12

Re: question about getting started with php

Posted 10 July 2012 - 09:01 PM

When I was 8, I decided to try the same thing. At first, it was very confusing... until I found a website called w3schools.com. Here's a link to their PHP page. It includes information about all of the major PHP tags, and will help you get into it. W#Schools | PHP Tutorial
Was This Post Helpful? 1
  • +
  • -

#5 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10803
  • View blog
  • Posts: 40,273
  • Joined: 27-December 08

Re: question about getting started with php

Posted 10 July 2012 - 09:16 PM

Be careful with W3Schools. It will get you going with the basics. However, it propagates certain poor practices like the almost deprecated mysql_*() family of functions.
Was This Post Helpful? 3
  • +
  • -

#6 blazexhacker  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 9
  • Joined: 10-July 12

Re: question about getting started with php

Posted 10 July 2012 - 09:24 PM

Also, one thing I forgot to mention is to always use
stripslashes
and mysql_real_escape[/code] for any user-inputted variables and $_GET variables.If you don't, users can easilly manipulate your site, and exploit information(like everyone's usernames and passwords)

BlAzExHacker
Was This Post Helpful? 0
  • +
  • -

#7 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10803
  • View blog
  • Posts: 40,273
  • Joined: 27-December 08

Re: question about getting started with php

Posted 10 July 2012 - 09:32 PM

Just use PDO or MySQLi for prepared statements, and you won't have to worry about using striplashes and escaping your inputs to guard against SQL Injection attacks. Prepared Statements are immune to SQL Injection attacks.
Was This Post Helpful? 4
  • +
  • -

#8 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: question about getting started with php

Posted 10 July 2012 - 10:02 PM

Also, it very dangerous to always use stripslashes on user input. It was actually never used to increase security. It was used to undo the ancient security feature know as magic_quotes_gpc, which has long been deprecated, and recently been removed from PHP altogether.

If you use the stripslashes function on user input on a server with magic_quotes_gpc off, you risk damaging the user input. So before using the function, be sure to check if it's needed.
Was This Post Helpful? 2
  • +
  • -

#9 hopelesslybaffled  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-July 12

Re: question about getting started with php

Posted 11 July 2012 - 12:41 AM

Thanks for all the replies guys, will definitely check out the links etc. Mac's tutorials list will definitely be useful once I've got an understanding of stage 1. I'll check out the w3, but I'll bear in mind the bad practices etc. All the pointers are really appreciated :bigsmile:
Was This Post Helpful? 0
  • +
  • -

#10 EnvXOwner  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 357
  • View blog
  • Posts: 2,319
  • Joined: 10-August 09

Re: question about getting started with php

Posted 11 July 2012 - 06:13 PM

Also, when you get more advanced. Check out Object Oriented Programming and maybe messing around with Model-View-Controllers. I find that OOP PHP makes coding much easier, even though it's a concept that's hard to grasp at first. And like macosxnerd101 said, I'd be careful if you decide to use W3Schools. I used them to get started with HTML, CSS, and PHP and I ended up getting confused and misguided along the way at occasions. DIC does have some useful tutorials on here for PHP, but I'm not certain whether we have a tutorial series where they teach you the basics and stuff with a type of agenda. We mostly have tutorials for specific topics. If you like video tutorials there is PHPAcademy which has hundreds of tutorials that can get you started. And actually, lately I've been considering making basic PHP video tutorials. So you might be able to see some from me one day :) Good luck!
Was This Post Helpful? 1
  • +
  • -

#11 esludds  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 14
  • Joined: 02-July 12

Re: question about getting started with php

Posted 12 July 2012 - 04:10 PM

Im also new to php and i found the book php: A beginner's guide a very useful tool. I used it along with tutorials which can be found at http://www.homeandle...uk/php/php.html
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1