Google Community
Latest Forums Rules Resources
Custom Search

Go Back   Google Community > Webmaster Forums > Web Design, Coding & Programming Forum

GoogleCommunity Sponsor
Cirtex Hosting
Use coupon "forum" for 50% Off!

Reply
 
LinkBack Thread Tools Display Modes
Old 01-10-2008, 12:15 AM   #1 (permalink)
Elite Googler
 
[ugly_cat]'s Avatar
 
Join Date: Mar 2006
Location: MM
Posts: 1,789
Thanks: 53
Thanked 55 Times in 52 Posts
[ugly_cat] is an unknown quantity at this point
Send a message via Yahoo to [ugly_cat]
Exclamation how to start PHP

today i downloaded Wamp5 ..about i want to know php programming..and then.,now how can i start it? ...
thanks...
[ugly_cat] is offline   Reply With Quote
 
Sponsored Links
Old 01-10-2008, 03:31 AM   #2 (permalink)
Google Freak
 
sleepyhead's Avatar
 
Join Date: Jun 2007
Location: Phoenix, Arizona
Posts: 498
Thanks: 0
Thanked 5 Times in 5 Posts
sleepyhead is on a distinguished road
<?php

there.
sleepyhead is offline   Reply With Quote
The Following User Says Thank You to sleepyhead For This Useful Post:
[ugly_cat] (01-12-2008)
Old 01-11-2008, 04:52 AM   #3 (permalink)
Senior Googler
 
munlytobako's Avatar
 
Join Date: Sep 2007
Location: Nevada
Posts: 188
Thanks: 0
Thanked 3 Times in 3 Posts
munlytobako is on a distinguished road
use wamp so that you can run it on your localhost.

Find tutorials on web, practice PHP using your text editor (dreamweaver), save it on wamp folder, run it on localhost.

That's it!
munlytobako is offline   Reply With Quote
The Following User Says Thank You to munlytobako For This Useful Post:
[ugly_cat] (01-12-2008)
Old 01-11-2008, 06:07 AM   #4 (permalink)
Senior Googler
 
Join Date: Nov 2007
Posts: 125
Thanks: 0
Thanked 4 Times in 4 Posts
AS-4 is on a distinguished road
Start WAMP5 or where to start in PHP programming?
AS-4 is offline   Reply With Quote
The Following User Says Thank You to AS-4 For This Useful Post:
[ugly_cat] (01-12-2008)
Old 01-12-2008, 01:45 AM   #5 (permalink)
Elite Googler
 
[ugly_cat]'s Avatar
 
Join Date: Mar 2006
Location: MM
Posts: 1,789
Thanks: 53
Thanked 55 Times in 52 Posts
[ugly_cat] is an unknown quantity at this point
Send a message via Yahoo to [ugly_cat]
ya..,thanks to all..,
but,i want to know..one fact..
when i did start the html web pages..

<html>

.......xxx...xx....xx

</html>

and then,.i saved "index.html" ..finished..webpages..
now..how can i start and save index file with PHP..,
i am just learner at PHP..
[ugly_cat] is offline   Reply With Quote
Old 01-12-2008, 03:21 AM   #6 (permalink)
Noogle
 
Zebedee's Avatar
 
Join Date: Jan 2008
Location: Essex, England
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Zebedee is on a distinguished road
Instead of putting .html on the end of the file name, put .php
NB. Although I recommend saving your pages as .html and parsing them as .php however, this will render the code in shades of blue and as a new php coder perhaps it best to leave as php to make it easier to read code.
Whenever you want to write php code put "<?php" then start code on next line. At the end of the php code put "?>".

Also, don't get into the habbit of having both a index.html page and a index.php page on your root as this will be seen as duplicate content.
Zebedee is offline   Reply With Quote
The Following User Says Thank You to Zebedee For This Useful Post:
[ugly_cat] (01-14-2008)
Old 01-12-2008, 12:33 PM   #7 (permalink)
Google Guru
 
andrew247's Avatar
 
Join Date: Oct 2005
Location: c:\GoogleCommunity
Posts: 3,368
Thanks: 3
Thanked 12 Times in 12 Posts
andrew247 is a glorious beacon of lightandrew247 is a glorious beacon of lightandrew247 is a glorious beacon of lightandrew247 is a glorious beacon of lightandrew247 is a glorious beacon of light
Simple page output:
PHP Code:
<?php
// This is a sort of "header", i.e. HTML before the content. I've used concatenation
// (.= joins strings) so that you can still relate to the html structure, 
// although it could just be represented by:
// echo ("<html><head><title>Example Output</title></head><body>");

