Current location: Hot Scripts Forums » Advertising Forums » Job Offers & Assistance » php scripting needed


php scripting needed

Reply
  #1 (permalink)  
Old 07-17-10, 12:58 PM
jonny3010 jonny3010 is offline
New Member
 
Join Date: Jul 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy php scripting needed

hi ive got this change password script but i want it so change a memo value in the database instead of password plus no confirm and old password filed just one box that will change the the memo value in the data base please.

Heres the script i need changing please

Code:
<?php
session_start();
$error_message = "";
if(!isset($_SESSION['username']))
{
   $error_message = 'Not logged in!';
}
else
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
   $action = isset($_POST['action']) ? $_POST['action'] : '';
   $mysql_server = '77.68.105.107';
   $mysql_username = '*********';
   $mysql_password = '******';
   $mysql_database = '*******';
   $mysql_table = 'USERS';
   $success_page = './index.php';

   if ($action == 'changepassword')
   {
      $password_value = md5($_POST['password']);
      $newpassword = md5($_POST['newpassword']);
      $confirmpassword = md5($_POST['confirmpassword']);
      $username_value = $_SESSION['username'];
      if ($newpassword != $confirmpassword)
      {
         $error_message = 'The confirm new password must match the new password entry';
      }
      else
      if (!ereg("^[A-Za-z0-9_!@$]{1,50}$", $newpassword))
      {
         $error_message = 'New password is not valid, please check and try again!';
      }
      else
      {
         $db = mysql_connect($mysql_server, $mysql_username, $mysql_password);
         mysql_select_db($mysql_database, $db);
         $sql = "SELECT password FROM ".$mysql_table." WHERE username = '".$username_value."'";
         $result = mysql_query($sql, $db);
         if ($data = mysql_fetch_array($result))
         {
            if ($password_value == $data['password'])
            {
               $sql = "UPDATE `".$mysql_table."` SET `password` = '$newpassword' WHERE `username` = '$username_value'";
               mysql_query($sql, $db);
            }
            else
            {
               $error_message = 'Old password is not valid!';
            }
         }
         mysql_close($db);
         if (empty($error_message))
         {
            header('Location: '.$success_page);
            exit;
         }
      }
   }
}
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-27-10, 01:02 AM
penguinwebsoft penguinwebsoft is offline
Newbie Coder
 
Join Date: Jul 2010
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
hi

Hi,

We are a leading website company based in India.We can do the work for you.

Email me back with details and budget for the work.

penguinwebsoft@gmail.com

Thanks,
Penguin Websoft
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-22-10, 06:47 PM
newal3ab newal3ab is offline
New Member
 
Join Date: Aug 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
you should study php well

Last edited by UnrealEd; 08-22-10 at 07:05 PM. Reason: removed link
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-23-10, 12:45 PM
Golith Golith is offline
Newbie Coder
 
Join Date: Jun 2010
Posts: 87
Thanks: 6
Thanked 1 Time in 1 Post
[UR request is a little blurry

But if your looking to chage a value in "memo" ? Memory : "huh" .. lol .. soz .. then a function that returns a value would be an approach as it wont update the Db.

Is this what you are asking?
__________________
Its My script and I'll if I want to
www.cictradinggroup.com.au
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sports Pick Em racingboy20 Script Requests 3 06-18-10 04:12 AM
PHP & MySQL Developer Needed comentum Job Offers & Assistance 0 01-03-10 08:29 PM
How can I replicate PHP scripting? daniellemarie Job Offers & Assistance 1 08-02-09 11:12 AM
Basic php help needed raf PHP 4 05-21-09 02:26 PM
ASP and PHP programmer needed! imediaweb Job Offers & Assistance 22 06-29-05 09:14 AM


All times are GMT -5. The time now is 03:57 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.