Jump to content

Distortion

Members
  • Content Count

    72
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Distortion

  • Rank
    Newbie
  1. How can I convert a string into a number, but so that this number is unique for that string.So if string123 has number 1243225634123 then there is no other string that has the same number.Also, how can I add 2 numbers together in the following way:123 + 456 = 123456I do not know the lenght of each of those numbers. (else i could've done 123*1000 + 456)Thanks in advance,
  2. $_POST['news'] will return Aaj if that checkbox is selected.If you want to check them individually you'll need to give them different names and try isset($_POST['news'])
  3. My javascript gives me a nice date and time by adding a certain number of seconds to the current time and date. But of course I cant trust my javascript so I probably have to do this calculation again in php before sending it to a database. With javascript I used the date object and then it automatically does the calculation for me. What is the best way to do this in php?Furthermore I want to upload this date and time to a database. Afterwards I want to be able to check if any given date from the database is sooner or later then another date. Also for this I need some feedback from more experienced programmers.Thanks in advance,Distortion.
  4. The exclamation mark means NOT.So instead of checking wether it returns 1, it checks wether it returns 0. In this particular case it checks which variables do NOT exist.
  5. When displaying a date it gives something simular to this. Fri Apr 16 2010 17:31:46 GMT+0200This is exactly what I want, without the GMT +0200. Is there a smart way of removing this, but avoiding the need of an entire custom clock?
  6. Thank you, that was what I needed to hear.I'd hoped that one could check existance and value at once but as it turns out, I had to use 2 separated conditions. At least I found out why my script wasn't working.
  7. if (document.getElementById("name")) {}Just for confirmation, this checks wether the element exists and if it's value is higher than 0. Am I right?
  8. On request of my brother I made a simple script that allows users, after they've entered the right passwords, to upload a small file to an extern server my brother rented.Now this script works as long as the script is in the same folder as the files have to go, but the problem is that that folder cannot be accesed with the http protocol. How can I still let someone upload a file to any given part of the server that cannot be accesed via the internet, because putting everything in the part of the server that can be accesed via the internet would allow anyone to see the information in those folders which is undesired.
  9. nice chart :)I started with html 2 years ago but wasn't very interested back then. 2 months ago i picked it up again due to school and learned css and php. Now im making a game as well, but progress is very slow. Javascript especially sucks because I spend hours trying to figure out what is wrong with my scripts.And in my experience the bigger your motivation at the beginning the faster you'll stop trying.
  10. thank you, i've got most of it working now.Can you tell me why it is better use getElementById instead of element.value?
  11. Distortion

    Gamearsenal

    It's a bit grey, maybe you could use some more contrast. I liked the orange.Personally I find that having the first half of the page devided in 2 columns and the other half in 3 columns makes the page chaotic. But that's probably just me.
  12. I tried all of those and it is still not working. IE gives me a more usefull error description (translated): 'document.theform.obj' is empty or not an object.Apparently it doesn't fill in the value of obj, but looks for and id called obj. Can this be fixed or do I have to made a different function for each article...
  13. I tried to get it by ID allready, that didn't work either. Also the getElementsByTagName() gave an undefined error... I'm really clueless here because as far as I can see everything should work.By the way, getElementsByTagName, is that supported by all browsers (that matter)?
  14. I have a form where a user can select a number of articles, of each article they only have so much. There is a button to fill in the maximum amount of articles in the form. Im new to javascript and I haven't found this anywhere (maybe because what im trying to do isn't even possible). The error message just says undefined... function max(object,input) {try {var obj = document.getElementByName(object);document.theform.obj.value = input; }catch(err) { txt="Error: " + err.description + "\n\n"; txt+="Click OK to continue.\n\n"; alert(txt); }} This is the html code (which is produced by php): <form name="theform" action="action2.php" method="post">Please choose the articles you want to sell:<br> Cans: <input name="can" size="5" value="0" type="text"> <b>Available:</b> 5 <input value="max" onclick="max('can',5)" type="button"><br> Bottles: <input name="bottle" size="5" value="0" type="text"> <b>Available:</b> 1 <input value="max" onclick="max('bottle',1)" type="button"><br></form> Can anyone say what I am doing wrong please?
  15. Thanks, I managed to get the result I wanted by just giving the popup function more arguments which I fill in with php. But AJAX is very usefull too.Dankje!
×
×
  • Create New...