visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: PHP :: how quick i can learn php


By: digitaltree U.S.A.  Date: 06/10/2003 00:00:00  English  Points: 50 Status: Answered
Quality : Excellent
i have very good experience of jsp and oracle, i want to learn php. HOw quickly i can learn it?
From where to start? What are the differences between JSP and PHP tech. I have Tomcat Apache running on Winnt.
What version of PHP should i install and how to procede? Tutorials, on line ? Why people prefere php?
First i would like to setup PHP environment on my machine and then proceed with examples that you will suggest.
thanks
By: VGR Date: 06/10/2003 21:30:00 English  Type : Comment
HOw quickly i can learn it? >> very fast given you already know JSP. If you've notions of BASIC or C, it's no worse

From where to start? >> proglets from EE, small problems "to prctice", scriptlets found in the online Manual (user comments) etc

What are the differences between JSP and PHP >> PHP is a lot faster :D

I have Tomcat Apache running on Winnt. >> no problem

What version of PHP should i install and how to procede? >> it's strtaightforard, on Windows binaries are ready-made on <A HREF="http://www.php.net">www.php.net</a> - download 4.3.3 as 5.0 is not production-ready

Tutorials, on line ? >> Online manual at <A HREF="http://www.php.net/Manual/en/">www.php.net/Manual/en/</a>

Why people prefere php? >> easy, elegant, efficient, expandable, widely supported and used worldwide, native DB access...

First i would like to setup PHP environment on my machine and then proceed with examples that you will suggest.
thanks
>> have fun
By: digitaltree Date: 06/10/2003 21:50:00 English  Type : Comment
thanks VGR
I need php server, i agreed
>>PHP is a lot faster
i want to know other differences like in artchitecture, communication between server and client etc
Does java has some link with php? like java in JSp? if no then to which language it has origin
what kind of db ( preferable for php )is required and howto connect it and what kind of working environment ( software) to program php? DO i need Javascript in php as well?

By: LornaJane Date: 06/10/2003 23:15:00 English  Type : Answer
PHP doesn't really have an origin, unless you count C I suppose - it's a scripting language. Databases are up to you, but lots of people use mysql so there's a lot of support and tutorials out there; and there are commands in php for connecting to databases so I'm sure you will have no problems

To program PHP you need a text editor and a web browser! There are some good IDEs out there if you can pay for it - Zend Studio comes highly recommended and I believe it has a demo version as well.

You don't need Javascript but it is a good partner with PHP because PHP is entirely server-side, so a little client-side enhancement can be useful and JavaScript is an ideal candidate - but by no means essential to good php programming.

As for how fast you can learn - the answer is just as fast as you can set yourself projects to develop your skills with, I came to PHP as a total beginner programmer and coped fine - sounds like you have a lot of skills already so the transition will be straightforward for you I imagine.

Enjoy :)

By: Karaa Date: 07/10/2003 00:03:00 English  Type : Comment
thanks lorna
i am surprised by this >>> PHP is a lot faster;
Do the other experts believe like this who know JSP and PHP both


By: VGR Date: 07/10/2003 00:12:00 English  Type : Assist
yes

Here are the figures about relative speed in pages served per second :

JSP = 1 (is the slowest and serves as a reference index to others)
ColdFusion 2.2308
ASP = 3.3077
PHP=3.6154
ASP.Net (p-compiled) =11.5669
PHP p-compiled = 12.6538
By: digitaltree Date: 07/10/2003 01:03:00 English  Type : Comment
true but jsp precompiled is not as you have mentioned reference index.
can you mention some site where such results can be viewed.
By: digitaltree Date: 07/10/2003 01:11:00 English  Type : Comment
i want to work in oracle instead of mysql ,because i have already a database working in oracle
can i use dreamweaver for php development
What is concept here in php of session,page , application as we have in jsp
where can i found examples of php (some sites please)

By: LornaJane Date: 07/10/2003 19:26:00 English  Type : Comment
I think DreamWeaver thinks it can do PHP, but I would seriously seriously not recommend it!!

PHP can work with oracle I'm sure, although I have no personal experience of this, it'll interface easily I would imagine.

