473,594 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to loop through POST variables and contents

I am looking for a standard way/function to loop through all POST variables
and their respective contents to update a database record.

Here's my ideal to pass a function and it update:
session variable - "ID" - that holds the record ID to update
$_POST or $HTTP_POST_VARS

The function would update the $_POST vaiables of the ID record with the
$_POST variable's contents.

Thanks for any help or links to info!
Jul 17 '05 #1
2 13570
"NotGiven" <no****@nonegiv en.net> wrote in message
news:2U******** ********@bignew s3.bellsouth.ne t...
I am looking for a standard way/function to loop through all POST variables and their respective contents to update a database record.

Here's my ideal to pass a function and it update:
session variable - "ID" - that holds the record ID to update
$_POST or $HTTP_POST_VARS

The function would update the $_POST vaiables of the ID record with the
$_POST variable's contents.

Thanks for any help or links to info!


check out
http://gzen.myhq.info/postchk.php

and

http://gzen.myhq.info/snippetview.php?v=dumpvar.php

--
Mike Bradley
http://gzen.myhq.info -- free online php tools
Jul 17 '05 #2
NotGiven <no****@nonegiv en.net> wrote:
I am looking for a standard way/function to loop through all POST variables
and their respective contents to update a database record.

Here's my ideal to pass a function and it update:
session variable - "ID" - that holds the record ID to update
$_POST or $HTTP_POST_VARS

The function would update the $_POST vaiables of the ID record with the
$_POST variable's contents.


Use a foreach($_POST as $key => $value) block, inthere you can construct
2 strings, one containins the keys van one the (escaped) values
in the correct format for an insert statement (insert into $table
($keys) values ($values)).

One problem you are going to run into is the differenve between numeric
and string values in the talbe (you could fix that with a switch but
you'd have to know what is what in thew table).

--

Daniel Tryba

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2422
by: Steve Macleod | last post by:
Hi there, Newbie at this, so here goes: I am attempting to build a page that updates multiple records. The page uses as its input, a series of dynamically generated text boxes from the previous page (through POST variables) The text boxes on the previous page are named as follows:
0
2549
by: Kingdom | last post by:
I Need some serious help here. strugling novis with ASP and javascript any help would be greatly appreciated The script below does exactly what I want it to do for each product on the two passes it makes however I would like the entire script to loop 34 times and on each of those 30 loops also write the product and the price (only) onto the page building a compleate list of all the products selected over the 34 loops ending with a total...
12
4888
by: reynoldscraigr | last post by:
Hi All, hope someone can see what wrong here I have the following function function RemoveMenuFromHoldArray(menuName) { var i = 0; for (i=0;i<=MenusToHoldOpen.length-1;i++) { if (MenusToHoldOpen == menuName) { MenusToHoldOpen.splice(i,1); return;
63
3153
by: Aaron Ackerman | last post by:
What is the sytax for exiting a for loop in C#?
4
3149
by: James Johnson | last post by:
Dear C#Dex, I am trying to automate a POST to a web page that clicks a button. I have been able to hit a target web page and run the web page. However, the button on the page does not click. I can set the target web page to change to a new URL when I hit it, and that works, but I cannot get the button to click based on my POST command. Is there some secret to clicking the button? I have a button named btnGo and I set the value of...
73
4580
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an endless loop in a line with: if a==b: print 'OK' I mean, it would be of much help to me on my way to understanding Python to know how such prefix code leading to an endless loop can look like and if it is eventually not possible to write such...
12
3075
by: Mark E. Fenner | last post by:
Hello all, I have a code where my inner loop looks like: allNew = for params in cases: newObj = copy(initialObject) newObj.modify(params) allNew.append(newObj) return allNew
2
3219
by: recordlovelife | last post by:
So I am trying to display a title, date, and content of a wordpress blog. Word press provides nice drop in functions to get the job done with simple names like "the_title", and the "the_content" But on the homepage of a site, i wanted to truncate the content to like the first 75 characters and then put "..." (a perfect use of the smarty "truncate" modifier) and then give the visitor a link to read the whole article. But since "the_content" is a...
1
6008
by: jerry | last post by:
i have written a simple phonebook program,i'll show you some of the codes,the program's head file is member.h . i suppose the head file works well.so i don't post it. here's the clips of main function which i think has problem // this a simple program about phonebook,it can add items,del items,find items and #include "member.h" #include <fstream> #include <vector>
0
7954
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6669
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5836
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5415
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3871
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1487
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.