How to open a new window to view data from a mysql table via php?

Asked

Viewed 420 times

1

Well what I’d like to do is this, where I am learning php, I made the page to view registered users as name and email fields, and made a preview button that will call a new window with all user data, the mode I learned is to put everything dynamically on a single page, but I want that by clicking preview opens a new window as if it were pop-up with all user information.

What I learned was, put the button to display the following code:

<a href='administrativo.php&id=<?php echo $dado['op_id']; ?>'<button type="button" class="btn btn-xs btn-primary"><i class="fa fa-fw fa-eye"></i></button></a>

On the administrative page is:

<?php
$link = $_GET["link"];
$pag[1] = "visualizar.php";   
if(!empty($link)){
        if(file_exists($pag[$link])){
            include $pag[$link];
        }else{
            include "dashboard.php";
        }
    }else{
        include "dashboard.php";}?>

So inside the admin page he shows me the user information.

What I need is that clicking on view opens a new window with all the information.

I tried to change the code to:

 <a href='visualizar.php&id=<?php echo $dado['op_id']; ?>'<button type="button" class="btn btn-xs btn-primary"><i class="fa fa-fw fa-eye"></i></button></a>

but returns me page not found.

Can someone help me ?

1 answer

1


Next: Missed the "?".

visualize.php? id= Follows:

 <a href='visualizar.php?id=<?php echo $dado['op_id']; ?>'<button type="button" class="btn btn-xs btn-primary"><i class="fa fa-fw fa-eye"></i></button></a>

  • Truth Heheheheheh :) Thanks Even

Browser other questions tagged

You are not signed in. Login or sign up in order to post.