// \n is a unix new line
$header "<html>\n";
$header .= "<head>\n";
$header .= "<title>Example Output</title>\n";
$header .= "</head>\n";
$header .= "<body>\n";

$footer "</body>\n";
$footer .= "</html>\n";

echo(
$header);
echo(
"Hello World\n");
echo(
$footer);
?>
That would output:
HTML Code:
<html>
<head>
<title>Example Output</title>
</head>
<body>
Hello World
</body>
</html>
That is pretty much a basic output.
You can then start using condition statements etc to make it do things if certain things are true.
Once you get into it you can start doing all sorts of things.

Here is some PHP I created to do my physics homework for me - it plots a graph (with error bars calculated and drawn on all points, as well as calculating the centroid, then you can manually change the gradient by certain amounts until you get a best fit line) using data input that I got from a Simple Harmonic Motion experiment (uses GD library to draw lines).
It's only PHP 4 (Awardspace at which it is hosted does not support PHP5 unfortunately, so you won't find public or private specified variables, nor have I used magic __construct() or anything above basic OOP.
It gets the job done quite nicely though, and I have commented the code quite a lot.
Example Output

Last edited by andrew247; 01-12-2008 at 12:39 PM.
andrew247 is offline   Reply With Quote
The Following User Says Thank You to andrew247 For This Useful Post:
[ugly_cat] (01-14-2008)
Old 01-14-2008, 10:52 AM   #8 (permalink)
Senior Googler
 
Join Date: Nov 2007
Posts: 125
Thanks: 0
Thanked 4 Times in 4 Posts
AS-4 is on a distinguished road
I'm not good at PHP either but afaik

$header
is a variable right? why do you declare that with different values? when you call $header with an echo command which one do you think will it show? or was that code something I'm not familiar with?

If you save that code as sample.php and run it you'll get a different result as what you've posted, or I did it wrong?

You could try it this way instead

<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>

</body>
</html>

Which will output

Hello World!


AS-4 is offline   Reply With Quote
The Following User Says Thank You to AS-4 For This Useful Post:
[ugly_cat] (01-14-2008)
Old 01-14-2008, 12:47 PM   #9 (permalink)
Google Guru
 
andrew247's Avatar
 
Join Date: Oct 2005
Location: c:\GoogleCommunity
Posts: 3,368
Thanks: 3
Thanked 12 Times in 12 Posts
andrew247 is a glorious beacon of lightandrew247 is a glorious beacon of lightandrew247 is a glorious beacon of lightandrew247 is a glorious beacon of lightandrew247 is a glorious beacon of light
Quote:
$header is a variable right?
Yes.
Quote:
why do you declare that with different values?
I don't - I just keep lengthening the string.
Quote:
when you call $header with an echo command which one do you think will it show?
It will display all of it.
The concatenation ( .= ) joins strings together, so "<head>\n" is added on to the end of "<html>\n" etc until you have the whole header.

I could have done it the way you suggested, it would have worked just the same, but I don't really like mixing PHP and HTML.
The reason I concatenated it is so that it looked neater, that was all.
(Also I think the structured listing the forum outputs is pretty cool).
andrew247 is offline   Reply With Quote
The Following User Says Thank You to andrew247 For This Useful Post:
[ugly_cat] (01-14-2008)
Old 01-14-2008, 12:59 PM   #10 (permalink)
Senior Googler
 
Join Date: Nov 2007
Posts: 125
Thanks: 0
Thanked 4 Times in 4 Posts
AS-4 is on a distinguished road
I see now, but how do I run that code? I copy paste it then save as sample.php but it just displays the text inside.
AS-4 is offline   Reply With Quote
The Following User Says Thank You to AS-4 For This Useful Post:
[ugly_cat] (01-14-2008)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A bad start... News Alerts Google Employee Blogs 0 06-22-2007 03:04 PM
How do I Start A blog?? UBBull2003 Search Engine Optimization Forum 8 02-19-2007 09:43 AM
no start on the start menu mttschlz General Computer Forum 7 10-03-2005 09:42 AM
How do you start a conga redmonster General Computer Forum 1 04-20-2005 01:20 PM


All times are GMT -8. The time now is 03:03 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004–2007 Google Community