Jump to content

[SOLVED] function


richiec

Recommended Posts

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

 

 

 

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.