473,378 Members | 1,134 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 13552
"NotGiven" <no****@nonegiven.net> wrote in message
news:2U****************@bignews3.bellsouth.net...
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****@nonegiven.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
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...
0
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...
12
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...
63
by: Aaron Ackerman | last post by:
What is the sytax for exiting a for loop in C#?
4
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. ...
73
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...
12
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
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.