Jump to content

brokenhope

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by brokenhope

  1. Well first off, since its going to be php, you will need a method of storing data, flatfile or a database, unless you put the data through constant submit forms, and resend the data of the move you made, and positions of everything. If it was javascript it would be a bit less complicated as far as moving goes... because plus if its through submit forms the data can very eaisly be altered... which if the game is just a fun game it doesnt matter, but if your planning on keeping records of who wins and such, youll need flatfile or a database... anyways... artifical inteligence for this kinda thing is actually quite hard... your going to have to go 3 ways with this: determine the computers move based on the players move, basically design a way so the computer will always move a certain way if the play moves one way... like if the player moves say piece 2 forward to the left, the computer moves say piece 4 forward to the right... and it will always do that... you can add in some randomation as well... you can design it make it near impossible to win, I dont know how, but if you figure out how to counter every move the player does, and write it up, you can do that, or just completely randomize the computers moves... any way is going to be very difficult... AI is probably one of the most complicated things to do, I couldnt even write up some decent AI for tic tac toe.
  2. Actually that worked. Except instead of # I used . and instead of div, it was td. But thanks and for anyone else reading this wondering what worked, here is an example: [code] td.bodyText a:active {color: #FFFFFF;} [/code]
  3. [!--quoteo(post=358119:date=Mar 24 2006, 09:26 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ Mar 24 2006, 09:26 PM) [snapback]358119[/snapback][/div][div class=\'quotemain\'][!--quotec--] Just keep the main colors that you're going to use in most of the site as you normally would and then for the other side, just add another selector before the a:whatever declaration. That will make it so the style will only apply to links within things of that type, I.E. div#left a:link { stylehere }. [/quote] I dont really understand that... and I figured out there was an error in the orignal style it is actually this: [code] a:link {color: #3E4953} a:visited {color: #3E4953} a:link {color: #FFFFFF; text-decoration: none;} a:visited {color: #FFFFFF; text-decoration: none;} a:hover {color: #FFFFFF; text-decoration: none;} a:active {color: #FFFFFF; text-decoration: none;} [/code] Also I dont use divs, I use tables, and since everything is in tables, and (td's actually), it wouldnt really be of much help... is there any way I could add those properties to a table class I already have? td#(what is left for?) a:link {color: #FFFFFF} I also already have a td class for the td in the body, if that will make a diffrence or cause a problem... because its where I need the new link colors at. Thanks for replying.
  4. On my page the body and navigation bar are almost oppisite shades, body is dark, and the navigation bar is lighter, and they both contain links... so obviously there needs to be 2 link colors... but how do I do this? [code] a:link {color: #3E4953} a:visited {color: #3E4953} a.body:link {color: #FFFFFF; text-decoration: none;} a.body:visited {color: #FFFFFF; text-decoration: none;} a.body:hover {color: #FFFFFF; text-decoration: none;} a.body:active {color: #FFFFFF; text-decoration: none;} [/code] Is the CSS for the links... and those are the correct things for the navigation, but when I have links in the body you cant even see them... so I need 2 styles of links colors... how do I do this?
  5. Ive never done this before but this may be of some help: [a href=\"http://www.spoono.com/php/tutorials/tutorial.php?id=42\" target=\"_blank\"]http://www.spoono.com/php/tutorials/tutorial.php?id=42[/a]
  6. Im making a login for my script... it uses cookies if you check the remember me box, and sessions if you dont check the remember me box when you login. 1 cookie/session for userid and 1 for a md5'd version of your password. Now on every page it runs a query to check your userid and password, you know to get your user info and such, but how am I supposed to tell if your logged in through a cookie or session? In the past I just went: if ($_COOKIE['userid']) { // cookie } elseif ($_SESSION['userid']) { // session } else { // not logged in } Is there a better way? Any helpful hints? any problems with what im doing?
  7. Yeah, this isnt PHP like was said above. You cant really protect your images from being saved at all. There is always Prnt Scrn, and then they have a copy of there screen... so no matter what they can save them... as for no right click, it doesnt affect some browsers, and browsers with javascript disabled... I know in firefox whenever I right click the alert box saying no right click comes up, and the menu that comes up with a right click still comes on, so the only thing that happens is an annoying message box... it really doesnt work. Your best idea is to watermark your images so if theyre stolen people know where they came from.
  8. Well, I just thought I would give some input on how you would go about doing this with PHP and GD. You would need to get your script to parse the tables, and "redraw" everything correctly, using GD, add in images, backgrounds done by loops by figuring the sizes of the original and repeating, quite a lot of work, but could be done... probably would require a lot of power to do to.
  9. That doesnt make sense... I dont edit in dreamweaver or anything... I use notepad... and by button i mean, submit button, not a button in flash...
  10. Im making a cancel button for my registration, and I was wondering how I would get the cancel button to direct you to a diffrent page? I mean do I have to make a whole new <form action="diffrentpage.php" method="post><input type="submit" value="Cancel"></form>? Or can I do some onClick="" event? This might involve some light javascript? Im not sure, but I would prefer it was within the same form tag as the registration button, which submits the form... is that possible? Is that a good or bad idea?
  11. Alright, thanks, I have a question though, actually 2. With the time, does mysql automaticaly fill it in or do I? And when I go to display it will I be able to format it to like March 21, 2006, or 03/21/06, the only way I know to do that is when you have a numerical timestamp, like theres 12+ numbers, I dont quite remember but PHP has a function for it, and a function to render the date/time from that. Second, under attributes, whats the diffrence between having it blank, binary, unsigned, and unsigned zerofill? Oh and a third thing, for my level table, pretty much any power is listed, like any admin type power, and any mod type power, and theres a column for each, and each row for each level has a 0 or 1 filled in, is that bad? There could be up to 20 columns, but theyre filled with a 1 or a 0 across the rows... heres a short example of what I mean (slimed down): (pageaccesslevel will be an int of any 2 digit number) id| name | pageaccesslevel | register | login | updinfo | etc... they will go on 0 | guest | 1 | 1 | 1 | 0 | 1 | loggedin | 2 | 0 | 0 | 1 | 2 | mod | 3 | 0 | 0 | 1 | 3 | admin | 10 | 0 | 0 | 1 | They are designed that way purposely, so that if you want to disallow registrations, just change it to 0 in the guest userlevel (default for everyone), if you dont want to allow anymore logins or have a banned group just change them to 0, pageaccesslevel is for pages that require you to have a certain level of access to view them.
  12. I use to really be into PHP and such around a year ago, and I took a big break, and im trying to get back into it again, I used to be pretty much an expert at it, and I had done it for over 2 years... but now im really rusty. The thing I need help with really, is helping me with a concept I never quite grasped... dealing with mysql, and how to set up the database properly. Now im making a member script right now, and heres a rough outline of the 'members' table. userid, username, userpass, userjoindate, userpageviews, userlastlogin, userlevel, useravatar, userfavorites Now, the userid is easy, I will set it to int, auto_increment. The thing's that I dont know how I should set is pretty much everything else, usually I would set them all to Text... username will contain the persons username userpass will contain a md5'ed version of the persons password userjoindate will contain a timestamp of the date they joined userpageviews will contain a numerical value of the number of pages they have viewed userlastlogin will contain a timestamp of the date they last logged in userlevel will contain a numberical value to the id of their userlevel (corresponding in the userlevel/ privilages table) useravatar will contain a url, maybe an id to their avatar userfavorites will contain an array, or a string (to be "explode()"'ed into an array) of the users favorite pages on the site Now what would be the ideal settings for those? Most of those will be limited and wont get to big, but userfavorites could get decently big, because I dont think I will put in a limit to how many pages they can add to their favorites. One last thing, should I name those like that? Would that be professional-like? Or should I use a 1 letter prefix? or none? The next thing would just be a very helpful thing, but isnt needed, I could do some research and figure it out, but I just need some examples for querys... basicaly the more complex ones... you dont even have to use real names, just used like Table1, Table2, Table3, Row1, Row2, Row3, *, etc. Like: $select = mysql_query("SELECT Row1, Row2 From Table1 Where Row1 = 'Bah'"); $fetch = mysql_fetch_array($select); $num = mysql_num_rows($select); Thats the first query ive written in about a year, it could be messed up... but using 3 variables is how I usually did it, actually most times I didnt have the $num, so it was just 2... Thanks for reading... please help.
×
×
  • 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.