Jump to content

[SOLVED] replace select box with listed urls populated by mysql


programguru

Recommended Posts

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>";
}

         $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.

         $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?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.