PHP - Edit Accounts
hi all, i have a page which lists all of my registered users from the mysql database but i want the ability to edit an account,
here is my list users code (just shown the appropiate code and not the rest): Code: [Select] <?php require ('../secure/connect.php'); $sql = "SELECT * FROM users ORDER BY user_level ASC"; $result=mysql_query($sql); echo '<table width="80%" border="0" cellspacing="5" cellpadding="0">'; echo ' <tr> <th><p align="left">User ID:</th> <th><p align="left">User Level:</th> <th><p align="left">Username:</th> <th><p align="left">User Title:</th> <th><p align="left">Email:</th> <th><p align="left">Actions:</th> </tr>'; while($rows=mysql_fetch_array($result)){ ?> <tr> <td><?php echo $rows['userid']; ?></td> <td><?php echo $rows['user_level']; ?></td> <td><?php echo $rows['username']; ?></td> <td><?php echo $rows['user_title']; ?></td> <td><?php echo $rows['email']; ?></td> <td><a href="edit_account.php?id=">Edit Account</a></td> </tr> <?php } ?> this lists my users nicely, as you can see i put it a edit account action at the end with a empty id= because that may be a way of doing it but im not sure what else to do or if there is a better way of doing it. any help would be great! Similar TutorialsI am having a problem with my User Log-In... When a User creates an account on my website, an e-mail is sent that looks like this... Quote Congratulations! Your account has been created, and a confirmation e-mail sent to: "john.doe@mail.com" Please click on the link in that e-mail to activate your account. Then when they click on the link, it takes them to my 'activate.php" page which updates the User's record by removing the Activation Code. The "Activation" seems to work fine. However, the problem that I just realized is that I am doing nothing to prevent someone from Registering, NOT Activating his/her account, but still being able to Log In?! I guess what I need to do when a User logs in is check to be sure that the "activation_code" column is NULL, right? Here is a snippet of my Log In script... if (empty($errors)){ // Valid form data. // ************************ // Find Member Record. * // ************************ // Connect to the database. require_once(WEB_ROOT . 'private/mysqli_connect.php'); // Build query. $q = 'SELECT id, first_name FROM member WHERE email=? AND pass=?'; // Prepare statement. $stmt = mysqli_prepare($dbc, $q); // Bind variables to query. mysqli_stmt_bind_param($stmt, 'ss', $email, $pass); // Execute query. mysqli_stmt_execute($stmt); // Store results. mysqli_stmt_store_result($stmt); // Check # of Records Returned. if (mysqli_stmt_num_rows($stmt)==1){ // Member was Found. // Bind result-set to variables. mysqli_stmt_bind_result($stmt, $memberID, $memberFirstName); // Fetch record. mysqli_stmt_fetch($stmt); // Set Session variables. $_SESSION['memberID'] = $memberID; $_SESSION['memberFirstName'] = $memberFirstName; $_SESSION['loggedIn'] = TRUE; What would be the best way to fix this? Thanks, Debbie Hello! I want to build a script to basically keep track of the number of hosting accounts that are currently on each server. I have roughly 30 servers (root access, WHM, cPanel) that I would like to be able to track all of from a single page. Could someone help/point me in the right direction/offer any input? thanks! much appreciated! Hello all, I am a total noob in php and some VIP asked me to make something simple for our clubhouse; A page where users can submit/input 2 codes through a textbox and store it in a database. There are 2 things i want: max 2 submits/inputs per IP(to prevent abuse)(ip stored in database). $ip = $_SERVER['REMOTE_ADDR']; $check = mysql_query("select * from table where ipcolumn='$ip'"); if (mysql_num_rows($check) > 0) $insertip = "insert into table (ipcolumn) values ('$ip')"; And i wanna catch the error when an user put in a code lower than 5 characters. not something like: if ($textarea == ""){ This is where i am so far. new.php <?php include 'includes/config.php'; mysql_select_db($mysql_database, $con); $sql="INSERT INTO users (code, code2) VALUES ('$_POST[code]','$_POST[code2]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }else{ header ("Location: /thanks.php"); } ?> includes/config.php <?php $mysql_host = "myhost.com"; $mysql_database = "mydb"; $mysql_user = "myuser"; $mysql_password = "mypass"; $con = mysql_connect($mysql_host,$mysql_user,$mysql_password); if (!$con) { die('Could not connect: ' . mysql_error()); } ?> sql.sql -- -- Table structure for table `users` -- CREATE TABLE `users` ( `code` varchar(30) collate latin1_general_ci NOT NULL, `code2` varchar(32) collate latin1_general_ci default NULL, `timestamp` int(11) unsigned NOT NULL, PRIMARY KEY (`code`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; index.html <form action="new.php" method="post" onsubmit="return onSubmitButton();"> <input value="" id="something" class="LoginForm-Input" name="code1" size="34" style="float: left;">[/code] How can i detect someone who is using proxy and has 2 or more accounts on my website?Or anyway, the important thing for me it is that they dont cheat because i have a competition and its forbidden to have 2 or more accounts.
I am looking to see if I could use one of the paypal features to pay two diffierent account from a single transaction and does paypal does that automatically?.. I was checking the immediate payment for a third party from the express checkout but I don't know that much about it. Does anyone knows how to achieve this? Not sure if this is related to the thread but I do think that it is
I have a server using Apache
I tried to set up an email doing something@domain.com
I tried to point the MX records to the server
It still doesn't work, if I try to send anything to that email, I get a response saying "Recepient not found" smtp.secureserver.net... blah
Since I changed the MX records to something other than smtp.secureserver.net, I don't know why I still get that message
I was trying to save on spending the $3.95 or whatever for email with office 365 haha
Any help would be greatly appreciated
Still, logically one question is obvious, don't I need to specify the storage location of the email... ? I mean there was an option in Cpanel where I created the email account but I don't understand what that means... did it configure a storage location? I don't know...
This probably is not an appropriate thread section for this question
Edited by greenace92, 04 December 2014 - 05:18 AM. Hey everybody,
I'm a noob when it comes to PHP so I have a few questions.
I'm in the planning stages for a new website and I need it to do something but I'm not sure how. People would have to log into my website in order to make a purchase and I need to be able to link their account with the software they bought. Think of it like a bit like Steam, you buy the game and its right there in your library.
The way I see it working is they buy their software and when they look in their profile they see a list of the stuff they've bought and have the ability to open it.
The Ecommerce company I'm looking to sign up with to make the transactions and keep the money side of it in order (FastSpring) don't have a way of tracking user purchases so I have to come up with a way of doing my end.
What I would like to know is what language is best to do this? I assume PHP would be the best especially considering the website itself is likely to be built in WordPress.
Secondly does anybody have any links to articles, videos or tutorials on this as I have not been able to find any all afternoon. I know they're going to be out there but I'm not having any luck finding them
Thanks for your time
Hi guys, This is very important. The supervisor of my system wants to close accounts which contain zero balances for long time periods. There is a separate page contains ID and Account Number.This is included in a form and a "close account" button is there. When he clicks on that button the relevant record should be deleted from all tables which include that ID. The table structure looks like this. There are 4 account types which contain same fields. savings_investment(ID,account_type,full_name_balance,interest,customer_id) I want full coding of this scenario. Thanks, Heshan I'm making a checklist. One table holds the list with IDs. There are about 224 rows, each with its own ideas. Now I have another table to hold user accounts. When you create an account, it shows you a fresh new checklist that you need to start checking off. Could anyone please share techniques so I can have multiple accounts have their own list they need to check off? (ie, when a new person creatures a new account they should have their own list with NOTHING checked) The only way I can think of doing this is making 224 fields for the user account with the IDs of the checklist table to check if I checked it or not. Surely there's an easier way? Thanks I would like my website to show which users are logged in. Is there a simple way of retrieving all session ids from the server that have been allocated and are active in order to do this? I know this could lead to faulty information, but would appear to be the simplest and reliable. Thanks. I'm working on a new user submission form and I was wondering whether it's safe to send a confirmation letter to the user using their hashed password as their confirmation code? Since this is a hashed password it can't be decrypted (I believe), the password is useless because it's always hashed before login so it can't be used to login to the system, it's only being emailed to the user who's account is tied to the account, and it would save me the option of having to store a confirmation code field in my DB. Is this safe? Hello,
I designed (not coded) a finance application for windows phone 8.1 and one of the features that would be ideal is to copy your login steps in order to access your bank account automatically. Yes this does not sound safe or sane. How do I convince app users to use it?
Anyway, I want this access. My rationale is that, the login information would be stored locally and if my phone was hacked then what's the loss in my login steps being hacked... they would probably be encrypted anyway but...
The goal is to be able to open up a clone browser (eg. within the app) and then every step that you take, enter url, login credentials, security questions, pages accessed... the clone browser remembers and then later on as part of the app's function, it would automatically update your balances. I mean I suppose you could come up with the formulas, cash advance fees, interest rates, etc... but at the same time this doesn't seem to be a fixed thing... eg. hard to keep track and get the exact cent amount... or maybe I'm just bad at math
Some things in mind bitmapping, key strokes, string search, number search...
Anyway scripting came to mind, not sure if php or python but
Any thoughts?
Retrieve Pages, Ads, Leads from multiple facebook accounts with Graph API - Help needed I need Delete Duplicate Email Records That Are Attached To One Account But Can Be Found In Multiple Accounts I have a table, consumer_mgmt. It collects consumer information from various forms. These forms are available through different pages that are part of a business package. A business can offer these signups to gather names and emails from consumers for various types of specials they may offer. So a consumer my be in the consumer_mgmt table 5, 10, 15 times for that particular business. But, that consumer may be in the consumer_mgmt table multiple times for a different business. So multiple times for multiple businesses. I need to remove duplicates for each business account so the consumer is only the consumer_mgmt only once for each business. There are approximately 15,000 rows currently in the consumer_mgmt table. I'm not sure where to begin on the logic. Since there are multiple business accounts that the emails are attached to, would one have to build a case for each loop? I'm using php edit function to edit an php file online. I think the portion that writing the file is below. My issue is that wherever there's a quote ("), it's automatically adding a slash (\). For example, if I had class="abc", it changes to class=\"abc\". How do I fix this? Code: [Select] <?php $file = $_GET['f']; $script = $_POST['script']; if($file&&$script) { $fp=fopen($file, "w"); fwrite($fp,$script); fclose($fp); } ?> hello mates, I am needing help on editing a line in Flat File Database. I got it to pull the data i need out by using id but not sure on how i would go about getting it to update the FFD heres what i got so far $id2 = $_REQUEST['id']; $id = array(); $username = array(); $title = array(); $date = array(); $message = array(); $lines = file('../news/news.db'); foreach($lines as $line){ if($id != $id2) { $explode = explode("||",$line); $id = $explode[0]; $username = $explode[1]; $title = $explode[2]; $date = $explode[3]; $message = $explode[4]; } } ?> <form action="edit_news2.php?id=<?php echo $id; ?>" method="post" name="editnews"> <table width="100%"> <tr><td><input name="id" value="<?php echo "$id;" ?>" type="hidden" />UserName:</td><td> <input name="userName" value="<?php echo "$username" ?>" type="text" readonly="true" /></td></tr> <tr><td>News Title:</td><td> <input name="title" type="text" value="<?php echo "$title"; ?>" /></td></tr> <tr><td>Date/Time:</td><td> <input name="datetime" value="<?php echo "$date"; ?>" type="text" readonly="true" /></td></tr> <tr><td colspan="2">Message:</td></tr> <tr><td colspan="2"><textarea name="message" cols="50" rows="15"><?php echo "$message"; ?></textarea></td></tr> <tr><td colspan="2" align="center"><input type="submit" name="submitBtn" value="Post News" /></td></tr> </table> </form> thank you Valkeri2010 Hi, I hope this can be done and need some advise as to how. I have a search results page that has a URL of: results-page.php?make=FORD&model=TRANSIT--2000-on++Standard+LOW+ROOF+Models&submit.x=22&submit.y=7 Can i create a button or link on that page to adjust the start of the URL but keeping the dynamically created end part? i.e: new-results-page.php?make=FORD&model=TRANSIT--2000-on++Standard+LOW+ROOF+Models&submit.x=22&submit.y=7 I Hope this makes sense. Hi all, I don't know if it is possible but i need to edit one word document, write the name of the customer in it, but at the right place and print it from a php form. The user write in that php form the customer id and if he exists, the system should modify the word template and print it. Do you think this is possible and if so how can i do that? Thanks in advance. Hugo Hi can anyone please help me, I have to create a edit page that retrieves information from a list so that a user can change the text. The page looks fine but when I enter data in the fields and update it leaves the page as it was retrieved. I am a beginner! My code looks like this: Code: [Select] <form method = "get" action = "edit.php"> <?php //check to see if user is logged on session_start(); if (!(isset($_SESSION['login']) && $_SESSION['login'] != "")) { header ("Location:login.php"); } include('connect.php'); //connection details to database in a connect.php page $product_id = $_GET['product_id']; $query = "SELECT * FROM products WHERE product_id = '$product_id'"; $result = mysql_query($query); while($row = mysql_fetch_array($result)){ $product_id = $row['product_id']; echo "<table>"; echo "<tr>"; echo "<td><input name = 'product_id' type = 'hidden' value ='$row[product_id]'></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Product Name:</td><td><input name = 'pname' type = 'text' value ='$row[product_name]'></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Product Range:</td><td><input name = 'prange' type = 'text' value ='$row[product_range]'></td>"; echo "</tr>"; echo "<tr>"; echo "<td>Product Price:</td><td><input name = 'pprice' type = 'text' value ='$row[product_price]'></td>"; echo "</tr>"; echo "<tr>"; echo "<td><input type = 'submit' name = 'Submit' value = 'Update'></td>"; echo "</tr>"; echo "</table>"; } //if form was submitted if ($_SERVER['REQUEST_METHOD'] == 'POST'){ //get values from fields $productname = $_POST['pname']; $range = $_POST['prange']; $price1 = $_POST['pprice']; $price = (int)$price1; if ($productname == "" || $range == "" || $price == "" ) { $errorMessage .= "Please fill in all text boxes"; } else { $errorMessage = ""; } $query = "UPDATE products SET product_name = '$productname', product_range = '$range', product_price = '$price' WHERE product_id = '$product_id'"; $result = mysql_query($query); print "<br> $productname from range $range with a price of $price has been updated!"; } ?> Thank you in advance! Ok I have a file with my emails and passwords like this email:pass email:pass email:pass email:pass and so on.. Is it possible to make a script that will delete everything after the ":" and replace the ":" with a comma? Im not sure what functions or w/e I could use to make this possible? Any ideas? Thanks |