link problem ! :D
Posted: Tue Dec 27, 2005 8:50 pm
hi guyz ! i got a problem in linking... hope u can solve that. the code for my page is below:
Now the problem is, with submitting the page, i have to combine two submits one is:
and another one is:
If i use the above submit button i get the link with hw_id in it but i cant send the data in database, and if i use the below one i can not get the hw_id in the link. so how to combine ?? i couldnt use the first link at the end coz its didnt give the hw_id if used at the end. hope that makes sense.
Code: Select all
<?php
if(!isset($_COOKIE['user_id'])||empty($_COOKIE['user_id'])){
echo "Please login first";
exit();}
include ('header.inc');
$page_title="Objective Achievement";
$user_id=$_COOKIE['user_id'];
$hw_title=$_POST['hw_title'];
$ptitle=$_POST['ptitle'];
$leader=$_POST['leader'];
$appdate=$_POST['appdate'];
$compdate=$_POST['compdate'];
$actdate=$_POST['actdate'];
$dur=$_POST['dur'];
$reportby=$_POST['reportby'];
require_once('mysql_connect.php');
$query="INSERT into hardware (user_id,hw_title,ptitle,leader,appdate,compdate,actdate,dur,reportby) VALUES
('$user_id','$hw_title','$ptitle','$leader','$appdate','$compdate','$actdate','$dur','$reportby')";
$result=mysql_query($query) or die(mysql_error());
$query="SELECT hw_id FROM hardware WHERE (hw_title='$hw_title') LIMIT 1";
$result=@mysql_query($query);
$row=mysql_fetch_array($result);
$url="transfer.php?hw=$row[hw_id]";
?>
<button onClick="window.location='<?php echo $url;?>'">Next>></button>
<html>
<body>
<form action="transfer.php" method="post">
<fieldset><legend>
<font size="4" color="blue">OBJECTIVE ACHIEVEMENT
</font></legend>
<table align="center" width="100%" border="0">
<tr><td><font face="Arial" size="3"><b>1. Original Project Achievement</b><br><font face="Times" size="3" color="blue"><i>(State the specific project objectives as described in proposal)</i><br>
<textarea name="orig" rows="2" cols="70"><?php if(isset($_POST['orig'])) echo $_POST['orig']; ?></textarea><hr></td></tr>
<tr><td><font face="Arial" size="3"><b>2. Objectives Achieved</b><br><font face="Times" size="3" color="blue"><i>(State the extent to which the project objectives were achieved)</i></tr></td>
<tr><td>
<textarea name="ach" rows="2" cols="70"><?php if(isset($_POST['ach'])) echo $_POST['ach']; ?></textarea><hr></td></tr>
<tr><td><font face="Arial" size="3"><b>3. Objectives not Achieved</b><br><font face="Times" size="3" color="blue"><i>(Identify the objectives that were not achieved and give reasons for not achieving the objectives)</i></tr></td>
<tr><td>
<textarea name="nach" rows="2" cols="70"><?php if(isset($_POST['nach'])) echo $_POST['nach']; ?></textarea><hr></td></tr>
<tr><td><font face="Arial" size="3"><b>4. Indicators for achievement of objectives</b><br><font face="Times" size="3" color="blue"><i>(Specify the key indicators applied, quantifiable or qualitative, in assessing the degree of success in achieving the objectives of the project)</i></tr></td>
<tr><td>
<textarea name="indi" rows="2" cols="70"><?php if(isset($_POST['indi'])) echo $_POST['indi']; ?></textarea><hr></td></tr>
<tr><td><font face="Arial" size="3"><b>5. How would you characterize the quality of this output ? </b><br><br>
<input type="radio" name="kl" value="sig" checked> Significant breakthrough <br>
<input type="radio" name="kl" value="maj" > Major improvement <br>
<input type="radio" name="kl" value="min" > Minor improvement <br><HR>
</td></tr>
<tr><td><font size='4' color='blue'> Click on Next button to save </td></tr>
<tr><td>
   
<input type="submit" name="hsubmit" value="NEXT >>">
<input type="reset" name="reset" value="CLEAR FORM"></td></tr>
</table>
<?php include('footer.inc');
?>Code: Select all
<button onClick="window.location='<?php echo $url;?>'">Next>></button>Code: Select all
<input type="submit" name="hsubmit" value="NEXT >>">