Jump to content

Selacius

Members
  • Posts

    134
  • Joined

  • Last visited

Everything posted by Selacius

  1. If your concerned about your database information, create a separate file which contains this information and require it in every page. It also makes it easier if you for some reason have to change databases or usernames as one file needs to be changed rather than all of them.
  2. Selacius

    Total PHP noob

    The server package i use is IBserver and works quite well for a personal desktop server. Just install the software, and away you go. Whatever your trying to code will go in the www folder which is created when you install IBserver.
  3. Selacius

    PHP and MySQL

    When querying your database, you should use this instead:$query=mysql_db_query ("your database","select * from patients");Just makes it look nicer from my standpoint. Also, I don't see where your actually telling the MYSQL to get the information from. Your not telling it what database to get the information from.
  4. The code is a lengthy piece of work, but mainly it is a form element in which the user inputs a few user defined values and also can play around with some numbers as well. The numbers in this example take the shape of a character creation system for an online game. There are 5 stats to which the user can increase and in doing so these values also increase the players beginning Hit points. This then all gets submitted to a final page via a form where the information can be inserted into a database for use in the game. If this is in any way/shape/form what you are looking for, feel free to PM me and I will gladly send you the code along with information on how to modify it to suit your needs. Many thanks goes out to aspnetguy on this forum and a few other forum members belonging to other forums.
  5. Due to the length of the code, I sent you a pm with it enclosed. Thanks for taking a look.
  6. Tried it that way and for some reason it doesn't want to work. I don't know whats wrong with it.
  7. No I didn't say I don't want to refresh the page. What I said is that my incremental number code does not require the refreshing of the page. The numbers and other user defined variables will be in a form, which will be redirected to a php page when the user submits the form. My question is, what do I change in the code which I pasted in the first post to allow the values to be carried over by the form.
  8. On a webpage I have an array which is filled with variables such as: $wprearray = array ("$wcomment","$wcgd", "$wcmf", "$wcmp"); Now these variables are defined elsewhere in the page so when they are placed into the array they will contain a value. With this array I will then add to the values already placed inside. EG. $wprearray[2] = $wprearray[2] + 5;Now if $wprearray[2] had an original value of 2, then after this it should have a value of 7. But that is not the case. The final value is displayed as 5. What is wrong here?
  9. In a previous topic I asked how I could create a script where the numbers were dynamically increased without having to refresh the page. Anyways I have that script all figured out now, and I intend on placing it in a form with other text boxes for which I will need to insert into a database. I am curious, how can I go from a code like: <tr><td>Strength:<td><center><div id="counters">4</div><td><a href="javascript:increments()"><b><center>+</a><td><a href="javascript:decreases()"><b><center>-</a> where counters is the actual value of the number I want to insert into the database. So how can I do this using forms? Or rather, how can I supply these variables (counters...) to a php via a form.
  10. I have a sequence of code, roughly 50-75 lines long of if statements checking a variable to base values and then changing other variables depending on which base value it matches.Ex.if ($a == "Socks"){$socks = $socks + 1;}elseif ($a == "Hat"){$hat = $hat + 1;}This sequence continues for about another 10 if statements. Now this lengthy piece of code is found 2 separate times in the page depending on previous decisions made in the code. I want to make it into a function that way I don't have to worry about it increasing the length of my code and if i need to change or add something, I have to do it to one sequence and not 2. Now some of you may wonder why i need it in two separate spots but i've tried it other ways but it didn't work. My main issue is how I can have it return the values from the actual if statement. I know I can have return $socks or return $hat, and then when calling the function I can do $func = clothing ();. But I just want to be able ot return the values and after calling the function do an echo $socks and if $a == "Socks" then it would display a 1.I hope you understand what I am asking.
  11. create a background image, with one side red and the other white. When you put it into your body tag if the resolution is larger than the image itself, then the image should just be stretched, which won't ruin anything pixel wise.
  12. Didn't change the displayed value from 5 to 6. THis is exactly what I want to do, but on a larger scale with 4 or so variables.
  13. I want to allow the user to press a link and/or a button which in turn will increase the count of a value previously displayed on a webpage. How can I go about displaying the new value without refreshing the page?
  14. Yes well that is what I am intending to do for my other none numerical data needed. Its just for this set of numbers and such I would like to create a script which can add/subtract them from a base number and in doing so change a different value. I know I can do it with php and just use forms but in order for the user to determine which number setup is best for him/her it would require a lot of refreshing.
  15. This is more of an HTML question AFAIK. Now are you wanting to marquee one image at a time? So an image moves across ur screen, then when it starts again a second image is shown. If so then I am not sure. But if you just want it to have a continuous loop of images directly one after another just keep adding the <img src> code one after anotehr in the marquee code.
  16. Is there a possible way to monitor the IP address of someone who not only mouseovers the image, but copies it?? That way in this persons case if he has the necessary copyrights he could potentially take action against the stealer.
  17. SOrry for not including it, but yes I'd be using PHP as well for the code. The rest of the page will be in PHP, but this small section of addition, etc will be in javascript to limit the amount of reloading that happens.
  18. I am looking for some information as to where I could start on the script I am trying to write. I am looking for one that can dynamically add or subtract numbers via a click of a button, without refreshing the page. And once these numbers have been added or subtracted, another value gets changed in the process. Then once this is all done with the user can press a final button to have it be inserted into a database along with other information from standard html forms.Any help as to where I could start and what I'd be looking for would be appreciated.
×
×
  • Create New...