Jump to content
MakeWebGames

Crazy form lol


galdikas

Recommended Posts

<form action='bank.php' method='post'>

Amount to invest:<input type='text' name='investment' value='{$bi['money']}'/>

For:<select name='period'>";

$ibank=mysql_query("SELECT * FROM ibank");

while($ib=mysql_fetch_assoc($ibank))

{

echo"<option value='{$ib['id']}'>{$ib['name']}({$ib['rate']}%)</option>";

}

echo"</select>

<input type='submit' name='submit' value='Invest' />

</form>

ok... Can anyone tell me why when I click Invest button, it redirects me to gym.php????

Form looks alright to me... There is no other code that would accept the form. But even without that code, should't it just refresh the same page???

Link to comment
Share on other sites

have you got a open form before hand, try adding </form> before you start your bank.php form (this is a quick fix but you should find where it originates from and close the tag properly.

And as said before you are selecting everything from ibank a better query would be SELECT `id`, `name`, `rate` FROM `ibank` WHERE `.....`='......' (fill in the dots with the userid fields)

Link to comment
Share on other sites

Yeah, I bank just stores the length, rate, and timespan of investment :)

So I need to select everything... And it is only 4 rows there, so not a major thing anywayy :)

I found the problem.. It was as Dayo said... another form left open above :) Was half asleep yesterday :)

Edited by galdikas
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...