Jump to content

Allow user to change email


siftyzod

Recommended Posts

this is the sample code for the html part....

<form name="frm1" method="post" action="#">
<label for="email">change email</label><input type="email" name="new_email" value="">
<input type="submit" name="submit" value="change email">
php part

 

<?php 
require_once("connect.php");
if(isset($_POST['submit']))
$sql="UPDATE email=$new_email FROM tb_name WHERE username=$username";
mysql_query($sql);
echo "email successfully updated";

?>

note: thats just a sample script...

if you want to use this you need to modify it

good luck bro :)

Lol i have decided its way over my head ... i think i will stick to my little bars i can add in at the moment and let someone else do this .. cause i dont even understand what any of php code does i just copy and paste and play till it works :) cheers anyway

<form name="frm1" method="post"
action="#">
<label for="email">change email</
label><input type="email" name="
new_email" value="">
<input type="submit" name="submit
" value="change email">

//am sure you understand the html part
……………………………………………………………………

php part

<?php
require_once("connect.php"); 
//this include your database connection

if(isset($_POST['submit']))
//check if the submit button is being clicked
//if the submit button is clicked, the following code will run

$sql="UPDATE email=$new_email
FROM tb_name WHERE username=$
username";
//set a query to select and update the database and store it in a variable called $sql at the left

mysql_query($sql);
//send the query above to the database

echo "email successfully updated
";
//print some text out to the browser after updating the database
?>
<form name="frm1" method="post"
action="#">
<label for="email">change email</
label><input type="email" name="
new_email" value="">
<input type="submit" name="submit
" value="change email">

//am sure you understand the html part
……………………………………………………………………

php part

<?php
require_once("connect.php"); 
//this include your database connection

if(isset($_POST['submit']))
//check if the submit button is being clicked
//if the submit button is clicked, the following code will run

$sql="UPDATE email=$new_email
FROM tb_name WHERE username=$
username";
//set a query to select and update the database and store it in a variable called $sql at the left

mysql_query($sql);
//send the query above to the database

echo "email successfully updated
";
//print some text out to the browser after updating the database
?>

lol i understand none of it ... i did my first php boarder bar thingee today and took me 2hrs to get it to work ... i have never worked on a website before 

then i advice you to start learning programming @w3chools.com

dont really think its something i can learn to do ...its way to much to remember ... i dont even remember what day it is half the time .... i think i will just leave the coding to people who know what they are doing :) im to old to start learning this kind of stuff 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.