Click here to Skip to main content
15,895,557 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
ive tried ?id/name = 'value' but it doesnt seem to work irrespective of how many variations i try.

Im working on something for my department, and they just require that i help generate a link for a form with an already prepopulated value for a drop down list to allow for easier view/access.


i checked out different forums and viewed various page sources sand it seems like the format ?id/name = 'value' is supposedly the way to go. So i made a dummy form to test/check if it really works and voila...it doesnt. Im really hoping you can help clarify this doubt.

Just for kicks this is the dummy dropdownlist/form i was toying with:


<html><header></header><body>

<select id = "list" >

<option value = " "
<option value = "Cake"> cake </option>
<option value = "Soap"> soap </option>
<option value = "table"> table</option>


</select>

</body></html>

and then i tried http/*directorylocation*/..?id=Soap

please can you help out with what im doing wrong??
Posted
Comments
Sergey Alexandrovich Kryukov 27-Apr-15 18:18pm    
Why would you re-populate form you are not hosting? Such solutions often mean abuse of technology...
—SA

1 solution

Please see my comment to the question.

Populating of such form is wrong approach. You don't want to populate anything, and if this is PHP used on the server side of your own Web site, you cannot do it, because you also don't "host" a Web browser which does this population. Isn't it logical?

The solution is: you have to realize that what you really want is not population of any UI. What you really want is to get the same effect as the Web browser user who populates and then submit a form, or send any other HTTP request.

If you realize that, you can easily (well, relatively easily) solve this problem. You just need to send appropriate HTTP request(s) using the PHP class HttpRequest:
http://php.net/manual/en/class.httprequest.php[^].

You might have some problems figuring out what exactly to send and what to expect in HTTP response. I can give you one "secret weapon". This could be any Web browser tool used to "spy" on HTTP request/response while experimenting with the site in question using some browser manually. This way, you can fetch all the detail and later mimic them in your HTTP request and the code handling your HTTP response. Such tool can be called "HttpFox" (Mozilla), "HTML Spy", and the like.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900