Pages: 12Next
Current Page: 1 of 2
begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 10:31PM

Hello there

hello, I want to begin with php programing but I really dont'know how to begin

I already know something about html and a litle bit about css and javascript, but those are easy to learn and also easy start learning.

But how do you start with PHP, how can i make my first script and how to open it, where do I have to save my file?

Can someone tell me step by step how to begin my first script and open it and see the result, Just a simple hello world:

<?php

hello world!

?>

from this point I dont know what to do, only thing I know is to save as .php

I already instal wampserver and I see that icon also and when I press on it and click localhost then it shows a page with It works?

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 10:34PM

good thats a good start for first time,,,



open up

c:/wamp/www

you put any files you want to run in here


so say u have ur file hello.php


save into www folder



by the way ur code should be


<?php

echo 'hello world!';

?>



then just open your browser and type in http:// localhost/hello.php





get that done first then ask me anything u want

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:00PM

he thank you for youre answer

he that is what i did but he cannot find the page

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:03PM

how do u mean you cant find it?

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:06PM

like i said the page is not found

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:08PM

oh. well are u sure ur wamp icon is white ?


did u name the file right?

naming a file as hello.php may name it as hello.php.txt


u need to make sure the file type is php and not txt

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:11PM

I make a file, save it as .php in to c:/wamp/www and then I click on icon then localhost

and type in /hello.php after loccalhost, like this:

[localhost]

but the page is not found!

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:12PM

and ur putting the file into the www folder in wamp?


also in the folder should be an index.php

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:15PM

the icon is not compleetly white!

It has been colored yellow for 2/3 and the remain is white

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:16PM

ha

yes I found the index.php file to

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:17PM

ok well then there is something wrong,,,,,

press contrl alt del


and check which of these servies are running


httpd.exe
mysqld-nt

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:17PM

got it working then?

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:20PM

I see only that notepad and internet are activated !

Does it make a difference if having windows vista!!

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:23PM

did u use notepad to make ur file?

are u sure wen u saved it that u changed the "txt file" to "all files"





anyway in task manger click services allow the top -u will see a long list of programs.. just file those two if u can?

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:25PM

notepad I know how to save as all files and with .php

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:27PM

its just that if it finds index.php

but cant ur php file wat else can it be?!



the only thing maybe it to empty the browser history and try again

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:27PM

should I activate httpd.exe and mysqld-nt!

how?

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:31PM

no - left click wamp icon


press stop all services

then wait for icon to go red
then press start services

it should go white
but if it goes yellow in mean mysql is not working

this isnt ur problem tho



localhost/index.php is loading

but urs is not
u need to find why that is

Options: ReplyQuote
Re: begin with php
Posted by: getron (---.cable.wanadoo.nl)
Date: February 21, 2008 11:39PM

I deleted my browser history

I made a new file called: again

saved it as again.php in c:/wamp/www

I click on the icon > localhost

and after local host>again like this:

[localhost]

and it says page not found!

Options: ReplyQuote
Re: begin with php
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: February 21, 2008 11:41PM

type in localhost/index.php that work?

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


Sorry, only registered users may post in this forum.