Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extremely new to PHP .... couple questions...

Status
Not open for further replies.

Motorhead85021

Programmer
Jun 3, 2004
1
US
Greetings all from the newbie.
I'm an experienced ASP/ADO/Access programmer, but I'm smelling the winds of change, so I programmed my 1st PHP 'Hello World' today, and I'm proud to say it worked. :)

I have a couple quick questions?

1. What is the appeal of PHP? Why do I see sites moving away from ASP nowadays? Is it simply because of PHP's mySQL support? Am I missing something?

2. Does PHP have 3rd party 'components' like ASP? Will I be able to find/use a PHP 'Email' component? Is that even possible?

3. Can anyone suggest a good starting book (something that will jump right in, I don't need 4 chapters explaining what concantenation means).

4. Do all data types use '$'? I haven't seen anything about casting datatypes.

Thanks for any replies !!
Peace !


 
1. I guess first of all because it's free... second of all (personally) I love the way you can use variable names for variables
2. yes... it can contain modules that are used for specific coding (like graphics - GD2 .. and so on). but I think it's better to call your components 'classes', and yes, there are lots of 'em out there
3. best book for me was the help manual in chm format :p
4. $ denotes that a variable name is following it ($my_var). anything else is numbers or functions.
 
<- have some exteremly good (advanced and newbie alike) PHP tutorials.




______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
[ol][li]There are a number of reasons for the appeal of PHP. First is the fact that it's platform-agnostic. Where VBScript/ASP will run only on Win32, PHP runs on Win32, Linux, Solaris, BSD and a number of other OSes. This gives a much wider possible install base, including OSes for which you do not have to pay.

Second is the fact that PHP will run with multiple web servers, including IIS and Apache. VBScript/ASP is available only on Win32. Actually, that is not correct -- Sun makes a VBScript/ASP product that will run on other platforms, but the software is not cost-free.

Third is the quality of the documentation. The PHP manual site ( is well-organized and contains lots of example code. This makes it easy to learn the language without having to spend a bunch of money on books.

Fourth is the fact that PHP can use native communications libraries to interact with a number of database systems, including MySQL, PostgreSQL, Oracle and SQL Server. ODBC, although convenient, is not the best-performance solution available.

Fifth is that PHP has available a large number of additional functionality cost-free, such as on-the-fly image and PDF creation.


[/li][li]Yes, PHP has a number of language functions for a number of additional features. See for more details.

And yes, sending mail is a built-in component. If you don't like the basic functionality provided by PHP's mail() function, you can use open-source PHP classes, such as PHPMailer.

[/li][li]Again, a good cost-free starting place is the PHP online manual:
[/li][li]Yes, all variables are designated in the language by a "$" at the beginning of the name of the variable. This does not designate the type of the variable, by only delineates one.

PHP supports singleton variables that are integers, floats, strings. PHP supports arrays, both with numerical and string keys. PHP supports classes and objects.

The language has builtin functionality for automatically casting types as needed (it is, to speak technically, a loosely-typed language), but also has functionality for explicit typing. See for information on PHP's variable types and for information on type casting.[/li][/ol]



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
CORRECTION:

The first two sentences of the second paragraph of section 1 reads:

Second is the fact that PHP will run with multiple web servers, including IIS and Apache. VBScript/ASP is available only on Win32.

It should read:
Second is the fact that PHP will run with multiple web servers, including IIS and Apache. VBScript/ASP is available only on [blue]IIS[/blue].


Sorry about that.






Want the best answers? Ask the best questions!

TANSTAAFL!!
 
ASP can actually be used on Linux and Solaris...

See
...although you would have to be a bit of a goof to go through so much trouble to enable a commercial scripting language when you can simply use free PHP.

Sleipnir214's point is still valid that PHP is most accessible between platforms.


- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
 
Let me extend a few reasons PHP appeals to me (and second many of the ones listed by the way)...

It's syntax is C/C++ based, so it's a quick pickup for alot of people.

It's not just a webserver language, it's also proven invaluable for me as a command line scripting tool (Perl just isn't my thing)... I can interact with my linux and windows boxes with the same script as filesystem calls are completely agnostic, and play nicely together.

I know sleipnir said it already, but that manual is invaluable, and the best I've ever seen.

It is fairly easy to find affordable PHP/MySQL hosts.

It's open source, a big deal to many people (and I'm not talking about the free here), especially those of us who develop applications which use a scripting language.

It's actively and openly developed, ASP does nothing for months/years and then releases a new flourish of features...

/warning my opinion only
Apache is a better webserver than IIS, if your site ever goes high traffic, I'd rather be running a LAMP box than a Windows/Asp/IIS/SQL Server box.





 
Guys

I read this article and some of the associated links with keen interest. I'll certanly be dropping by again when I have a little more knowledge.

One question though if I may:

What's the difference between MySQL and SQL...?

Is MySQL to SQL as VBA is to VB...?

I'm a complete novice so go easy [colorface]

I also bookmarked like mad...!


-----------------------
Michael Mason
Arras People
-----------------------
 
What's the difference between MySQL and SQL...?
MySQL is a specific implementation of a SQL server while SQL stands for Structured Query Language.
Although SQL is a standard defined in ANSI and ISO many implementations use proprietary extensions thus you get MySQL, MSSQL, PostgreSQL etc.
MySQL is popular beacause it is available on a multitude of platforms and under different licenses including GNU.
 
The difference between MySQL and SQL is that the former is a Relational DataBase Manager, while the latter is the Structured Query Language that you use to manipulate data on most RDBMs.

Unless, of course, you were attempting to compare MySQL to MSSQL, which is Microsoft's RDBM.


And until you clarify what you mean by "SQL", your analogy doesn't make much sense to ne.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
1. Its simply a better language, more functions (array handling, image processing, database integration to name a few). Easy to learn and free, runs almost anywhere with the same code...true portability (exlcuding certain functions like COM (yes, it can access COM object on win32 platforms)

2. Mail is a built in function. Mail($to, $from, $body [,optional $headers like reply-to]);

3. PHP Programming from Worx is okay. I still use and read the manual everyday

4. $ denotes a variable....

Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
I might add one more thing about ASP.

ASP should really only be used on the Win32 platform with IIS. The Sun version of ASP won't allow for 3rd party components like SAFileUP, UPS tracking, PDF creation, Payment Tech, etc...
 
Thanks very much for the posts guys. I feel a lot more confident in stepping out and learning MySQL now as it appears from what little knowledge I have gained over the past few days that it will indeed do what I want.

In essence I will be looking to create a 3 phased approach to my en goal:

1. Write to, read from and edit a table held on a server that's PHP and MySQL compiant as the medium will be PHP.
2. create a relational table within the database that I can do the same with.
3. Create many to many relationships between multiple tables and have users edit the data themselves following an authentication process.

I assume (will have to bone up) that is PHP can read environment variables it can do such things as only allow users from certain predetrmined IP addresses. I am also assuming that PHP and/or MySQL can provide me with a user registration and logon facility.

WOW - I think I have a lot of learning to do.

Oh, and as for ASP. I have lost count of the number of times an ASP driven webpage klinked to an Access DBase has gone belly up...!

Once again ~ Thanks for the posts. By all means keep 'em coming, I need all the knowledge I can gain - FAST...!

-----------------------
Michael Mason
Arras People
-----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top