14, February 2012
updateUser funtion - webmaster forum
Navigation
Webdigity Services
Pagerank Monitor
Whois Tool
Web Design Gallery
Webmaster Forums
Webmaster Directory
Tutorials Database
Webmaster Forums
WebDigity Community
Topsites network news ...
Forum Contests
Forum Lounge
New Member Introductions
Tech News
User Forums
aStatSpam forum
Computers
3rd-Party Scripting
Leet Link Directory
The 100 Lists Website ...
Design and Layout
Newbie webmaster
Graphics & Multimedia
Adobe Photoshop
Macromedia Flash & Act...
Web Page Design
HTML & XHTML
CSS
Accesibility issues
Website & Graphic Revi...
Web Development
PhP
ASP & .NET
Java & JSP
Official Java News
JavaScript
XML - XSLT
Databases
MySQL
Security
Web hosting talk
Hosting companies
Domain names
Configuring your server
Apache web server
Marketing your site
CPC programs
Chitika eMiniMalls
CPM programs
Affiliate programs & o...
Web site promotion
Promotion techniques
Search Engine Optimiza...
Google SEO
Promoting & building a...
Marketplace
Advertise your services
Sell your site
Sell a domain name
Request services
Hire people
Link trading requests
[
Home
|
Help
|
Search
|
Forum's Shop
|
Archive
|
Login
|
Register
|
Webmaster Directory
]
Web
www.webdigity.com
Hide the search bar
Whois database search :
Domain :
Use the whois database tool to retrieve information on any top level domain you are interested in.
Webdigity Webmaster Forums
>
Web Development
>
PhP
>
Php User Class
Topic:
updateUser funtion
« previous
next »
Pages: [
1
]
Author
Topic: updateUser funtion (Read 2036 times)
Google dot what?
Posts: 2
16 credits
Members referred : 0
«
on:
Oct 17, 2008, 08:51:22 pm »
I've made a function to update the user data.
Code:
<?php
/*
* Updates an user account. The array should have the form 'database field' => 'value'
* @param array $data
* return int
*/
function
updateUser
(
$data
) {
if (!
is_array
(
$data
))
$this
->
error
(
'Data is not an array'
,
__LINE__
);
$setpart
=
""
;
foreach (
$data
as
$k
=>
$v
) {
if (
$k
!=
'pass'
) {
$setpart
.=
"`
$k
` = '"
.
$this
->
escape
(
$v
).
"', "
;
} else {
switch(
strtolower
(
$this
->
passMethod
)) {
case
'sha1'
:
$password
=
"SHA1('"
.
$data
[
$this
->
tbFields
[
'pass'
]].
"')"
; break;
case
'md5'
:
$password
=
"MD5('"
.
$data
[
$this
->
tbFields
[
'pass'
]].
"')"
; break;
case
'nothing'
:
$password
=
$data
[
$this
->
tbFields
[
'pass'
]];
}
$setpart
.=
"`
$k
` =
$password
, "
;
}
}
$setpart
=
substr
(
$setpart
,
0
, -
2
);
return (
$this
->
query
(
"UPDATE `
{
$this
->
dbTable
}
` SET
$setpart
WHERE `
{
$this
->
tbFields
[
'userID'
]}
` = '"
.
$this
->
escape
(
$this
->
userID
).
"' LIMIT 1"
));
}
?>
«
Last Edit: Oct 17, 2008, 10:46:27 pm by lordt
»
I am a metal monkey!
Administrator
Community Supporter
?
Jedai Sword Master
Gender:
Posts: 5779
46271 credits
Members referred : 3
«
Reply #1 on:
Oct 17, 2008, 11:29:48 pm »
Thanks for your contribution lordt and welcome to webdigity
In the next version I will combine your code with another user contribution
Trial and Error my two best teachers
Join us @ facebook
or
twitter
Last blog :
Butterfly Marketing 2.0
OMG!I am geek
Gender:
Posts: 50
312 credits
Members referred : 0
in a world of php
«
Reply #2 on:
Oct 18, 2008, 08:45:58 am »
looks close to the same as the updateProperty function posted
here
, does it do anything different or just a cleaner code?
Google dot what?
Posts: 2
16 credits
Members referred : 0
«
Reply #3 on:
Oct 19, 2008, 10:37:10 pm »
Quote from: toy17s on Oct 18, 2008, 08:45:58 am
looks close to the same as the updateProperty function posted
here
, does it do anything different or just a cleaner code?
I just did it before to discover the other function. I don't know which of them is better.
Trackback URI for this entry :
http://www.webdigity.com/trackback.php?topic=8100
Tags :
php
updateUser
Bookmark this thread :
Digg
Del.icio.us
Dzone
more....
Pages: [
1
]
Webdigity Webmaster Forums
>
Web Development
>
PhP
>
Php User Class
Topic:
updateUser funtion
« previous
next »
Jump to:
=>Personal Messages
=>My Subscriptions
=>Profile Settings
=>Account Settings
=>Look and Layout Settings
=>Unread Posts
=>Unread Replies To My Posts
=>Affiliate Program
=>Forum's Shop
=>Arcade
Category: WebDigity Community
=> HumanWorks network news & feedback
===> Clickbank Contextual Script Support
=> Forum Contests
=> Forum Lounge
===> New Member Introductions
===> Tech News
===> Google Forum
=> User Forums
Category: Design and Layout
=> General webmaster discussions
=> Graphics & Multimedia
===> Adobe Photoshop
===> Macromedia Flash & Actionscript
=> Web Page Design
===> HTML & XHTML
===> CSS
===> Accesibility issues
=> Website & Graphic Reviews
Category: Web Development
=> PhP
===> PHP classes @finalwebsites.com
=====> Easy PHP Upload
=====> Access_user Class
=====> Validate_fields Class
=====> DB_cart Class
=====> Miscellaneous scripts or snippets
=====> PHP Whois script
=====> 3rd party modifications
===> Php User Class
=> JavaScript
=> Databases
===> MySQL
=> Security
=> Miscellaneous Languages
===> ASP & .NET
===> Java & JSP
=====> Official Java News
Category: Web hosting talk
=> Hosting companies
=> Domain names
=> Configuring your server
===> Apache web server
Category: Monetizing your site
=> General Business
=> CPC programs
===> Adsense
===> Chitika eMiniMalls
=====> Official news from Chitika
=====> Ad placement reviews
=====> eMiniMalls feedback and suggestions
=> CPM programs
=> Affiliate programs & other revenue models
Category: Web site promotion
=> Promotion techniques
=> Search Engine Optimization
===> Google SEO
=> Promoting & building a forum
===> SMF moding & promoting
Category: Marketplace
=> Advertise your services
===> Web Hosting Deals
=> Sell your site
=> Sell a domain name
=> Request services
=> Hire people
=> Link trading requests
User Area
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
Feb 14, 2012, 04:56:57 pm
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Donate to our community, and get a permanent link back to your site!
Forum Statistics
Total Posts:
59.828
Total Topics:
10.615
Total Members:
19.623
Tutorials
:
58
Resources
:
929
Designs
:
395
Latest Member:
hpink
106 Guests, 3 Users online :
Googlebot
,
zeropid
,
hpink
45 users online today:
hpink
,
zeropid
,
venitaramento
,
hintman
,
avasheshid1
,
SamyJones
,
juanhazelgrove
,
tagreplica
,
nuruzzaman
,
htghd01
,
tenglang-trade.com
,
shippu
,
johnsander
,
shaunshenker
,
Nikolas
,
guccihe
,
yiyi
,
sweetvalentine
,
agelore
,
alishakcarter
,
ankeyreneh
,
markitafulker
,
eprocaccnath
,
malvinawatrous
,
rachaelmills
,
preefide
,
file4sharing
,
Tracy Portner
,
alyshaprinceval
,
ednalanasa
,
yuettekaizer
,
deandreafaubus
,
skejerr
,
makedaschoonove
,
tandiono
,
dorothabachhube
,
alenastigger
,
retaschieber
,
1commonthread
,
Denis
,
SecuredServers
,
pandrews
,
Fisa
,
WebTalent
,
bernarder
Recent topics
Quality Stable VPS::Free F...
Re: Do You Do "FORUM&q...
Re: 10 ways to promote your...
Re: Free and paid advertisi...
Re: list of DOFOLLOW FORUMS...
Re: what brand is your cell...
Re: File4Sharing.com- 50$/1...
hello everyone!
HumanWorks Network
Technology news
Webmaster articles
Sublime web directory
RSS Feed directory and viewer
Web Design Gallery
·
Whois Lookup
·
Pagerank
·
Tag Browsing
·
Lo-fi version
·
Syndication
·
Webmaster forum history
·
Advertise
Developed by
HumanWorks
© 2005 - 2012
Webdigity webmaster community
·
sublime directory
Webdigity Webmaster Forums | Powered by
SMF 1.0.12
. © 2001-2005,
Lewis Media
. All Rights Reserved.