ayok Posted December 15, 2007 Share Posted December 15, 2007 Hi, I've got a different result on my local server and web server.??? I created this page. On this page, you can find some company projects which are taken from mysql database. But I cannot get the data when I clicked on one of the project. No data is selected in the next page. However, the script is working properly if I tested it on my localhost. Here is the php script on index.php <?php include "../../dbconnect/koneksi_db.php"; $result=mysql_query("SELECT * FROM project"); while ($data=mysql_fetch_array($result)) { echo "<a href=detail.php?id=$data[proj_no]>$data[title] - $data[company]</A><BR>"; } From this index page, we can click on one of the links to the project detail which goes to detail.php. <?php include "../../dbconnect/koneksi_db.php"; $result = mysql_query("SELECT * FROM project WHERE proj_no='$id'") or DIE(mysql_error()); $data = mysql_fetch_array($result); $body_project = nl2br($data[body]); echo "<h1 align='center'>$data[title]</h1>"; echo "Begin: $data[year]<br>Status: $data[status]<br>Bedrijf: $data[company]<br>"; echo "<p>$body_project</p>"; echo "<a href='file/$data[file]'>dossier downloaden<br>"; echo "<a href='index.php'>terug naar projecten</a>"; ?> In this page, the information cannot be shown in the browser. Could anybody help me to find out what's wrong? Thanks, ayok Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted December 15, 2007 Share Posted December 15, 2007 I don't see where you're setting the $id variable that is used in the query on detail.php Quote Link to comment Share on other sites More sharing options...
ayok Posted December 15, 2007 Author Share Posted December 15, 2007 Hi roopurt, How should I set the $id variable on detail.php? I thought I don't need to set it on detail.php, because it's set on index.php a href=detail.php?id=$data[proj_no]"; Thanks ayok Quote Link to comment Share on other sites More sharing options...
ayok Posted December 15, 2007 Author Share Posted December 15, 2007 What I can't understand, the scripts are working on local server. ??? Quote Link to comment Share on other sites More sharing options...
papaface Posted December 15, 2007 Share Posted December 15, 2007 You're using register_globals and shouldnt. Any references to index.php?id=nrjew Should be changed from $id to $_GET['id'] Quote Link to comment Share on other sites More sharing options...
ayok Posted December 15, 2007 Author Share Posted December 15, 2007 Thank you!! ayok Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.