Tag: Site Php

learn php
Beau Stafford asked:


Any web designer or developer will tell you that they have to know a slew of coding languages just to make ends meet. Different clients require different web sites which, in turn, require different sets of codes and standards.

A basic page will be run with HTML (hyper text markup language) and CSS (Cascading style sheets) only. A more advanced page will incorporate JavaScript, a client-side programming language allowing dynamic content. From there programs like flash are used to make websites.

Serving as the backbone to many sites are server-side based programming languages. These languages run directly off the web site’s host server and aren’t affected by a browser. The use of these languages allows for even more dynamic content on the page.

One such type of language is called PHP (hypertext preprocessor). Written on a web server, the PHP language is then incorporated into the HTML of a website and displayed as .php site. PHP code is entered as the language and various web pages are the output.

PHP is similar to other server-side scripting languages such as ASP.NET, mod_perl, and JavaServer pages,

When a webpage is loaded that has a backbone in PHP the PHP code will be compiled and then ran. This means there’s an extra step in loading the website as opposed to simply loading the HTML (the website loads the HTML, which loads the PHP, which then displays the site as opposed to HTML only). There are such things as accelerators which can improve performance but most programmers are efficient enough to code less lines which improves speed. The load time compilation won’t be noticeable by most people.

PHP isn’t the most secure of server-side programming languages. It’s security vulnerability has increased year to year, ending at 34% in 2008. Luckily there are various patches and methods of increasing security. For instance you could install PHP as a CGI binary and it will add security.

The coding is similar to the coding of languages such as C, C++, Java and Perl. It includes IF conditions, Function returns, as well as FOR and WHILE loops.

Originally released in 1995, PHP has been running strong ever since. It is constantly being updated and the current version, 5.2.8 was released in December of 2008. Early in 2009 the next version, 5.3.0 will be released and version 6.0.0 is slated to come out sometime after that, but doesn’t have a particular date set.

PHP is as easy to use as server-side programming languages can be. If you have a knowledge in C, C++, Java, or Perl then the transition will probably be seamless, otherwise it’ll take a bit of learning. But most languages have a learning curve that isn’t set very high, in programming especially. When the basics are covered: the variables and general syntax, then the rest of the language from loops, to functions, to IF conditions come more naturally.

PHP is a great resource for web design and development and shouldn’t be ignored over similar server-side programming languages.



Tags: , ,

A Beginner’s Guide To Php
By Ehsen Siraj

PHP is officially known as PHP: HyperText Preprocessor. It is a server-side scripting language just like Active Server Pages (Asp), Java Server Pages (Jsp) and Cold Fusion (CF). It is usually written in an HTML context. Unlike an ordinary HTMLpage, Server doesn’t send php script directly to a client; instead, it is parsed by the PHP binary or module. HTML in the script is ignored, but PHPcode is interpreted and executed. PHP code in a script can query databases, create images, read and write files, talk to remote servers- the possibilities are endless. Finally the php code result and HTML is combined and output is send to the client.

PHP Installation on your computer   In order to run php on your computer you must have following components installed on it.

1. Web Server (IIS or Apache)

2. PHP

3. Mysql (optional)

Most websites advise you to install all components manually but its just wastage of time. Visit [http://www.wampserver.com/ ]http://www.wampserver.com and install latest version of WAMP it will automatically install php, apache and mysql on your computer with a single click. Its an open source software and very easy to use.

How to run php scripts

During installation WAMP creates a “www” directory in the installation folder. Save all your php scripts in it and then call it from your browser like this

http://localhost/yourscriptname.php” where “yourscriptname” is the name of your php file.

First Script

Open your favorite text editor. Like HTML documents, PHP files are made up of plain text. You can create them with anytext editor, such as Notepad. However I advise you to use a specialized php editor. Macromedia Dreamweaver is the best php editor but its not free. You can find lots of good php editors at [http://www.sourceforge.net/ ]http://www.sourceforge.net

or simply Google it with keywords “free php editors”

Here is your first php script

 

1:

 

Save this script in www directory. Then call it from your browser like this

localhost/first.php

You will get following result;

Hello World

Remember : Always write your php code between opening and closing tags. Consider the following example.

 

Adding Comments to PHP Code

A comment is text in a script that is ignored by the interpreter. Comments make your life lot more easier because Code that seems clear at the time of writing, can be extremely frustrating when you come to amend it six or tweleve months later. Adding comments saves time besides it makes it easier for other programmers to work with your code.

You can make comments in many ways

Single line comments begin with two forward slashes (/ /) or a single hash sign (#).

All text from either of these marks until either the end of the line or the PHP close tag is ignored.

// this is a comment  # this is another comment

Multi line comments begin with a forward slash followed by an asterisk (/*) and end with an asterisk followed by a forward slash (*/).

/*

Add your text here.

Interpreter will not parse it

/*

Tags: , , , ,
php
rob_asks asked:


I’ve already made a web site using PHP, but now I would like to make it accessible via https. Once I buy and configure the certificate, does the code itself need any changes? Or is all the encrypting and decrypting done by the web server and web browser automatically?

Tags: , ,
php
Vince asked:


I want to display a “Last Published” date on my site’s articles using PHP. My site files are PHP pages.

Originally I had a piece of code in each article page, however I’ve now learned that is very bad design.

What code would I insert in my article pages to connect to a single, separate php script file, so that my “last modified” date will show up in my articles?

Tags: , ,
php and mysql
whoevermakes asked:


Hi.

I’m going to build a high scale site in php/mysql that needs to scale horizontally.

What things should the developer do and not do when writing the code and creating the database?

Thanks.

Tags: , ,
php and mysql
Napoleon X asked:


I am planing to build a website similar to that please let me know your ideas where I can get the source code of that site. In PHP and Mysql because it is created in ASP. Thank you so much, you help is well appreciated, Thank you!
I already know how to use php why are you pasting beginners site. I just want to have it quick setup.

Tags: , ,
Learn PHP
SK . asked:


I’m starting a small Web/Graphic Design busines and I would love to learn more Web-Based Programming Codes.

I already know:
- HTML
- CSS

I would love to learn:
- PHP
- Javascript

& how to work in Flash.
Any help?

Thanks,
Sir. Kelvin <3456

Tags: , ,
Back to top