Jump to content

DarkElf

Members
  • Posts

    103
  • Joined

  • Last visited

DarkElf's Achievements

Member

Member (2/7)

0

Reputation

  1. Forgive me if I'm wrong, but that looks like they are just shifting the contents of a paragraph not included in the div up the page using position relative so that it appears to be inside the div?It's a nice idea but doesn't quite work for my problem as my div is not of a fixed size.
  2. I've been having a lot of fun with this opacity stuff, however I've just noticed a problem on my pages and can't work out how to fix it.Basically I've got a div which contains text and images which has opacity of 75% so that the background image is partially visible through the div. But it turns out that not only is the div itself transparent, but all of its contents are as well. This is barely noticable with black text, in fact until now I hadn't spotted it at all, but once I started adding images its quite obvious and isn't the desired effect. What I want to do is make the background colour of the div only transparent, the contents should preserve their full opacity.Is this possible? I tried changing the opacity values of the images but that only changes their opacity in relation to the div, not the background image!
  3. It's possible to rewrite the php files everytime you update the variables, you just need to set the correct access permissions on the files.But you are creating hurdles you don't need to! What you are effectively talking about is flat files, these used to be all the rage before relational databases. The reason relational databases are now used so commonly is because they are much better at the job.If you really want to use a flat file system I would go back to your xml files. Just place them in a folder without public access, that way a public request for them will be denied but your php scripts (executed on the server) will still be able to access them and do what you want with them.
  4. There are loads of things you can use to make a game, for your text based style game I would suggest the following:1. A good working knowledge of html/xhtml, css, and javascript (you are making a website after all).2. A good working knowledge on xml - I'm a bit of a hypocrit here as I've never used it much, but it goes with the above point.3. An extremely good knowledge of a server side script such as PHP or ASP, or possibly another more powerful scripting language that can be integrated with the web.4. An extremely good knowledge of a database system, MySQL is a good one for beginners.5. If you want to take this seriously you will really need to run this on your own server........ learn a lot about this.Basically you've got a lot to learn about a lot of things on the internet.
  5. Always check for other threads on your topic before posting, you will often find the answers you are looking for http://w3schools.invisionzone.com/index.php?showtopic=5409
  6. DarkElf

    Blank Field Check

    This is normally something you'd do with javascript before the form has been posted, but if you want to do it with php then you could use a simple if statement to test each field. The best way to do it would be an if with an is not (=!) clause to which will return true if the value isn't empty. Something like: if($_POST('fieldname') =! ''){code to be executed} This can be followed by an else clause if you want it to do something special if the field is empty.
  7. Which assumes you have that kind of control over your server (if you are renting webspace that is quite unlikely!)
  8. What do you mean by tools? as SFB says, php itself can be downloaded from php.net if that is what you mean.If you mean the tools for writing and working with php then you just need a simple text editor such as notepad, nothing more complicated is required.If you want to test php scripts on your pc then you also need to install a server and php, this can be done the easily by using a prebuilt package such as xampp.
  9. Without wanting to dampen your enthusiasm (which is great).... The coding you need for those kind of games can get pretty complicated (I'm talking thousands and thousands of lines of code). As with a lot of things in life, you can't just dive straight in at the deep end, you need to start somewhere simple and learn the building blocks step by step.Build lots of websites and learn to use PHP to perform simple tasks for these sites. Once you're comfortable with that you can start using it for more complex things and eventually you will gain the knowledge and experience to build your game. You will probably also find you need to learn some other skills such as using a MySQL database.You have to understand that what you are asking for is not something you can write a tutorial on. Its not like there is a set piece of code for these things that you change a few values in and there you have it, if it were that easy everyone would do it. You're talking about something on par with writing your own piece of software. You need to master the basics first and then learn how to apply them to increasingly complex situations.
  10. Not sure where the slashes come in, but I think you can do it using query strings.The query string variable is added to the url: www.mywebsite.com/index.php?page1To retrieve the variable use this: $variable = $_SERVER['QUERY_STRING']; The you can then use variable in your code, this could for example be the name of a file that contains the content to be displayed on the page, therefore you can use your index.php file as a template and import the content using something like this: $content = file_get_contents($variable.'txt');echo '<p>'.$content.'</p>';
  11. You need to store the titles in an array, and then have a subarray under each title storing the subtitles. You can then use nested foreach loops to work through the main array and then each subarray to list the contents.
  12. Ok, I don't approve of just giving people the answer, on top of which I've not got time to try it all out and test it, but here are a few things you could try playing with.The first thing that leaps out is that you've got all those pictures floating left, floats can commonly cause problems in which things spill out of divs (exactly what you are seeing now). You have to have the float there so try and see if you can find another way to ensure the div stays the right size other than purely expecting it to resize to fit the content. If you are only ever going to use the same number a size of images then you can simply set the dimensions of the div. Otherwise you may need to use a script to resize the div based upon its contents, this can be achieved with both server and client side scripts depending upon your preference.The other thing I notice is that all those images are inside a <p> tag, I'm failing to see the neccesity and this may also be possibly causing problems. You can acheive exactly the same effect without the <p> tags be reassigning some of those values either to the div or to the images.Go away and have a play.
  13. I can't see the problem immediately, but its likely to be something you've missed out. A fair few problems between browsers arise when they apply different css defaults to values; the IE default gives you the desired effect but the firefox default doesn't so you need to make sure you define the problem value.Although Firefox is a better browser, I must admit I always find problems occur in Firefox more than IE, the best way around this is test your scripts in Firefox and other browsers from the beginning. Its a pain if you've been writing a script and testing it in IE all along, and once its finished you then have a look in Firefox or Opera or something to find that it looks horrible and you've 100 lines of css to find the problem in!
  14. Brilliant thanks very much.Apologies, I should have looked on php.net, I'm turning into one of those lazy people who don't think for themselves
  15. Thanks guys, I can't believe some of the things they go into in the article, its a fair bit more powerful than I had thought.
×
×
  • Create New...