hi in this app i have three pages
from the first page id is passed to the second page.in the third page i am not able to get the value..............

if (mysql_num_rows($result) > 0 )
{
while($row = mysql_fetch_row($result))
{
  echo "<tr>";
 echo "<td><a href='detailjob.php?id=".$row[3]."'>".$row[0]."</td><td>".$row[1]."</td>";
echo "</tr>";
echo "<tr><td bgcolor='#008080'></td><td bgcolor='#008080'></td></tr>";
  }
echo "</table>";
}
$line=$_GET['id'];
echo $line;
$result=mysql_query("SELECT * FROM post_resume where id='$line'");
for ($i = 0; $i < 1; ++$i)
{
$line = mysql_fetch_row($result);
$rid=$line[0];
echo "<table width='60%'>";
print "<tr><td><font face='Times New Roman' color='#008080' size='3'><strong>Resume Title</strong></font></td></tr>";
print "<tr><td> $line[2] </td></tr>";
print "</table>";
<form method="post" action="agreement1.php">
<?php
echo "thanks for creating aggreement with CG";
echo $_GET['rid'];
$line=$_GET['rid'];
echo $line;
?>

Recommended Answers

All 8 Replies

and where are you passing id in page 2 ?

$line=$_GET;i am getting 2nd page is working.....i am able to fetch data from the db.third is not working

Thats in page 2. You are passing it href='detailjob.php?id=".$row[3]., so you are getting. My question is, where are you passing $line from page2 to page3 ? Can you post page2 and page3's code using code-tags ?

sorry.............
page1

if (mysql_num_rows($result) > 0 )
{
while($row = mysql_fetch_row($result))
{
echo "<tr>";
echo "<td><a href='detailjob.php?id=".$row[3]."'>".$row[0]."</td><td>".$row[1]."</td>";
echo "</tr>";
echo "<tr><td bgcolor='#008080'></td><td bgcolor='#008080'></td></tr>";
}
echo "</table>";
}

page2

$line=$_GET['id'];
echo $line;
$result=mysql_query("SELECT * FROM post_resume where id='$line'");
for ($i = 0; $i < 1; ++$i)
{
$line = mysql_fetch_row($result);
$rid=$line[0];
echo "<table width='60%'>";
print "<tr><td><font face='Times New Roman' color='#008080' size='3'><strong>Resume Title</strong></font></td></tr>";
print "<tr><td> $line[2] </td></tr>";
print "</table>";

page3

<form method="post" action="agreement1.php">
<?php
echo "thanks for creating aggreement with CG";
echo $_GET['rid'];
$line=$_GET['rid'];
echo $line;
?>

$rid=$line[0];

You are just assigning the value to $rid. You can pass the value from one page to another in 3 ways.
1. pass it in the query string ($_GET method).
2. use a session variable to pass the values.
3. Post it through the form. ($_POST).

In page 1, you are passing the id in query string. In page 2, you aren't doing passing the value ot $rid to page 3.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/careergl/public_html/detailresume.php:2) in /home/careergl/public_html/detailresume.php on line 3

wats this error mean

That means you have an echo statement or a html tag before session_start().

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.