Hello all. Originally I have got this: <a href=\"musicvideo.php?vid=".$row['uniq_id']."\">".$row['video_title']."</a> PHP: and on musicvideo.php $unique_id = magicSlashes($_GET['vid']); if(!empty($unique_id) && strlen($unique_id) < '10') { $get_vid = mysql_query("SELECT * FROM pm_videos WHERE uniq_id = '".$unique_id."'"); $get_vid = mysql_fetch_array($get_vid); PHP: Now I want to add .$row['video_title']. PHP: after vid=".$row['uniq_id']." PHP: so the link can be musicvideo.php?vid=0111-titleof the video I did like this: <a href=\"musicvideo.php?vid=".$row['uniq_id']."-".$row['video_title']."\">".$row['video_title']."</a> PHP: url looks ok on the listing page but does not work. Do i need to do anything on musicvideo.php $unique_id = magicSlashes($_GET['vid']); if(!empty($unique_id) && strlen($unique_id) < '10') { $get_vid = mysql_query("SELECT * FROM pm_videos WHERE uniq_id = '".$unique_id."'"); $get_vid = mysql_fetch_array($get_vid); PHP: Thank you very much
you might want to use either <a href=\"musicvideo.php?vid=".$row['uniq_id']."&title=".$row['video_title']."\">".$row['video_title']."</a> Code (markup): or use intval() around the ID that is being passed. $unique_id = magicSlashes(intval($_GET['vid'])); Code (markup): Why you would want to do the title and ID together I dont know.
if you are expecting an integer $unique_id=sprintf('%d',$_GET['vid']); Code (php): if it is a string or character <a href=\"musicvideo.php?vid=".$row['uniq_id']."&t=".$row['video_title']."\">".$row['video_title']."</a> Code (php):
Uh, you might want to be looking at mod_rewrite. Really, thats not going to make a lot of difference.
Then this is not what you want, as said above, read up on mod rewrite. You looking to have either subfolders or clean .html pages. i.e. instead of <a href=\"musicvideo.php?vid=".$row['uniq_id']."&title=".$row['video_title']."\">".$row['video_title']."</a> Code (markup): you would have (musicvideo/1/Videoname/) <a href=\"musicvideo/".$row['uniq_id']."/".$row['video_title']."/\">".$row['video_title']."</a> Code (markup): or (musicvideo/1/Videoname.html) <a href=\"musicvideo/".$row['uniq_id']."/".$row['video_title'].".html\">".$row['video_title']."</a> Code (markup): you would need .htaccess entries to manage these values (you will understand this when you read up on Mod Rewrite.