Author Topic: Brand New  (Read 2551 times)

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Brand New
« on: February 02, 2009, 06:35:32 PM »
Hello all, I'm ViceGrip
Hey guys, lately I've been wanting to make a game, preferably browser based ( i hate having to download stuff [games]). Anyways im starting with PHP.

I don't really have much experience at all with any scripting. The few things i have done is mess with making programs on VisualBasic, and also i used to be into WOW for a few months so i started my own server and learned a little about editing PHP (not really tho)

So my very first question haha

Well i downloaded the newest PHP 5.2.8 or something like that, and i was wondering, what do i do with it, and how do i make it so that i can test my scripts without a host? Like is there some installer i need to get or something? I have no idea how to open my PHP files. I don't even know if i CAN do it witout a host or anything. But please if you have any helpful info. or anythingggggg, please post.

THNX

Offline AcidicOne

  • Level 16
  • *
  • Posts: 147
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #1 on: February 02, 2009, 06:43:43 PM »
Well instead of just manually downloading and installing php itself, you might want to save your self some trouble and install like xampp, which will install php,apache,mysql basically everything you need to run a "site" locally for your development process.
http://www.apachefriends.org/en/xampp.html
And there is a Howto i posted not to long ago for setting up Smarty in xampp if your planning on using that as well.

And Welcome to the forums :)
People Like You, Are the Reason People Like Me Need Medication

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #2 on: February 02, 2009, 06:45:13 PM »
Thank you soo much, I really appreciate it.

Im gonna go check out those links and get right back to ya..

[20 minutes later] haha


.. ok so i have XAMPP and i have the little control panel running
and i just installed Smarty, and i was looking for phpinfo.php but idk where to find that.
..and once i have smarty and xampp going smooth am i ready to start learning the coding and what not?
« Last Edit: February 02, 2009, 07:22:02 PM by ViceGrip »

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #3 on: February 02, 2009, 07:36:02 PM »
ok ok i found php.ini and i changed the path and stuff
but what is a www root? like C:smarty\libs...?

Offline AcidicOne

  • Level 16
  • *
  • Posts: 147
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #4 on: February 02, 2009, 07:39:25 PM »
if you installed xampp to C:/xampp then your "web directory" is "htdocs" so if say you want your test site to be http://localhost/gamename/index.php. You would have a folder in htdocs named your game name
People Like You, Are the Reason People Like Me Need Medication

