示例#1
0
    default:
        print "Error";
        break;
}
?>
	</head>
	<body>
	<div class="wrap">
	<div class="toogle">
		<?php 
$connectionstring = mysql_connect("localhost", "root");
if ($connectionstring == 0) {
    die("cannot connect to the db");
}
$db = mysql_select_db("4432project", $connectionstring) or die("cannot open the selected db");
$foodName = $thisPok->getFoodName();
$foodNum = $thisPok->getFoodNum();
switch ($choice) {
    case 'feed':
        print '<div class=\\"btn_form\\" align="center"><form method="POST" action="confirm.php?PID=' . $PID . '&choice=feed" ><p class="m_text">';
        print "You have {$foodNum} {$foodName}. Choose how many you want to feed:<br />";
        print '<input type="range" name="range" id="range" min="0" max="' . $foodNum . '" value="0" step="1" 
							onchange="showValue(this.value)" />';
        print '<span name="showRange" id="showRange">0</span><br />';
        print "<input type=\"submit\" value=\"Confirm\" />";
        break;
    case 'marry':
        $UserID = $_SESSION['userid'];
        print '<div class="btn_form" align="center"><form method="POST" action="confirm.php?PID=' . $PID . '&choice=marry" ><p class="m_text">';
        print "Choose the one you want your pokemon to marry: <br />";
        print '<div><select id="mary" name="marry">';