TOMMURRAY Posted April 23, 2007 Share Posted April 23, 2007 I am attempting to create a php script for a golf website, the problem is that I am new to PHP and I have become stuck as I can't see were the error lies in the below code. The script calculates based on the variables but I thought I would have a number returned at the end of the script but nothing is displayed can anyone see any errors? if you want to know what the script is supposed to add up like let me know an I will do my best to explain or look up stableford points in golf. Thank you in advance. Tom <?php $count = 0; $score = 4; $si = 4; $handicap = 4; $par = 4; if ($handicap >= 0) { if ($score > 0) { $sp = 0; if ($handicap = 0) { $sp = $score; } else if ($handicap <= 18){ For ($count = 1; $count = $handicap; $count++){ if ($si = $count) { $sp = $score - 1; } else { $sp = $score; } } } else if ($handicap >= 19 && $handicap <= 36){ $handicap = $handicap - 18; For ($count = 1; $count = $handicap; $count++){ if ($si = $count) { $sp = $score - 2; } else { $sp = $score -1; } } } if ($sp - 1 = $par){ $stablefordpoints = 1; echo "$stablefordpoints"; } else if ($sp - 2 = $par){ $stablefordpoints = 2; echo "$stablefordpoints"; } else if ($sp - 3 = $par){ $stablefordpoints = 3; echo "$stablefordpoints"; } else if ($sp - 4 = $par){ $stablefordpoints = 4; echo "$stablefordpoints"; } else if ($sp - 5 = $par){ $stablefordpoints = 5; echo "$stablefordpoints"; } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/48359-need-help-with-php-script/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.