Jump to content

why can't $_GET get a string word from URL? is it array that $_GET cannot get from URL?


Recommended Posts

Hi everyone, I don't know why $_GET didn't get string from URL from another page. can you help? here my code:

First page:




$sql = $GaryDB->prepare("SHOW TABLES");
$list = "";
$list2 = "";


while ($row = $sql->fetch()) {
    $list .= "<a href='$row[0].php?=$row[0]'>".$row[0]."</a><br />";
<html lang="en">
    <link href="paparazzi.png" rel="icon">
        * {
            font-family: Helvetica;
            text-decoration: none;
        body {
            margin-left: 300px;
            margin-top: 100px;
            margin-right: 300px;
    <tr><td>Please Select</td><td></td></tr>
    <tr><td><?php echo $list ?></td></tr>


link at left-bottom show localhost:8888/Braclets.php?=Braclet

Then why can't $_GET get this strong "Bracelets"?

next page:



        $kids = $_GET['Kids'];

        echo $kids;

        $sql = $GaryDB->prepare("SELECT * FROM $kids");

        echo $sql;



Link to comment
Share on other sites

There is a reference in url already. I set up the loop in link like this:






then There is file name already - bracelets.php, earrings.php, kids.php, necklaces.php, and rings.php. So, $_GET should grab reference key from those string in URL, but it didn't. I think $_GET doesn't grab when it come with array. I used implode to convert array to string, but still not work.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...