Jump to content

Trying to get started in learning PHP


Mythic Fr0st

Recommended Posts

I think you've got the wrong idea about this.  GET and POST are types of variables sent through a form usually.  If you see blah.php?one=this&two=that&three=woah it is a url that has GET variables in it.  The ? after the filename is the query string (or where the variables start basically).  one=this, two=that, three=woah are the values of these variables.  With register_globals ON you could do echo $one and see 'this', but this is poor coding so it's better to use $_GET['one'] ($_GET['var'] is how you access GET variables), and then you would have your value there.  Keep in mind these are easy to forge, so not always the best, and you want to put in some extra data.  POST variables are accessed via $_POST, or you can get both via $_REQUEST.  Both can be forged without too much of a problem, so watch out!
Link to comment
Share on other sites

[quote author=Mythic Fr0st link=topic=116939.msg476744#msg476744 date=1164947815]
I am wanting to learn PHP ( For making an online game I want )

Sadly, I dunno how to GET it working... I've downloaded php, but I dunno what i use? is there an editor for it? do you view it in your browser, use notepad? i've got no idea O_O

Can anyone help me with this, kinda a big set back lol
[/quote]
I think notepad is pretty good for it.

To use php, just put

"<? php

//stuff

?>" in your file.. and make sure it's name ends in .php.. all of the php stuff is done in the server. It will send normal html to the browser. Try putting echo"something"; in it for a start :P

Here is a [url=http://php.about.com/od/phpfunctions/PHP_Functions.htm]list[/url] of some PHP commands with descriptions of what they do :)

And people viewing your website won't be able to see the actuall php stuff on your page, they will just see the html that is sent to them.
Link to comment
Share on other sites

Ok, thanks, so how do I get a server, ( i've tried downloading apache 2.2.3, but it confused me a little )

Im only 15 lolz, with little programming experience, IF I downloaded Apache again ( installing it ), how would I upload the PHP to it? ?? or would I like haev to find a hosting service ( any ) and typing the PHP in there???
??? ???


Link to comment
Share on other sites

[quote author=Mythic Fr0st link=topic=116939.msg476752#msg476752 date=1164948499]
Ok, thanks, so how do I get a server, ( i've tried downloading apache 2.2.3, but it confused me a little )

Im only 15 lol, with little programming experience, IF I downloaded Apache again ( installing it ), how would I upload the PHP to it? ?? or would I like haev to find a hosting service ( any ) and typing the PHP in there???
??? ???



[/quote]
You can find a hosting service with PHP, it's been standard for a while, prolinkhosting.com does $10 for a year of unlimited transfer and storage, and a domain is like $9 from godaddy, or you can get easyphp from easyphp.org and it basically puts apache, php and mysql on your computer for you so you can work there.
Link to comment
Share on other sites

I see, I have had all three of them (MySQL, Apache 2.2.3, and PHP) on them I think I found them on easy.org, or something like that, However, I didnt get how I could do the stuff?

I tried typing PHP in MySQL I got errors O_O so I figured thats not right, and I tried writing PHP in the PHP program thingy, but that wasnt right either, I've always struggled learning PHP, and given up, cus I cant figure out how to err find the right things, and find the right "Place" to begin doing whatever I wanna do

- Basically, im saying, how can I work on my computer with all 3 of them ( What do I do  ??? )
Link to comment
Share on other sites

[quote author=Mythic Fr0st link=topic=116939.msg476759#msg476759 date=1164948822]
I see, I have had all three of them (MySQL, Apache 2.2.3, and PHP) on them I think I found them on easy.org, or something like that, However, I didnt get how I could do the stuff?

I tried typing PHP in MySQL I got errors O_O so I figured thats not right, and I tried writing PHP in the PHP program thingy, but that wasnt right either, I've always struggled learning PHP, and given up, cus I cant figure out how to err find the right things, and find the right "Place" to begin doing whatever I wanna do

- Basically, im saying, how can I work on my computer with all 3 of them ( What do I do  ??? )
[/quote]
You've got to find where apache is reading the files from, and save your files in there.  All php code needs to be between <?php and ?> braces, and your files will need to be saved as .php (unless you want to edit your apache config, but that's pointless at this stage).  Then instead of opening it up from Open File in your browser, you type in something like http://localhost while apache is running
Link to comment
Share on other sites

No worries, let us know how it goes :)  The big thing a lot of new people run into is that if you're saving in notepad, you have to make sure you go to "all files" when you save otherwise you'll get file.php.txt, which is NOT going to work.  That and make sure you are putting it in the proper directory that apache is looking for.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.