Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » Webmasters and Developers » Generating a HTTP POST request with dynamic contents
Search Topic:
Uniqs:
445
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
« webpage Printing - how to Format webpage content  
AuthorAll Replies


httppost

@microsoft.com

Generating a HTTP POST request with dynamic contents

I find the following code sample on how to generate a HTTP POST with multipart/form-data encoding; however, in my case, I won't know which parameters are available until runtime. For example, I may have only 'name' and 'email'. Is there a way I can work around it and provide a dynamic list of parameters? Thanks.



Jafo232
You Can't Spell Democrat Without Rat.
Premium
join:2002-10-17
Boonville, NY
·RoadRunner Cable

You mean something like this?

--
Custom PHP/Perl Development. Vbulletin And Wordpress Mods Too!


JAAulde
yum yum yum yum yum
Premium,MVM
join:2001-05-09
Hagerstown, MD
reply to httppost
We'll really need a little more context as to the data structures you'll be working with.


httppost

@sbcglobal.net
reply to httppost
No, I don't know how many items I will have for Content. For example, I may have "name" and "email" only, but "gender", "born" and "init" won't be available. The script need to be flexible enough to handle unknown number of contents.


Tenar

join:2008-01-02
Midland, ON
reply to httppost
Can you use a foreach loop and test for possible keys?


johnnyboyct

join:2003-06-11
Newington, CT
·Cox HSI

reply to httppost
You trying to do like facebook(i think) or something, click the link that then shows the next field if you want it? IE:
name:
Email:

link-add your address
link-add your website

If thats what your doing, Id just render them all to the page, just display:none, and give the fields the database column names so you could do a foreach like suggested. Something like


If the fields are dynamica nd the user can make them, its all in your db. There needs to be a table for form and then elements.

--
Connecticut Web Design and Development


Jafo232
You Can't Spell Democrat Without Rat.
Premium
join:2002-10-17
Boonville, NY
In the above example, don't forget to sanitize $k and $v..


johnnyboyct

join:2003-06-11
Newington, CT
reply to httppost
Yup and it would be $sql.=whatever or it would just keep rewriting.
-
Forums » Tech and Talk » OS and Software » Webmasters and Developers« webpage Printing - how to Format webpage content  


Wednesday, 09-Dec 18:06:36 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [198] Sprint Sued For Distracted Driving Death
· [99] AT&T Launching New 24 Mbps U-Verse Tier
· [81] 3G Network Test Says AT&T Is Tops
· [72] Mediacom Unveils 105 Mbps Pricing
· [66] Sprint Poised For A Turnaround?
· [63] WPA Cracker: Test WPA-PSK Networks In 20 Minutes
· [51] The Future Of Wi-Fi Is Bright
· [47] Site Leaks Yahoo, Verizon Fed Data Share Pricing
· [45] AT&T Hints At Usage-Based iPhone Data Pricing
· [44] Microwaving Your Innards Is Not 'Extreme'
Most people now reading
· MicroSoft Discontinues Sale of Windows 7 Family Pack in US [Microsoft Help]
· Is sleeping similar to being dead? [General Questions]
· whole house ups [Home Repair & Improvement]
· Man Downloads Child Porn "Accidentally," Faces 20 Years [Security]
· Windows 7 boot manager editing questions [Microsoft Help]
· [ Classes] ATTN Death Knights - Post your spec for critique! [World of Warcraft]
· Adobe Flash Player version 10.0.42.34 [Security]
· HoR, PoS and FoS [World of Warcraft]
· WTF? [Comcast HSI]
· TSN2 : Un rêve devenu réalité! [Videotron]