Problem opening in new page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ryan2345
    New Member
    • Mar 2008
    • 26

    Problem opening in new page

    I have made a search page. Result of search displays the name of users along with their experience. if a user clicks on any name then a new browser page is opened and the details of that user are dipalyed. So now there are 2 pages open: 1 is the result page and the other is details page. If the user again clicks on other user name then that users details are shown on the same page on which it was showing previously. Now there should be 3 pages opened: 1 of result page, 1 of 1st users details and 1 of 2nd users details but there are only 2 pages opened. The details of 1st user is lost. How can it be solved. This is the following code that i have used for it.

    [code=php]
    $resultnum = mysql_num_rows( $data);
    if($resultnum>0 ) { // Echos out matches if anything was found
    while($info=mys ql_fetch_array( $data)){
    ?>
    <tr>
    <td width="139" height="26" valign="top"><p align="center"> <a href="searchacc ount.php?id=<? echo $info['FullName']; ?>" target=\"_blank \"><? echo $info['FullName']; ?></a></p></td>
    <td width="149" valign="top"><p align="center"> <? echo $info['YearsExp']; ?></p></td>
    </tr>
    <p>&nbsp;</p>
    <?php
    }// end of while
    }//end of if
    [/code]

    What is the problem in above code.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    This isn't a php problem.

    Can you clarify:

    User clicks on a username on the results page(p1), this opens a new window with the users details(p2).
    The user then clicks on another username on the results page(p1), and this then reloads the previous user details in p2.

    That the problem?

    Comment

    • passion4code
      New Member
      • Mar 2008
      • 4

      #3
      Originally posted by ryan2345
      I have made a search page. Result of search displays the name of users along with their experience. if a user clicks on any name then a new browser page is opened and the details of that user are dipalyed. So now there are 2 pages open: 1 is the result page and the other is details page. If the user again clicks on other user name then that users details are shown on the same page on which it was showing previously. Now there should be 3 pages opened: 1 of result page, 1 of 1st users details and 1 of 2nd users details but there are only 2 pages opened. The details of 1st user is lost. How can it be solved. This is the following code that i have used for it.

      [code=php]
      $resultnum = mysql_num_rows( $data);
      if($resultnum>0 ) { // Echos out matches if anything was found
      while($info=mys ql_fetch_array( $data)){
      ?>
      <tr>
      <td width="139" height="26" valign="top"><p align="center"> <a href="searchacc ount.php?id=<? echo $info['FullName']; ?>" target=\"_blank \"><? echo $info['FullName']; ?></a></p></td>
      <td width="149" valign="top"><p align="center"> <? echo $info['YearsExp']; ?></p></td>
      </tr>
      <p>&nbsp;</p>
      <?php
      }// end of while
      }//end of if
      [/code]

      What is the problem in above code.

      Well, I don't think that a link not following through in a new page / tab is a PHP issue at all. It looks to me like you're building your link a bit awkwardly. There is no need to escape the quotes on the target value when you are printing it to the browser with direct HTML.

      Comment

      • ryan2345
        New Member
        • Mar 2008
        • 26

        #4
        Originally posted by markusn00b
        This isn't a php problem.

        Can you clarify:

        User clicks on a username on the results page(p1), this opens a new window with the users details(p2).
        The user then clicks on another username on the results page(p1), and this then reloads the previous user details in p2.

        That the problem?
        User clicks on a username on the results page(p1), this opens a new window with the users details(p2).
        The user then clicks on another username on the results page(p1), and this then reloads the user details of new user in p2. It should be in p3.
        p2 should still contain the same user details.
        Sorry for being unclear

        Comment

        Working...