Can somebody please help me with this... I cant figure out how to make the ID stick with the $Link line... <? $queryPro = "select ID, Name from tabel where CID=".$rowCat["CID"]; $resultPro = mysql_db_query($dbname, $queryPro); $numrowsPro = mysql_num_rows($resultPro); for ($j = 0; $j<$numrowsPro; $j++) { $rowPro = mysql_fetch_array($resultPro); $ProName = $rowPro["Name"]; [B][COLOR="Red"]$Link = "index.php?ID=" ;[/COLOR][/B] ?> Code (markup):
That allmost did the job, but... The outcome looks like this... index.php?ID=Peter Hill But on my page I got it to call for a ID. if (($_GET['ID']) && (is_numeric($_GET['ID']))) { $userid = $_GET['ID']; Code (markup): How do I fix that... Either ways are good...
As I see it, you're looking to transfer the numerical ID (you're using 'is_numeric') and not the name of the user. Change the first part into $ProID = $rowPro["ID"]; $Link = "index.php?ID=".$ProID; Code (markup): That should do the trick, if I understand your intentions correctly.
See... I allready tryid that solution, but it doesn't seem to get the ID??? The link only gets "index.php?ID=". Any other sugestions?!? It's driving me crazy...
You'd have to take care of the space in the name first, if you want to transfer the name. Example In the first part $ProName = str_replace(" ", "%20", $rowPro["Name"]); PHP: Of course, you'd have to revert that if you want to use for comparison or echo'ing $userid = str_replace("%20", " ", $_GET['ID']); PHP: (You can obviously use any character you'd like in stead of %20) My first thought would be to check and see if the ID actually exists in the database, as I don't see any reason why it wouldn't be attached to the url...
Are you sure the code that is supposed to use '$userid' is set up to have the name and not the numerical ID? Is the name correctly placed in the url?