一般來說左邊框架大部分是一個一個的網頁設計
因此如果框架間要傳值會有點問題
因此為了解決這個問題將會使用到get來取得值(但較不安全)
因此就會多一個rightIng.php的頁面
並且frameLeft.html裡的網址會變成 "網頁名稱.php?get變數名稱=<?php echo $a ?>"
"http://localhost/getData/webGui/rightIng.php?A=<?php echo $thing1; ?> & B=<?php echo $thing2; ?>"

frame.html

<html>
<frameset cols="350,*"> (左邊框為350,右邊為減掉350後剩餘的長度)

    <frame src="http://localhost/getData/webGui/frameLeft.php" scrolling="auto">
    <frame src="http://localhost/getData/webGui/frameRight.php" name="showframe" scrolling="auto">

</frameset>
</html>

frameLeft.html
按下左頁框後會將rightIng.php的顯示內容導入到右頁框去
<html>
<body>

        <a href="http://localhost/getData/webGui/rightIng.php?A=<?php echo $thing1; ?> & B=<?php echo $thing2; ?>" target ="showframe"><?php echo $thing1." ".$thing2; ?></a><br />

</body>
</html>

frameRight.php
一開始在載入頁面時右頁框預設的字

<?php

echo "Hello";

?>

rightIng.php
接收get的值後執行動作 將 顯示結果傳送到右邊的框架
<?php

$Date = $_GET['A'];
$Type = $_GET['B'];
 
echo '送過來的值:'.$_GET['A']."<br>"."<br>";
echo '類型:'.$_GET['B']."<br>"."<br>";

?>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 晨柚 的頭像
    晨柚

    晨柚的部落格

    晨柚 發表在 痞客邦 留言(0) 人氣()