programguru Posted January 30, 2009 Share Posted January 30, 2009 i am creating a simple query which you can see below and it is working perfect. but i have been searching for a tutorial on replacing the with with a link based result, so the results would display like: record 1 record 2 etc... Of course each url would need to hold the "id". any suggestions or a tutorial on this? i have searched google and php.net, and have been unable to find specifically what i am looking for! SOS $option_block .= "<option value=\"$id\">$date, $title</option>"; } $display_block = "<form method=\"post\" action=\"review_edit_special.php\"> <select name=\"id\"> $option_block </select> <input type=\"submit\" name=\"submit\" value=\"Edit Record\"> </form>"; } Link to comment https://forums.phpfreaks.com/topic/143168-solved-replace-select-box-with-listed-urls-populated-by-mysql/ Share on other sites More sharing options...
gaza165 Posted January 30, 2009 Share Posted January 30, 2009 what data are you trying to turn into a link?? Link to comment https://forums.phpfreaks.com/topic/143168-solved-replace-select-box-with-listed-urls-populated-by-mysql/#findComment-750873 Share on other sites More sharing options...
premiso Posted January 30, 2009 Share Posted January 30, 2009 $option_block .= '<a href="http://yoursite.com/script.php?id=' . $id . '">Record ' . $id . '</a><br />'; } $display_block = "Choose a record<br />$option_block"; } Should do it, without seeing the rest of the code, I cannot guarantee that will work. Link to comment https://forums.phpfreaks.com/topic/143168-solved-replace-select-box-with-listed-urls-populated-by-mysql/#findComment-750874 Share on other sites More sharing options...
programguru Posted January 30, 2009 Author Share Posted January 30, 2009 $option_block .= '<a href="http://yoursite.com/script.php?id=' . $id . '">Record ' . $id . '</a><br />'; } $display_block = "Choose a record<br />$option_block"; } Should do it, without seeing the rest of the code, I cannot guarantee that will work. Premiso, that worked very well. now my only other question is i would not like the ID to display in the browser url bar. i have tried using post, but since it's being passed in the url, i think get[] is my only option. is there quick way around this? Link to comment https://forums.phpfreaks.com/topic/143168-solved-replace-select-box-with-listed-urls-populated-by-mysql/#findComment-750893 Share on other sites More sharing options...
programguru Posted January 30, 2009 Author Share Posted January 30, 2009 Still wondering about my last question... Just trying to find a way to bury the id form the URL, so it does not display. Link to comment https://forums.phpfreaks.com/topic/143168-solved-replace-select-box-with-listed-urls-populated-by-mysql/#findComment-750955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.