如何打开包含内容的php文件 [英] How do I open a php file with content

查看:100
本文介绍了如何打开包含内容的php文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我想打开一个包含之前页面发送数据的php页面。问题我有链接到新页面是在数据库中,并使用pdo列出。

Hey, I want to open a php page with data sent from the page before. The problem I have it the link to get to the new page is in a database and is being listed using pdo.

echo '<li  önClick = "headerMove();">'.$projectName.'<a href = "#"><img src = "../img/setting.png"></a><span id = "lastEdited">Last Edited: '.$lastEdited.'</span><span id = "sharedOption">'.$shared.'</span></li>';





如果你看有一个onclick听众一开始,我想知道如何打开我已设置的项目页面,以及将数据带到新页面。



我试过调用一个单独的javascript函数



if you look there is a onclick listener right at the beginning, I am wondering how I can get that to open up a project page I have set up but along with that bring data along to the new page.

I have tried calling a separate javascript function

function headerMove() {
<?php
header("Location: project.php");
?>
}



但PHP代码在调用javascript函数之前运行。



请帮助:)


but the php code runs before the javascript function is being called.

Please Help :)

推荐答案

projectName。' < a href =#>< img src =../img/setting.png\"></a><span id =lastEdited>上次编辑:'
projectName.'<a href = "#"><img src = "../img/setting.png"></a><span id = "lastEdited">Last Edited: '.


lastEdited。' < / span>< span id =sharedOption> ;'
lastEdited.'</span><span id = "sharedOption">'.


shared。' < / span> < / li>';
shared.'</span></li>';





如果你看起来有一个onclick听众,我想知道如何打开我设置的项目页面,以及将数据带到新页面。



我试过调用单独的javascript功能



if you look there is a onclick listener right at the beginning, I am wondering how I can get that to open up a project page I have set up but along with that bring data along to the new page.

I have tried calling a separate javascript function

function headerMove() {
<?php
header("Location: project.php");
?>
}



但PHP代码在调用javascript函数之前运行。



请帮助:)


but the php code runs before the javascript function is being called.

Please Help :)


这篇关于如何打开包含内容的php文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