/    Sign up×
Community /Pin to ProfileBookmark

Allowing users to make changes to there stored information

currently when users log in and go to there profile page I there information stored to the data base is echo out to them which looks like this,

Username: jasonwhite
Phone: 888555999
Mobile: 999555888
E-mail: [email][email protected][/email]
Web: jason.com

I would like to make the
the username phone mobile email web names to be links and when you click these links it opens a field allowing the user to change the information stored in these rows on the data base. Then when changed and submitted the information to be viewed and the old information discarded. Currently I am set up with a login.php page calling the information upon login and the variables are set in this page. how would I go about doing this.

This is currently how the information is being echo on the profile page

<div id=”userinfo”>
<?php
echo “<p><b>Username: ” . $_SESSION[‘username’] . “</b><br>Phone: ” . $_SESSION[‘phone’] . “<br>Mobile: ” . $_SESSION[‘mobile’]. “<br>E-mail: ” . $_SESSION[’email’] . “<br>Web: ” . $_SESSION[‘web’]. “</p><hr>”;
?>
</div>

I am assuming I need to change this line calling the heading lables to be links and then send those links to a for page. this for page needs to change information.

can someone walk me through this. if so please tell me what files you need me to post and what changes I need to make to each line thanks.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NatdripAug 30.2012 — this should get you started

make sure you have the needed jquery library

you need to figure out the ajax calls for your self

[code=php]

<!DOCTYPE html >
<html>

<head>

<title>HTML Template</title>

<script src="/js/jquery-1.7.1.min.js"></script>
<script>
$(document).ready(function() {

$(document).on('click', '.inline', function(e){




var obj = $("<span />",{
class:'hover-dock'
});

var t = $('<input />',{
id:'bob',
value: $(this).text(),
type:'text'
})

var sb = $('<input />',{
id:'save',
value: 'save',
type:'button'
})

var cb = $('<input />',{
id: 'cancel',
value: 'cancel',
type: 'button',
class: 'cancel'
})


t.appendTo(obj);
sb.appendTo(obj);
cb.appendTo(obj);


$(this).replaceWith(obj);


})

//----------------->
$(document).on('click', '.cancel', function(e){

var obj = $("<span />",{
class: 'inline'
});

var val = $(this).parent().parent().attr('orgVal');

obj.html(val);


$(this).parent().replaceWith(obj);



})
//----------------->

//----------------->
$(document).on('click', '.save', function(e){

//put you ajax stuff here

})
//----------------->



})

</script>
</head>

<body>


<label for="fname" orgVal='jasonwhite'>Username :
<span class="inline" validator[]='required'>jasonwhite</span>
</label>
<br />
<label for="fname" orgVal='888555999'>Phone :
<span class="inline" validator[]='phone'>888555999</span>
</label>
<br />
<label for="fname" orgVal='999555888'>Mobile :
<span class="inline" validator[]='phone'>999555888</span>
</label>
<br />
<label for="fname" orgVal='[email protected]'>E-mail :
<span class="inline" validator[]='required,email'>[email protected]</span>
</label>
<br />
<label for="fname" orgVal='jason.com'>Web :
<span class="inline" validator[]=''>jason.com</span>
</label>


</body>
</html>


[/code]
×

Success!

Help @Nicholas_Diaz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...