Jump to content

Selacius

Members
  • Posts

    134
  • Joined

  • Last visited

Everything posted by Selacius

  1. I am trying to figure out the best way to save my RPG object data in AS3. I would preferrably like it to be sent to a server and saved in a db, however I am struggling with how to send all of my data across to PHP. The objects are quite lengthy and have nested objects within them as well. Any suggestions would be greatly appreciated.
  2. I'd personally like to keep it on the same page if its possible. It would just make things much easier for me.
  3. I don't think its the code itself because it correctly displays the pop-up window, and withholds the text from being displayed until the proper selection is made. The code itself works exactly as I would like, but the problem is in the mysql_query updating the database regardless of the user's selection.
  4. With those changes, will it make it so that I only update the database when the player accepts the quest? Because it has no problem modifying the database, its just the fact that it does so regardless of the users selection.
  5. I am using the script which pops up a confirmation box to allow my users to select which quests they would like to partake in. Depending on what button is pressed, the user will either accept the quest, or decline it. If the user accepts the quest then I must modify the database with some new values to reflect the user accepting the quest. This doesn't work though because the values get updated in the database regardless of whether the user actually accepts the or declines the quest although the code for the mysql_query is found in the if ( confirm("Text Here") ) { portion of the script. This is how I have setup the confirmation script to work with the mysql_query, maybe I am somehow doing it wrong. <script>if ( confirm("Conditional Question To Start Quest") ) {document.write ("Comment about accepting quest.");document.write ("<font color=black><?=mysql_db_query ("$dbx", "UPDATE **** SET `*` = '*' WHERE * = '*'"); ?></font>");}else {document.write ("Comment about declining quest.");}</script> Now I have to use the font color command in the query because it will display a value of 1 which looks pretty unsightly. I'm sure that there is more likely a way to do this with AJAX but I am still trying to learn javascript. If someone could make me a script which will have the confirmation box, areas to modify for text depending on the action the user has taken and also the ability to properly modify the db when the quest is accepted, it would be much appreciated. Or at least show me how I would go about doing so.
  6. Well something seems to be wrong with your computer. No offense, but I installed IBserver and ran it immediately and it worked for me. But then again Im using WinXP.
  7. Okey, well installing it is one thing, running it is another. You need to actually have the program running in the background. So start up IBserver and then go to your localhost.
  8. Download IBserver, its very simple. http://sourceforge.net/projects/ibserver/Just download the newest version, install, and place your files in the www folder. Then in your browser go to http://localhost and you will find your files.
  9. Your index.html file will need to be a *.php file, your server would need to be configured to allow php as well. The actual code would be:<? include ("navmenu.html"); ?>
  10. You can't as far as I know, make a variable out of a number. Therefore your idea, although much simpler for making the names of the checkbox than mine, is not possible.
  11. Ummm. In the members table in your database, do you have a column with the title delbox? Thats your first mistake, your asking the query to delete all rows where the column (delbox) is equal to 1, which has nothing to do with your checkboxes. My suggestion is to give each checkbox a dynamic name. Your already using a for loop which increments $i each time, well why not combine that with the name delbox and that will be your dynamic checkbox name. Then when you pass the form, also pass the max number of rows in your query, then on the action page have another for loop which goes from 0 to the max rows again. Then, all you do is if ($delbox.$i == "On") { $sql -> DELETE....}else { do nothing}THat would be the best way. Also, checkboxes as you have seen in my If statement, don't return a 0 or 1, but an on or off.
  12. Use include ("navemenu.html") instead.
  13. Wanna make a bet? I've done it on 90% of my website. Trust me, it works. http://ca.php.net/manual/en/function.echo.php Look at the examples.
  14. Why do you need this if I may ask? Wat are you trying to do?
  15. Although While loops can do what your looking for, I believe it would be much easier for you to use for loops. It would lower the amount of coding you need to do.This is a for loop:for ($i=0;$i<$numsys;$i++) {content}Now the 0 should be replaced with your lower limit, its the value where $i will start the loop at.
  16. Fix this:$query = "INSERT INTO `members` VALUE ( NULL,".$name."NULL".$pwd.");Should be: $query = "INSERT INTO members VALUE (NULL, $name, NULL, $pwd)";That should work. Also, for this:echo "Thank you for registering echo ".$name."! Your account has been created. Please go back and log in.";You can make it just this:echo "Thank you for registering $name! Your account has been created. Please go back and log in.";No need for the second echo.
  17. Selacius

    Simple Question

    Im assuming that since your posting this in the php forum, that your form is based inside a php page. If so, then the answer has two possibilities. a) You can insert the date on the form side of the page, or:) Insert the date on the submitted side of the form (page that the form sends you to).Either way the code will look like this:$today = date("Ymd"); Which will output it like 20060405If you want to add slashes to it you can do:$today = date("Y/m/d"); Now if you are going to put it on the form page then all you do is this:<INPUT name=startdate value=$today type=hidden> Assuming your form is in the <? ?>, but if its not then it will look like this:<INPUT name=startdate value=<?=$today;?> type=hidden>
  18. $result = mysql_query("SELECT * FROM <table> ORDER BY <column> ASC"); while ($row = mysql_fetch_array)) {rest of code in here}
  19. Man, I would suggest just using PHP. Its 1000000x easier and less heart ache. I am sure you can get PHP to work on a MAC, so I don't see what the problem is.
  20. Selacius

    Cron Job + PHP

    I do have cPanel, but I am setting up an auction house for my game. SO whenever a user posts a new item to be auctioned, I want it to create a cron job that expires in the time designated by the user.
  21. Selacius

    Cron Job + PHP

    What is the PHP code to add a cron job? I know how to execute them, but I need a code which will set a cron job up when a page is viewed.
  22. Not that I am aware. Your just checking to see if the table exists so sorry, that should be <table> and not <database>. So the only delay would probably be a very minute value.
  23. Selacius

    PHP Editors...

    I use Crimson Editor. http://www.crimsoneditor.com/
  24. Just do I query to select from the database before hand with the name of the table your looking for. Then also do an if statement to see if its valid.The code:$result = mysql_query("SELECT * FROM <database>");if (!$result) {echo "Table doesn't exist";}else {echo "Table Exists already";}
  25. Can you paste the php code that your using? We really have no idea wats wrong unless you tell us.
×
×
  • Create New...