I can't help you with the comparisons with JSP because I don't write it myself, but for php examples use the php website <A HREF="http://www.php.net">www.php.net</a>, and for each function there are "user contributed notes" at the bottom of the page - these always contain examples. For more advice, just type some likely words "php" "tutorial" into google and see what you get. One of my favorite tutorial sites is devshed, you can trust the info you get from there.


By: digitaltree Date: 07/10/2003 20:07:00 English  Type : Comment
I have installed php-4.3.1-Win32, now how can i test some welcome page
By: LornaJane Date: 07/10/2003 20:14:00 English  Type : Comment
<?php

echo("hello world");

?>

save this file in your web root, good luck :)
By: digitaltree Date: 07/10/2003 20:27:00 English  Type : Comment
listen! i am little confused how to create directory structure
in JSP, using Apache tomcat i test like this
<A HREF="http://localhost:8080/my_webapp/login.jsp">http://localhost:8080/my_webapp/login.jsp</a>
DO i need apche server or i close it
By: digitaltree Date: 07/10/2003 20:54:00 English  Type : Comment
mY Apache server is running
Apache HTTP Server Version 1.3 which is a part of Oracle HTTP Server
Easy php is also running
when i right click on php icon i go to apache server
like
<A HREF="http://localhost/">http://localhost/</a>
i have created a folder my_website/hello.php
but it does not run
<A HREF="http://localhost/my_website/hello.php">http://localhost/my_website/hello.php</a>
hello.php is
<html>
<head>
<title>Ma première page en PHP</title>
</head>
<body>

Date courante : <? print (Date("l F d, Y")); ?>

</body>
</html>
by doing this i have
<A HREF="http://localhost/my_website/hello.php">http://localhost/my_website/hello.php</a>
this as output
Date courante :

i think hello.php has not been compiled by the php server
what should i do to run my first page
By: LornaJane Date: 08/10/2003 18:00:00 English  Type : Comment
hmm, if it wasn't processing your page it would print out the tags, can you see the <? ... ?> in your source code?

does it make a difference if you use <?php rather than <? ?

you might need to add a line to your apache config file (if you can see the <? tags in the source still) httpd.conf, here's the line:

AddType application/x-httpd-php .php

Look and see if you have a line like this, if not add it. You might have to add another line as well, let us know how you are getting on and in the meantime I'll look up the other line for you
By: digitaltree Date: 08/10/2003 18:22:00 English  Type : Comment
No change!
I have added
AddType application/x-httpd-php .php
but same result as before
By: digitaltree Date: 08/10/2003 18:36:00 English  Type : Comment
even i have tried
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
but no change
By: LornaJane Date: 08/10/2003 18:56:00 English  Type : Comment
OK, well try just echoing something not a function.

change this line to:
Date courante : <?php echo("1st Jan 1970"); ?>

And tell me what you see
By: digitaltree Date: 08/10/2003 20:16:00 English  Type : Comment
thanks
php is working
i can see hello.php
now i am trying to use db i don't find relative documentation for Oracle connection
whether i have to use only mySQL??????????????
is there a possibility for Oracle??????????
By: digitaltree Date: 08/10/2003 20:25:00 English  Type : Comment
I have this message

Forbidden
You don't have permission to access /mysql/ on this server.
------------------------------------------------------------------------------
Apache/1.3.24 Server at localhost Port 80
By: LornaJane Date: 08/10/2003 21:04:00 English  Type : Comment
you can use oracle, no problem. I haven't done it myself so I'm going to give you the link to the php manual pages on it. Make sure to read the "user contributed notes" at the bottom of the pages - they will be good examples of what you need.

<A HREF="http://uk2.php.net/manual/en/ref.oracle.php">http://uk2.php.net/manual/en/ref.oracle.php</a>

Good luck!
By: digitaltree Date: 15/10/2003 19:09:00 English  Type : Comment
I am sorry, i was busy for some time, now i am back on php.
my problem is understanding variables in php, i want to know how can i use some variables as local or page variables, some as session and other as application variables
How to retrieve and store values in session variables? Do session variables exist in php?
By: LornaJane Date: 15/10/2003 19:49:00 English  Type : Comment
Yes, session variables exist. You use them the same as ordinary ones except that they are elements of the superglobal array $_SESSION, rather than variables in their own right

