I passed two parameters in the URL. Now I need to retrieve the parameters log_id and dogID onto the next page to process a form.
But I can retrieve the first parameter but i cannot retrieve the second parameter.

Im using

    $log_id= $_SESSION["userid"]; 
    $dogID = $_SESSION["dogID"]; 

Is there another way to get this?

Edited by happygeek: moved

6 Months
Discussion Span
Last Post by abubaker_2

Hello there

The previous step was this to get to the other page

echo("<br /><a class='controls1' href='dogReview.php?u=$username&&dogID=$dogID'><h3>Add Your Review</h3></a>");

I tried using this as well but nothing seems to work..

$dogID = $_GET["dogID"];


that still doesnt seem to work
I keep getting the error:

Column 'dog_reviewed' cannot be null.

My code to insert into the db is :
if($stmt = mysqli_prepare($mysqli,"INSERT INTO DOG_REVIEW(dog_reviewed,id,disciplineComments, challengesFaced,comments,Temperament,healthConcerns)VALUES(?, ?, ?, ?, ?, ?, ?)"))

Where im getting the values from the url for the dog (dog_reviewed) thats being reviewed, and the user(id) that is revewing.

Am I missing something? Or doing this completly wrong?

Im new to php and learning as I go along.


Am I missing something? Or doing this completly wrong?

It's difficult to say because I don't see the current code you are using. On top of dogReview.php page, right after session_start() set var_dump() to show $_GET and $_SESSION contents:

echo "<pre>";
var_dump($_GET, $_SESSION);
echo "</pre>";

You should be able to see what is sent through the GET request (appending the parameters to the url) and the contents of the current session. If it does not help show the code of this page.


How about when you get to your page dogReview.php
the u=$username and the dogID the should show the current value of the up in the brower url

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.