|
||||||||||
|
|||||||
| GoogleCommunity Sponsor |
Use coupon "forum" for 50% Off! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
Sponsored Links
|
|
|
|
#2 (permalink) |
|
Google Freak
![]() Join Date: Jun 2007
Location: Phoenix, Arizona
Posts: 498
Thanks: 0
Thanked 5 Times in 5 Posts
![]() |
<?php
there. |
|
|
|
| The Following User Says Thank You to sleepyhead For This Useful Post: | [ugly_cat] (01-12-2008) |
|
|
#3 (permalink) |
|
Senior Googler
![]() Join Date: Sep 2007
Location: Nevada
Posts: 188
Thanks: 0
Thanked 3 Times in 3 Posts
![]() |
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! |
|
|
|
| The Following User Says Thank You to munlytobako For This Useful Post: | [ugly_cat] (01-12-2008) |
|
|
#4 (permalink) |
|
Senior Googler
![]() Join Date: Nov 2007
Posts: 125
Thanks: 0
Thanked 4 Times in 4 Posts
![]() |
Start WAMP5 or where to start in PHP programming?
|
|
|
|
| The Following User Says Thank You to AS-4 For This Useful Post: | [ugly_cat] (01-12-2008) |
|
|
#5 (permalink) |
|
Elite Googler
![]() |
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.. |
|
|
|
|
|
#6 (permalink) |
|
Noogle
![]() Join Date: Jan 2008
Location: Essex, England
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
![]() |
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. |
|
|
|
| The Following User Says Thank You to Zebedee For This Useful Post: | [ugly_cat] (01-14-2008) |
|
|
#7 (permalink) |
|
Google Guru
![]() Join Date: Oct 2005
Location: c:\GoogleCommunity
Posts: 3,368
Thanks: 3
Thanked 12 Times in 12 Posts
![]() ![]() ![]() ![]() ![]() |
Simple page output:
PHP Code:
HTML Code:
<html> <head> <title>Example Output</title> </head> <body> Hello World </body> </html> 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. |
|
|
|
| The Following User Says Thank You to andrew247 For This Useful Post: | [ugly_cat] (01-14-2008) |
|
|
#8 (permalink) |
|
Senior Googler
![]() Join Date: Nov 2007
Posts: 125
Thanks: 0
Thanked 4 Times in 4 Posts
![]() |
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! |
|
|
|
| The Following User Says Thank You to AS-4 For This Useful Post: | [ugly_cat] (01-14-2008) |
|
|
#9 (permalink) | |||
|
Google Guru
![]() Join Date: Oct 2005
Location: c:\GoogleCommunity
Posts: 3,368
Thanks: 3
Thanked 12 Times in 12 Posts
![]() ![]() ![]() ![]() ![]() |
Quote:
Quote:
Quote:
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). |
|||
|
|
|
| The Following User Says Thank You to andrew247 For This Useful Post: | [ugly_cat] (01-14-2008) |
|
|
#10 (permalink) |
|
Senior Googler
![]() Join Date: Nov 2007
Posts: 125
Thanks: 0
Thanked 4 Times in 4 Posts
![]() |
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.
|
|
|
|
| The Following User Says Thank You to AS-4 For This Useful Post: | [ugly_cat] (01-14-2008) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |