richiec Posted April 11, 2009 Share Posted April 11, 2009 Does anyone know why this isnt working? <?php function sameamount($currentbid,$bidnumber){ if ($currentbid == $bidnumber){ echo (" <script language='JavaScript'>\n alert('You cant bid the same amount of points');\n location.href='auctions.php?auction=view';\n </script>"); return false; } else { return true; } } if(!sameamount($currentbid,$bidnumber)) die(); ?> it just refreshes the page doesnt give the error and messes up the other functions of < and > Link to comment https://forums.phpfreaks.com/topic/153679-solved-function/ Share on other sites More sharing options...
redarrow Posted April 11, 2009 Share Posted April 11, 2009 php version. <?php function sameamount($currentbid,$bidnumber){ if ($currentbid == $bidnumber){ echo"You cant bid the same amount of points\n"; header("refresh: 5; url=auctions.php?auction=view"); exit; return false; } else { return true; } } if(!sameamount($currentbid,$bidnumber)) die(); ?> Link to comment https://forums.phpfreaks.com/topic/153679-solved-function/#findComment-807591 Share on other sites More sharing options...
richiec Posted April 11, 2009 Author Share Posted April 11, 2009 Just tried that and it does the same thing any other ideas? Link to comment https://forums.phpfreaks.com/topic/153679-solved-function/#findComment-807595 Share on other sites More sharing options...
jackpf Posted April 11, 2009 Share Posted April 11, 2009 Do $currentbid and $bidnumber actually have values, or have you just not copied that? Link to comment https://forums.phpfreaks.com/topic/153679-solved-function/#findComment-807606 Share on other sites More sharing options...
richiec Posted April 11, 2009 Author Share Posted April 11, 2009 i hadnt coppied it, it was my mistake ive figured it out now.. there was actually nothing wrong with what i thought it was lol it was just a simple hidden text field i had put in the wrong place and was in the wrong <form> so when it was actually getting to those variables it was missing something. Thanks for the help anyways ~Rich Link to comment https://forums.phpfreaks.com/topic/153679-solved-function/#findComment-807622 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.