厄介な小さな問題があります。こことグーグルで検索して見つけたほぼすべてのことを試してみた、うまくいく解決策を見つけることができません。
これの目的は、以前に作成された「部屋」にそれらを渡すことです。
何を試してもかまわないようですが、hrefを指定したonclickを使用して別のページにロードすることはできません。そして、私はそれが簡単な修正であることを知っています。
コードを正しく投稿していない場合は申し訳ありませんが、質問をするのはこれが初めてです。通常は答えを探し回るだけです。
//..Left out <?php and my connect info but it is in my script
//--CLEANUP MY MESS
$sql = "SHOW TABLES";
$result = mysql_query($sql) or die('err11');
while ($row = mysql_fetch_row($result)) $testing[$row[0]] = true;// Gets a list of tables in the database and turns them into a handy format
if ($testing['prim']){// Checks to see if table prim exists
$sql = "SELECT * FROM prim"; // Pulling all info again after cleaning
$result = mysql_query($sql) or die('err11');
$_e = '';
while ($row = mysql_fetch_assoc($result)){// Cycle through enteries to see what rooms are up
$_e = $_e . "<a href='' onclick='join(" . $row['room'] . ");'>" . $row['teach'] ."</a><br>";
}
}else $_e = "Sorry no rooms are open";
mysql_close($con);
?>
<!DOCTYPE html>
<html>
<head>
<script>
function join(er) {
alert('ffs is this even firing');//this is a debug statement i was using... it was firing
//THE LINE BELOW DOES NOT SEEM TO WORK
document.location = "http://***late edit to get rid of the web address lol sorry***start.php?name=" + document.getElementById("name").value + "&room=" + er;
//THE LINE ABOVE DOES NOT WORK
}
</script>
<title>Portal</title>
</head>
<body>
Name:<input type="text" id='name' name="name"><br><?php echo $_e ?>
</body>
</html>
私はwindow.locationwindow.location.hrefなどのような多くの異なる小さなバリエーションを試しました。また、返品を台無しにして、私を狂わせてくれました。助けてくれてありがとう。皆さんは良い一日を過ごしています。