Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. try changing foreach($_POST as $id) { to foreach($_POST['display'] as $id) {
  2. Something like? <?php if(isset($_GET['id'])) { $id = (int) $_GET['id']; echo $id; } else { header("Location:someotherpage.php"); } ?> page addi = http://yoursite.com?id=1
  3. That limits the amount of chars not words, you would need to mix word count and conditional statements.
  4. Not sure if you can get that, have you asked paypal?
  5. Hmm not sure whats wrong, but not really looking. Did notice though this line error_reporting(E_ALL & E_NOTICE); doesn't need the E_NOTICE as E_ALL is all the errors.
  6. <?php if(isset($_POST['Submit'])) { $wood += (int) $_POST['select']; $gold = $gold - ($wood / $_POST['select'] * 5);//5 gold per piece? } else { $gold = 50; $wood = 0; } ?> <p>GOLD: <?php echo $gold;?></p> <p>WOOD: <?php echo $wood;?></p> <p>BUY WOOD:</p> <p> <form id="form1" name="form1" method="post" action=""> <label> <select name="select" id="select"> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> </select> </label> </p> <label> <input type="submit" name="Submit" id="Submit" value="Submit" /> </label> </form> <p> </p> Something like that might work, but next time try your self first.
  7. Then save there email in a session, surely that will be fine
  8. Do you know how to get information from the db? I am assuming yes, so... <?php $sql = "SELECT * FROM table_name"; $sql = mysql_query($sql); while($rows = mysql_fetch_assoc($sql)) { $headers .= 'Bcc:'. $rows['email']. "\r\n"; } ?>
  9. <?php $status = ($content[4] >= 0) ? 'green' : 'red'; echo "US Oil Fund (USO)<p>$$contents[1] <img src='images/".$status."arrow.jpg'> $contents[4]; ?> Edit: beat me to it
  10. I can't think of any other ways. Surely the user will already be logged in, so just check where he came from when he got to that page.
  11. Sessions or cookies then?
  12. Try adding error_reporting(E_ALL); to the top of the code.
  13. It would be best to use $_GET and transfer there ID if possible?
  14. Learn arrays. $meals = array ( 'breakfast' => "cereal", 'lunch' => "hot dog", 'dinner' => 'hamburger' It is not closed. it should be $meals = array ( 'breakfast' => "cereal", 'lunch' => "hot dog", 'dinner' => 'hamburger' ); This should help http://djw-webdesign.awardspace.com/code.php?snippet=8
  15. Try restarting all services, also what colour is your wamp icon.
  16. Hmm that shouldn't effect anything. It should be in one of these forums, depends on the problem. http://www.phpfreaks.com/forums/index.php?action=collapse;c=28;sa=collapse;#c28
  17. Wrong Forum. But have you changed any of the PHP settings since you last used it?
  18. <?php $file = fopen("questions.txt", "r"); while (($data = fgetcsv($file, 1000, ",")) !== FALSE) { $questions[]= $data; } fclose($handle); foreach($questions as $quest) { echo $quest; } print_r($questions); ?>
  19. Only just read what he wanted, so chill out.
  20. Look at his code $username = $_SESSION['username']; $result = mysql_query("SELECT * FROM users ORDER by rep desc") or die(mysql_error()); $rank = 1; while($row = mysql_fetch_array( $result )) { $check = $row['username']; if($check == $username){ echo $rank; } $rank++; } is the same as doing <?php $username = $_SESSION['username']; $result = mysql_query("SELECT * FROM users WHERE username = '".$username."' ORDER by rep desc") or die(mysql_error()); $rank = 1; while($row = mysql_fetch_array( $result )) { echo $users['id']; } ?> I don't see why you need a separate rank.
×
×
  • 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.