A "normal" variable is like $a = 5;
A session one would be $_SESSION['a'] = 5;
then you can refer to $_SESSION['a'] in any page and it will be set to 5.

If you give a specific example I can post you some code if that helps...
By: digitaltree Date: 15/10/2003 20:24:00 English  Type : Comment
is there application variables as well like global variables which remains even if session has expired.
Thanks
By: LornaJane Date: 15/10/2003 20:34:00 English  Type : Comment
No I don't think so, but have a good look around the online manual at <A HREF="http://www.php.net">www.php.net</a> to make sure as I'm not 100% certain and I'd hate to mislead anyone
By: digitaltree Date: 15/10/2003 21:06:00 English  Type : Comment
please have a look here
<html>
<head>
<title>My first page in PHP</title>
</head>
<body>

Date courante : <?php print (Date("l F d, Y")); ?>
//////// code to connect Oracle db

//////
<?php
putenv('ORACLE_SID=Greyston');
putenv('ORACLE_HOME=c:\oracle\ora81');
putenv('TNS_ADMIN=c:\oracle\ora81\network\admin');
$foo=exec("echo %ORACLE_SID%");
echo $foo;
$connection = OCILogon("scott","tiger","Greyston")
or die("Couldn't logon to database.");

// create SQL statement
$sql = "SELECT ENAME, SAL
FROM EMP
ORDER BY SAL";
echo "
";
echo $connection;
echo "
";
echo $sql;
echo "
";

// parse SQL statement
$sql_statement = OCIParse($connection,$sql)
or die("Couldn't parse statement.");
echo $sql_statement;
// execute SQL query
OCIExecute($sql_statement)
or die("Couldn't execute statement.");

// get number of columns for use later
$num_columns = OCINumCols($sql_statement);
echo "
";
echo $num_columns;
// start results formatting
echo "<TABLE BORDER=1>";
echo "<TR>
<TH>Name</TH>
<TH>Salary</TH>
</TR>
";

// format results by row
while (OCIFetch($sql_statement)) {
echo "<TR>";
for ($i = 1; $i < $num_columns; $i++) {

$column_value1 = OCIResult($sql_statement,$i);
$column_value2 = OCIResult($sql_statement,$i+1);
//echo $i;
echo "<TD>$column_value1</TD>";
echo "<TD>$column_value2</TD>";
}
echo "</TR>";
}

echo "</TABLE>";

// free resources and close connection
OCIFreeStatement($sql_statement);
OCILogoff($connection);
?>
</body>
</html>

/////
i received output of only date portion of program there is no connection of database why?


By: digitaltree Date: 15/10/2003 21:11:00 English  Type : Comment
DO i need to install some driver (i have already php_oci8.dll in extension folder of myPhp)
in the following path
D:\php\php-4.3.1-Win32\extensions\php_oci8.dll
By: digitaltree Date: 15/10/2003 21:24:00 English  Type : Comment
i have this error

Date courante : Thursday October 16, 2003Greyston
Fatal error: Call to undefined function: ocilogon() in c:\program files\easyphp\www\my_website\hello.php on line 14



By: LornaJane Date: 16/10/2003 18:32:00 English  Type : Comment
it doesn't know about your oci... function calls, read this page
<A HREF="http://uk.php.net/manual/en/ref.oracle.php">http://uk.php.net/manual/en/ref.oracle.php</a>
and make sure you have everything set up correctly for php to know its supposed to be able to talk to oracle. Also read this one about the standard oracle interface
<A HREF="http://uk.php.net/manual/en/ref.oracle.php">http://uk.php.net/manual/en/ref.oracle.php</a>
and check you have compiled with all the options you need. If you need help figuring out what's going on then post back and I'll try to give you some pointers
By: digitaltree Date: 16/10/2003 18:48:00 English  Type : Comment
thanks for help, i think i have not set something in environment variables. i try and will let you know

Do register to be able to answer

EContact
browser fav
page generated in 348.260880 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page