Jump to content

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


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?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.