help Simple lottery php script

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Sat May 11, 2013 1:50 am

Dear All,

I wrote simple script of "lottery" it echo message ("Try again bad luck" ) not single time ("You won Lottery" ) even i wrote several times random nos in input box. Please help me to correct it. code is given below

<title> Lottery </title>

<form action="http://localhost/mumtaz/lotterygame.php" method="post">
Enter your lucky number: <input type = "text" name="num"> <br/>
<input type ="submit" value= "Submit">




if ($n==$r){

echo ("You won Lottery" );
else {
echo ("Try again bad luck" );




Post Reply