Offline AcidicOne

  • Level 16
  • *
  • Posts: 147
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #5 on: February 02, 2009, 07:56:01 PM »
yep once you get xampp, up and running you could easily start working on your site in php, all smarty allows you to do is separate the html from the php code, so you can do all the php coding in your php files and do all your html coding in relation to the same file in a separate temple file
People Like You, Are the Reason People Like Me Need Medication

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #6 on: February 02, 2009, 08:11:42 PM »
alright sweet. so i made the folder and i made index.php,
and i opened it in webbrowser and it was blank (guessign that's normal)

but when u say You can work this out to a referenced script/class:
smarty_connect.php:

where is smarty_connect.php
or am i making that haha im so confused. just wanna get thios all set up correctly b4 i start anything

Offline AcidicOne

  • Level 16
  • *
  • Posts: 147
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #7 on: February 02, 2009, 08:13:39 PM »
Here this post should help ya out.
http://community.bbgamezone.net/index.php?topic=1769.0

basically its the step by step instructions for smarty with xampp.
People Like You, Are the Reason People Like Me Need Medication

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #8 on: February 02, 2009, 08:39:55 PM »
thank you so much. i think  i got it.
When i open up the localhost thing, it says object not found, is that correct or no?

Offline AcidicOne

  • Level 16
  • *
  • Posts: 147
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #9 on: February 02, 2009, 08:44:30 PM »
did you start apache using the xampp panel? you'd have to start apache and mysql.
People Like You, Are the Reason People Like Me Need Medication

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #10 on: February 02, 2009, 08:49:46 PM »
Well while i was editing them files and stuff i had apache mySQL and firezilla on
and then i restarted apache
should i restart all of em?

and btw what is the page supposed to look like?

Offline AcidicOne

  • Level 16
  • *
  • Posts: 147
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #11 on: February 02, 2009, 09:00:38 PM »
well depending on what your trying to access it will display various things,now seeing i have no idea what it is you've got done and setup, then I would suggest checking out the guides on the xampp page, there usually quite thorough on the entire process.
People Like You, Are the Reason People Like Me Need Medication

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #12 on: February 02, 2009, 09:07:25 PM »
well guessing i have it done and all where do u think a good place to start would be. like maybe a link to a simple first timje project?

thanks again and again for all the tips and what not

Offline AcidicOne

  • Level 16
  • *
  • Posts: 147
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #13 on: February 02, 2009, 09:14:19 PM »
People Like You, Are the Reason People Like Me Need Medication

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #14 on: February 02, 2009, 09:36:35 PM »
whoa, im way confused.
haha like its just giving me all the code and stuff but i have no idea what i do with em all. i know to execute SQL stuff but it just gives me random pieces of php and html

btw im on the registration page

Offline AcidicOne

  • Level 16
  • *
  • Posts: 147
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #15 on: February 02, 2009, 09:46:01 PM »
hahah ah well am sure it will make sense eventually, its actually quite similar to Visual basic in the sense that you can quite easily look over code,pick 1 thing, discover what it does, and continue from there. Easiest explanation in relation to php /vb is think of the .php files as your modules and the .tpl templates for smarty is similar to form code.As far as Mysql is concerned it would be similar to reading values from a text file in VB. Reading and Writing data accordingly and displaying it on the form. They really are quite similar in many respects so take your time, the tutorial code I found was quite easy to understand what everything was doing once you just took the time to read it.Another tip I would suggest when learning anything new is find something you can relate the topic with aka comparing the php files to the modules from VB. Breaking it down to its simplistic form making it easier to understand.And if there is one thing I have learned is that once you learn one language learning another is easy, your just relearning syntax, as long as you keep the logical mindframe in mind.
People Like You, Are the Reason People Like Me Need Medication

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #16 on: February 02, 2009, 09:49:56 PM »
well its not reely that i don't know what the codes do, i just dunno where to put em.
or what to name them (registration.php) ya know. like ive seen all these codes b4 in like my old WOW server. its pretty much the same, im just confuzzled with where they go, like what folder.

hopefully u understood that haha
« Last Edit: February 02, 2009, 09:51:55 PM by ViceGrip »

Offline raestlyn

  • Level 29
  • **
  • Posts: 464
  • Reputation: +9/-5
    • View Profile
Re: Brand New
« Reply #17 on: February 03, 2009, 02:48:31 AM »
So you have problems with the folders. Thats easy to clear out. Say you have installed the the xampp in the C:xampp folder. Your "www root" is C:xampp/htdocs. So if you want to make a new page, example.php, and look at it on your browser you put in it the htdocs folder. After that you open your favourite server and go to http://localhost/example.php and voila, its there.

This isn't rocket science, you know. Just remember, htdocs/ == http://localhost/.


I can send you pics of my cocks if you want reference.


Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #18 on: February 03, 2009, 06:41:41 PM »
oh man that did clear out some of the trouble. that, and i figured out my files were name .php not actual php files HAH wow im dumb haha



so anyway i think i got it. whenever i clcik the index it opens up in internet explorer and says IT WORKS!!
thats all it says on the whole page haha

hoping that's right

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #19 on: February 03, 2009, 06:46:25 PM »
oh yeah something i forgot. i thinkin i understand the codes more and more and how to put em into htdocs and all of that.

BUT, i think my biggest problem is idk if theres pieces of code connect or if they are all separate. and if they do go togather whichs ones, like the lines it shows on the codes all overlap  =PP aghh haha

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #20 on: February 03, 2009, 07:57:53 PM »
ok guys, im sorry how dumb i was.
it took me a while to realize that at the bottom of the page it had the whole code done for me. i was trying and trying to figure out how to put those little pieces together and i was dying haha. i got it now.

working on the stats page and working with mySQL and stuff. thanks u guys for all the help. if i need any more help i bbe sure to ask

Offline bbgames

  • Level 16
  • *
  • Posts: 138
  • Reputation: +1/-0
    • View Profile
    • Building Browsergames
Re: Brand New
« Reply #21 on: February 03, 2009, 08:29:07 PM »
The line numbers in the tutorials seem to overlap because they're supposed to show you where we're at in the code - for example, if we build a 10-line piece of code to begin with, and then have to add something at line 8, I'll start the line number at 8 to show you where we are putting the new code.

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #22 on: February 03, 2009, 09:05:01 PM »
ohhhh!
haha okayy

i gotcha

thank you =]]

Offline ViceGrip

  • Level 5
  • *
  • Posts: 16
  • Reputation: +0/-0
    • View Profile
Re: Brand New
« Reply #23 on: February 03, 2009, 09:16:57 PM »
okay okay so i've gotten much further.
but ive come to a stopped point.
i've gotten my registration page going, and my login page, and now i am starting my index page


http://buildingbrowsergames.com/2008/05/16/building-browsergames-setting-up-a-templating-system-php/

This is the step i am currently stuck at ^^
so when i tried opening my index.php

i get this:

Warning: require(/usr/local/lib/php/Smarty/Smarty.class.php) [function.require]: failed to open stream: No such file or directory in C:\XAMPP\htdocs\index.php on line 4

Fatal error: require() [function.require]: Failed opening required '/usr/local/lib/php/Smarty/Smarty.class.php' (include_path='.;C:\xampp\php\smarty\libs\') in C:\XAMPP\htdocs\index.php on line 4




and i have looked at my
XAMPP\htdocs\index.php on line 4 and i have noidea what im supposed to do?


my index.php
<?php
 
// put full path to Smarty.class.php
require('/usr/local/lib/php/Smarty/Smarty.class.php');
$smarty = new Smarty();
 
$smarty->template_dir = '/web/www.domain.com/smarty/templates';
$smarty->compile_dir = '/web/www.domain.com/smarty/templates_c';
$smarty->cache_dir = '/web/www.domain.com/smarty/cache';
$smarty->config_dir = '/web/www.domain.com/smarty/configs';
 
session_start();
$smarty->assign('name', $_SESSION['username']);
$smarty->display('index.tpl');
 
?>




anyy ideas what to fix on my index.php??????

Offline bbgames

  • Level 16
  • *
  • Posts: 138
  • Reputation: +1/-0
    • View Profile
    • Building Browsergames
Re: Brand New
« Reply #24 on: February 03, 2009, 09:51:59 PM »
You need to change the path '/usr/local/lib/php/Smarty/Smarty.class.php' to the path to Smarty.class.php on YOUR server, not mine. :)

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal