Jump to content

ryeman98

Members
  • Posts

    286
  • Joined

  • Last visited

    Never

Everything posted by ryeman98

  1. lol, thanks for the correction ... it's been a long night Remember to click Topic Solved!
  2. Put that line in a string or if they're already variables just do: $variable = str_replace(",", 'to', $variable); Wow, that's it.
  3. Sorry about that, I kinda ran off too quick. <?php if ($_GET['act'] == "choose") { echo "<form action='rps.php?act=result' method='post'>"; echo "<table align='center' width='10%' border='0'><tr><td align='left'>"; echo "<input type='image' name='choice' value='rock' src='../images/rock.gif'>"; echo "<input type='image' name='choice' value='paper' src='../images/paper.gif'>"; echo "<input type='image' name='choice' value='scissors' src='../images/scissors.gif'>"; echo "</td></tr></table>"; echo "</form>"; } elseif ($_GET['act'] == "result") { $_SESSION['pageview'] = $_SESSION['pageview']+1; if ($_SESSION['pageview'] > 1) { echo "<a href='/rules.php'>No cheating!</a>"; } else { $user_choice = $_POST['choice']; $comp = array("rock", "paper", "scissors"); $rand_comp = rand(0, 2); $comp_choice = $comp[$rand_comp]; echo "You chose: ". $user_choice ."<br />"; echo "Comp chose: ". $comp_choice ."<br /><br />"; ?> As you can see, in IE ONLY, $user_choice is NULL. In Any other browser, it has what the user submitted.
  4. I know, I know, we all hate IE but I made a Rock, Paper, Scissors game and it works fine and dandy in FF but breaks down in IE. The problem, the users guess won't submit. Any suggestions?
  5. Well ... that helps out a little but I got that far. I guess I'm just looking for some kind of function to set the dimension of an array. Well hang on, this is how it works: Say 5 was the prob number: within your for loop $numbers[$counter]; // Same as: $numbers['1']; $numbers[$counter]; // Same as: $numbers['2']; and so on ...
  6. Maybe this helps because this is what I want: $numbers = array(Lowest, Highest); And that sets the array's dimension ... does that help?
  7. Let's see the code between lines 20 and 30 then. Just because it'll be easier to see what's going on.
  8. Ok, this is what my array looks like: $numbers = array(); And it's like that because I don't know how much info is going to be inserted.
  9. where line 21 is if(mysql_num_rows($result){ You're missing a closing bracket: if(mysql_num_rows($result)){
  10. Bumping because I'm a little short for time
  11. Is there an error message when you're trying to download it?
  12. I'll try as best as I can. I have an array but I don't know how big it'll be. I count the number of columns in the database and then select a random number. rand(1, $row['COUNT(id)']); Then from that, it selects the column of the random number. There is a column called probability. It calculates the chances of the thing being true out of 100. Then, whatever the probability number is, that is the size the array is going to be and another variable adds a random number to each array. Then, there is some other stuff but it isn't relevant.
  13. So I've got this one script. I need to know, how can I make an array work when I'm unsure of the size and values of it? If you don't understand, I'll try to go more in-depth but it's tough.
  14. Sorry for double posting but there are users waiting to get onto the site ...
  15. No, the value must be 1. I'd say just starting out simple: <input type="checkbox" name="gSale" value="1"> <?php $gSale = $_POST['gSale']; if ($gSale == 1) { // Was checked } ?>
  16. If you're grabbing data from a specific row of data, then you don't need a while loop. If you're grabbing data from multiple rows, then you'll need a while loop as it will keep going through the data until there is nothing left for it to pull out. Hope this helps!
  17. You mean you didn't read it, tried to copy and paste, and nothing worked. Don't worry about it bud. If he wants to try to do it the easy way, that's his choice. He'll just end up hurting himself in the long run.
  18. The connection stuff is correct. As a matter of fact, the site won't even let me log in to the FTP right now But the connections has to be (sql4.byethost13.com, database name, password)
  19. Everything else works though, right?
  20. I've tried a few different things and nothing has worked. For the first few days, it was a 111 error and then just decided to switch over to a 113. Any ideas or suggestions?
  21. Well you can definitely google for such scripts but my cousin has been making really cool stuff with AJAX and he's online a lot of the time so if you want to ask him to point you in the right direction, just mail him: www.boedesign.com
  22. Definitely possible using AJAX. I don't know how to do it though.
  23. In your tag, just put value="1" in the checkbox tag. If it isn't checked, the value will be 0.
  24. I'm not sure I fully understand ... do you want to post the code?
×
×
  • 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.