sever104 Posted July 23, 2007 Share Posted July 23, 2007 Anyone got a email change script for preferences.php? I would be pleased if you can post it here. +REP if you do ;) Quote Link to comment Share on other sites More sharing options...
Redeye Posted July 23, 2007 Share Posted July 23, 2007 Re: Email change for preferences.php goto preferences.php find [url='preferences.php?action=namechange']Name Change[/url] after this add <a href='preference.php?action=emailchange'>Email Adress Change Then find $h->endpage(); ?> Before it add function email_change() { global $ir,$c,$userid,$h; print "<h3>Email Change</h3> <form action='preferences.php?action=emailchange2' method='post'> New Email adress: <input type='text' name='newemail' /> <input type='submit' value='Change Email' /></form>"; } function do_email_change() { global $ir,$c,$userid,$h; if($_POST['newname'] == "") { print "You did not enter a new email. [url='preferences.php?action=emailchange']> Back[/url]"; } else { $_POST['email']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newemail']); mysql_query("UPDATE users SET email='{$_POST['email']}' WHERE userid=$userid",$c); print "Email changed!"; } } Quote Link to comment Share on other sites More sharing options...
Redeye Posted July 23, 2007 Share Posted July 23, 2007 Re: Email change for preferences.php I don't have a v.1 to experiment it on so if it don't work then tell me. p.s. I am not a very good modder and have learnt php just from CE Quote Link to comment Share on other sites More sharing options...
sever104 Posted July 23, 2007 Author Share Posted July 23, 2007 Re: Email change for preferences.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.php -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); switch($_GET['action']) { case 'sexchange2': do_sex_change(); break; case 'sexchange': conf_sex_change(); break; case 'passchange2': do_pass_change(); break; case 'passchange': pass_change(); break; case 'namechange2': do_name_change(); break; case 'namechange': name_change(); break; case 'picchange2': do_pic_change(); break; case 'picchange': pic_change(); break; default: prefs_home(); break; } function prefs_home() { global $ir,$c,$userid,$h; print "<h3>Preferences</h3> [url='preferences.php?action=sexchange']Sex Change[/url] [url='preferences.php?action=passchange']Password Change[/url] [url='preferences.php?action=namechange']Name Change[/url] [url='preferences.php?action=emailchange']Email Address Change[/url] [url='preferences.php?action=picchange']Display Pic Change[/url] "; } function conf_sex_change() { global $ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } print "Are you sure you want to become a $g? [url='preferences.php?action=sexchange2']Yes[/url] | [url='preferences.php']No[/url]"; } function do_sex_change() { global $ir,$c,$userid,$h; if($ir['gender'] == "Male") { $g="Female"; } else { $g="Male"; } mysql_query("UPDATE users SET gender='$g' WHERE userid=$userid",$c); print "Success, you are now $g! [url='preferences.php']Back[/url]"; } function pass_change() { global $ir,$c,$userid,$h; print "<h3>Password Change</h3><form action='preferences.php?action=passchange2' method='post'>Current Password: <input type='password' name='oldpw' /> New Password: <input type='password' name='newpw' /> Confirm: <input type='password' name='newpw2' /> <input type='submit' value='Change PW' /></form>"; } function do_pass_change() { global $ir,$c,$userid,$h; if(md5($_POST['oldpw']) != $ir['userpass']) { print "The current password you entered was wrong. [url='preferences.php?action=passchange']> Back[/url]"; } else if($_POST['newpw'] !== $_POST['newpw2']) { print "The new passwords you entered did not match! [url='preferences.php?action=passchange']> Back[/url]"; } else { mysql_query("UPDATE users SET userpass=md5('{$_POST['newpw']}') WHERE userid=$userid",$c); print "Password changed!"; } } function name_change() { global $ir,$c,$userid,$h; print "<h3>Name Change</h3> <font size=3 color=yellow> If Your Username Contains Special Characters Then Your Account Will Be Fedded For 25 Days! Anything That Is Not On The Standard UK Keyboard [b]- ™ ® ë ø ç -[/b] etc, Is Not Permitted! (NOTE: Please DO NOT use ' in your name either, thank you.)</font> Please note that you still use the same name to login, this procedure simply changes the name that is displayed.<form action='preferences.php?action=namechange2' method='post'> New Name: <input type='text' name='newname' /> <input type='submit' value='Change Name' /></form>"; } function do_name_change() { global $ir,$c,$userid,$h; if($_POST['newname'] == "") { print "You did not enter a new name. [url='preferences.php?action=namechange']> Back[/url]"; } else { $_POST['newname']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newname']); mysql_query("UPDATE users SET username='{$_POST['newname']}' WHERE userid=$userid",$c); print "Username changed!"; } } function pic_change() { global $ir,$c,$userid,$h; print "<h3>Pic Change</h3> Please note that this must be externally hosted, [url='http://imageshack.us']ImageShack[/url] is our recommendation. Any images that are not 150x150 will be automatically resized <form action='preferences.php?action=picchange2' method='post'> New Pic: <input type='text' name='newpic' value='{$ir['display_pic']}' /> <input type='submit' value='Change Name' /></form>"; } function do_pic_change() { global $ir,$c,$userid,$h; if($_POST['newpic'] == "") { print "You did not enter a new pic. [url='preferences.php?action=picchange']> Back[/url]"; } else { $_POST['newpic']=str_replace('\\\'',''', $_POST['newpic']); mysql_query("UPDATE users SET display_pic='{$_POST['newpic']}' WHERE userid=$userid",$c); print "Pic changed!"; } function email_change() { global $ir,$c,$userid,$h; print "<h3>Email Change</h3> <form action='preferences.php?action=emailchange2' method='post'> New Email adress: <input type='text' name='newemail' /> <input type='submit' value='Change Email' /></form>"; } function do_email_change() { global $ir,$c,$userid,$h; if($_POST['newname'] == "") { print "You did not enter a new email. [url='preferences.php?action=emailchange']> Back[/url]"; } else { $_POST['email']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newemail']); mysql_query("UPDATE users SET email='{$_POST['email']}' WHERE userid=$userid",$c); print "Email changed!"; } } $h->endpage(); ?> I get this error: Parse error: syntax error, unexpected $end in /home/ie3/public_html/public_html/preferences.php on line 190 Could you post full preferences.php ;) Quote Link to comment Share on other sites More sharing options...
Redeye Posted July 23, 2007 Share Posted July 23, 2007 Re: Email change for preferences.php oppps my mistake, I will post the right one now Quote Link to comment Share on other sites More sharing options...
Redeye Posted July 23, 2007 Share Posted July 23, 2007 Re: Email change for preferences.php goto preferences.php find [url='preferences.php?action=namechange']Name Change[/url] after this add <a href='preference.php?action=emailchange'>Email Adress Change Then find $h->endpage(); ?> Before it add function email_change() { global $ir,$c,$userid,$h; print "<h3>Email Change</h3> <form action='preferences.php?action=emailchange2' method='post'> New Email adress: <input type='text' name='newemail' /> <input type='submit' value='Change Email' /></form>"; } function do_email_change() { global $ir,$c,$userid,$h; if($_POST['newname'] == "") { print "You did not enter a new email. [url='preferences.php?action=emailchange']> Back[/url]"; } else { $_POST['newemail']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newemail']); mysql_query("UPDATE users SET email='{$_POST['newemail']}' WHERE userid=$userid",$c); print "Email changed!"; } } Quote Link to comment Share on other sites More sharing options...
sever104 Posted July 23, 2007 Author Share Posted July 23, 2007 Re: Email change for preferences.php I no longer get an error by when I click Email Address Change it doesn't lead to anything just basicly refreshs the page! Quote Link to comment Share on other sites More sharing options...
iseeyou94056 Posted July 23, 2007 Share Posted July 23, 2007 Re: Email change for preferences.php takes me to page cannot be displayed Quote Link to comment Share on other sites More sharing options...
seanybob Posted July 23, 2007 Share Posted July 23, 2007 Re: Email change for preferences.php goto preferences.php find [url='preferences.php?action=namechange']Name Change[/url] after this add [url='preferences.php?action=emailchange']Email Adress Change[/url] find case 'passchange': pass_change(); break; after it add case 'emailchange2': do_email_change(); break; case 'emailchange': email_change(); break; Then find $h->endpage(); ?> Before it add function email_change() { global $ir,$c,$userid,$h; print "<h3>Email Change</h3> <form action='preferences.php?action=emailchange2' method='post'> New email address: <input type='text' name='newemail' /> <input type='submit' value='Change Email' /></form>"; } function do_email_change() { global $ir,$c,$userid,$h; if($_POST['newemail'] == "") { print "You did not enter a new email. [url='preferences.php?action=emailchange']> Back[/url]"; } else { $_POST['newemail']=str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['newemail']); mysql_query("UPDATE users SET email='{$_POST['newemail']}' WHERE userid=$userid",$c); print "Email changed!"; } } Quote Link to comment Share on other sites More sharing options...
iseeyou94056 Posted July 24, 2007 Share Posted July 24, 2007 Re: Email change for preferences.php still does same thing Quote Link to comment Share on other sites More sharing options...
seanybob Posted July 24, 2007 Share Posted July 24, 2007 Re: Email change for preferences.php still does same thing fixed. He forgot the "s" in his preferences link. My post is updated. Quote Link to comment Share on other sites More sharing options...
assassincity[dot]com Posted July 24, 2007 Share Posted July 24, 2007 Re: Email change for preferences.php Fatal error: Call to undefined function email_change() in /home/ie3/public_html/preferences.php on line 48 Quote Link to comment Share on other sites More sharing options...
John99 Posted July 25, 2007 Share Posted July 25, 2007 Re: Email change for preferences.php OK here you go! find: case 'namechange2': do_name_change(); break; case 'namechange': name_change(); break; After add: case 'email': email_change(); break; case 'emailsub': email_change_sub(); break; Now find: [url='preferences.php?action=namechange']Name Change[/url] Afetr add: [url='preferences.php?action=email']Email Change[/url] Now find: $h->endpage(); ?> Before that add: function email_change() { global $ir,$c,$userid,$h; print "<h3><u>Email Change</u></h3> Your game email address if the game needs to contact you about your acount.<form action='preferences.php?action=emailsub' method='post'> Your current game email is: {$ir['email']} Email: <input type='text' name='email' /> <input type='submit' value='Change Email' /></form> [url='preferences.php']> Back[/url]"; } function email_change_sub() { global $ir,$c,$userid,$h; mysql_query("UPDATE users SET email='{$_POST['email']}' WHERE userid=$userid",$c); print "Game Email Changed! [url='preferences.php']> Back[/url]"; } Simple lol Quote Link to comment Share on other sites More sharing options...
3XTR3M3 Posted July 27, 2007 Share Posted July 27, 2007 Re: Email change for preferences.php na seany bobs does work i did what it says and it works must be sever104 Quote Link to comment Share on other sites More sharing options...
coder1 Posted October 23, 2007 Share Posted October 23, 2007 Re: Email change for preferences.php i did it like senny bob said it works fine Quote Link to comment Share on other sites More sharing options...
Satans_Pimp Posted October 23, 2007 Share Posted October 23, 2007 Re: Email change for preferences.php i get a error on Parse error: syntax error, unexpected '<' in /home/suburba2/public_html/criminal-insanity/preferences.php on line 176 that line is <input type='submit' value='Change Email' /></form>"; any help thanks Quote Link to comment Share on other sites More sharing options...
Klikoka Posted October 24, 2007 Share Posted October 24, 2007 Re: Email change for preferences.php For V1 Or V2? Satans_Pimp Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted October 24, 2007 Share Posted October 24, 2007 Re: Email change for preferences.php replace it with... <input type='submit' value='Change Email' /></form> [url='preferences.php']> Back[/url]"; Quote Link to comment Share on other sites More sharing options...
Klikoka Posted October 24, 2007 Share Posted October 24, 2007 Re: Email change for preferences.php Oh Yeh That'll Be Right:) Quote Link to comment Share on other sites More sharing options...
Guest Anonymous Posted October 24, 2007 Share Posted October 24, 2007 Re: Email change for preferences.php al so if some one press the submit with out a email typed in it brakes your account Quote Link to comment Share on other sites More sharing options...
Klikoka Posted October 24, 2007 Share Posted October 24, 2007 Re: Email change for preferences.php Thats A Big Bug :? Quote Link to comment Share on other sites More sharing options...
Klikoka Posted October 24, 2007 Share Posted October 24, 2007 Re: Email change for preferences.php Could Work Quote Link to comment Share on other sites More sharing options...
HITMAN 17 Posted November 23, 2007 Share Posted November 23, 2007 Re: Email change for preferences.php it wud be better if it had current email address unless it already does Quote Link to comment Share on other sites More sharing options...
josh-j-c Posted March 31, 2008 Share Posted March 31, 2008 Re: Email change for preferences.php Can i just say this isnt the best idea ive seen, wouldnt be too clever if say one of your accounts was hacked because what about forgot password ect if you used it... i mean id be pritty pissed if i couldnt retrieve my password and couldnt log on because i got my account hacked majour and i could NEVER get it back again, catch ma drift... Anywayz peace out! :-D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.