使用链接调用另外一个php的页面 - easysoft/phpsciter GitHub Wiki

使用链接调用另外一个php的页面

本事例位于examples/load-php文件夹下

1.编写入口文件

<?php
$oSciter = new PHPSciter();
$oSciter->setResourcePath('file://' . __DIR__ . '/res/');
$oSciter->setWindowFrame(100, 100, 100 + 500 + 1, 100 + 500 + 1);
$oSciter->setWindowTitle('hello');
$oSciter->loadFile("load.php");
$oSciter->setOption(PHPSciter::SCITER_SET_SCRIPT_RUNTIME_FEATURES,
PHPSciter::ALLOW_FILE_IO | PHPSciter::ALLOW_SOCKET_IO | PHPSciter::ALLOW_EVAL |
                               PHPSciter::ALLOW_SYSINFO);


$oSciter->run(PHPSciter::SW_TITLEBAR | PHPSciter::SW_RESIZEABLE | PHPSciter::SW_MAIN | PHPSciter::SW_ENABLE_DEBUG
|PHPSciter::SW_CONTROLS);
?>

2.编写load.php用来跳转到href.php

<a href="href.php">This is load.php</a>

点击 "This is load.php" 这句话 跳转到 href.php

3.编写href.php用来跳转回到load.php

<a href="load.php">This is href.php</a>

4.实现链接跳转

自此我们实现了 在页面上点击 "This is load.php" 和 "This is href.php" 之间的相互跳转