我正在运行一个处理表单的php代码,并将您发送到另一个页面。处理完毕后,我目前正在以以下代码为例:
echo "Success, redirecting to <a href = "index.html">index.html</a>";
//I then do some stuff with the session here
echo "<script>window.open('index.html', '_self')</script>";
我觉得这不是最有效的运行方式。是否可以使用纯PHP打开新页面? (因为第一个回显线定义了页面,所以标题位置无法正常工作)。或者,是否有一种方法可以对标头位置执行相同的操作,并且以不同的方式显示较早的回声线,但效果仍然相同?
答案 0 :(得分:1)
将数据发送回浏览器后,您将无法使用PHP进行操作。
我个人只是在JavaScript中添加 function onDocumentMouseDown(event) {
event.preventDefault();
mouse = new THREE.Vector2();
var rect = renderer.domElement.getBoundingClientRect();
mouse.x = ( ( event.clientX - rect.left ) / rect.width ) * 2 - 1;
mouse.y = - ( ( event.clientY - rect.top ) / rect.height ) * 2 + 1;
var vector = new THREE.Vector3(mouse.x, mouse.y, 0.5);
vector = vector.unproject(camera);
var raycaster = new THREE.Raycaster(camera.position, vector.sub(camera.position).normalize());
var intersects = raycaster.intersectObjects(scene.children, true);
if (intersects.length > 0) {
var helper = new THREE.BoxHelper(object);
helper.update();
var boundingSphere = helper.setFromObject(object);
var center = boundingSphere.geometry.boundingSphere.center;
var radius = boundingSphere.geometry.boundingSphere.radius;
var distance = center.distanceTo(camera.position) - radius;
var box = new THREE.Box3().setFromObject(dd);
var realHeight = Math.abs(box.max.y - box.min.y);
}
,然后在5000ms之后运行setTimeout()
。