I am currently working on a form that requires few fields to be filled by the user and few based on the selection made by the user on the previous page. The URL looks like below:
http://localhost:8080/series/dynamics/admin/cleanURL/post.php?subgroup=redapple&adverid=254427035
where redapple is the $_GET variable. However what I wd like the url to look like is ;
http://localhost:8080/series/dynamics/admin/cleanURL/post.php?adverid=254427035
i.e. no info about subgroup selection in the url. But still would like to have the subgroup field to be filled with the choice made by user.
My php looks like this:
<?php require('../config/connection.php');
if(isset($_POST['variable'])){
$values = mysqli_real_escape_string($dbc, $_POST['variable']);
$query = "SELECT * FROM prdct_categories WHERE product = '$values'";
$result = mysqli_query($dbc, $query);
$rand = rand(0, 1000000);
$html = '<ul>';
while($row = mysqli_fetch_assoc($result)){
$clickable_url = 'post.php?subgroup='.$row['subgroup'].'&advertid='.$rand;
$html .= '<li class="nav">';
$html .= '<a href="'. $clickable_url .'">'.$row['subgroup'].'</a>';
$html .= '</li>';
}
$html .='<ul/>';
echo $html;
mysqli_close($dbc);
}