php? Posted December 31, 2007 Share Posted December 31, 2007 What I Want I want a script that displays all usernames sent into the database from the following script below and then has the ability to delete or accept them. <?php require_once('db.php'); include('functions.php'); if(isset($_POST['register'])) { if($_POST['username']!='' && $_POST['password']!='' && $_POST['password']==$_POST['password_confirmed'] && $_POST['email']!='' && valid_email($_POST['email'])==TRUE && checkUnique('Username', $_POST['username'])==TRUE && checkUnique('Email', $_POST['email'])==TRUE) { $query = mysql_query("INSERT INTO users (`Username` , `Password`, `Email`, `Random_key`) VALUES ('".mysql_real_escape_string($_POST['username'])."', '".mysql_real_escape_string(md5($_POST['password']))."', '".mysql_real_escape_string($_POST['email'])."', '".random_string('alnum', 32)."')") or die(mysql_error()); $getUser = mysql_query("SELECT ID, Username, Email, Random_key FROM users WHERE Username = '".mysql_real_escape_string($_POST['username'])."'") or die(mysql_error()); if(mysql_num_rows($getUser)==1) {//there's only one MATRIX :PP $msg = 'Account created. Please login to the email you provided during registration and confirm your membership.'; } else { $error = 'You just made possible the old guy (the impossible). Please inform my boss in order to give you the price for this.'; } } else { $error = 'There was an error in your data. Please make sure you filled in all the required data, you provided a valid email address and that the password fields match'; } } ?> <?php if(isset($error)){ echo $error;}?> <?php if(isset($msg)){ echo $msg;} else {//if we have a mesage we don't need this form again.?> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> Username: <input type="text" id="username" name="username" size="32" value="<?php if(isset($_POST['username'])){echo $_POST['username'];}?>" /><br /> Password: <input type="password" id="password" name="password" size="32" value="" /><br /> Re-password: <input type="password" id="password_confirmed" name="password_confirmed" size="32" value="" /><br /> Email: <input type="text" id="email" name="email" size="32" value="<?php if(isset($_POST['email'])){echo $_POST['email'];}?>" /><br /> <input type="submit" name="register" value="register" /><br /> </form> <? } ?> Anyone know how I could do this (Newbie Mode Engaged Link to comment https://forums.phpfreaks.com/topic/83900-lotsohelp-needed/ Share on other sites More sharing options...
forumnz Posted December 31, 2007 Share Posted December 31, 2007 Good for you... so whats the problem. Look up select, update, delete etc. www.w3schools.com/php/ Link to comment https://forums.phpfreaks.com/topic/83900-lotsohelp-needed/#findComment-426972 Share on other sites More sharing options...
php? Posted December 31, 2007 Author Share Posted December 31, 2007 Yes, and I need tips like that.. thanks Link to comment https://forums.phpfreaks.com/topic/83900-lotsohelp-needed/#findComment-426974 Share on other sites More sharing options...
forumnz Posted December 31, 2007 Share Posted December 31, 2007 Once thing you should know (seems like you dont). The PHP scripts work independently of each other. The fact that you want to write some code to do the above does not have anything to do with the script to insert into a database. Its like the database is in the middle and all the scripts work off that - not off each other (in your case). Sam. Link to comment https://forums.phpfreaks.com/topic/83900-lotsohelp-needed/#findComment-426979 Share on other sites More sharing options...
php? Posted December 31, 2007 Author Share Posted December 31, 2007 Umm all i want is to insert into a database... then withdraw and edit Link to comment https://forums.phpfreaks.com/topic/83900-lotsohelp-needed/#findComment-426980 Share on other sites More sharing options...
php? Posted December 31, 2007 Author Share Posted December 31, 2007 I'm thinking i could use the $_POST? variable on the username and password page... which then I can request with the $_REQUEST Variable on the admin page. Which then the admin could accept or decline which if accepted i could send it to the database. Link to comment https://forums.phpfreaks.com/topic/83900-lotsohelp-needed/#findComment-426996 Share on other sites More sharing options...
php? Posted December 31, 2007 Author Share Posted December 31, 2007 Is it possible to use more then 1 $_POST and $_REQUEST Variables? ... make them create new lines on a page Link to comment https://forums.phpfreaks.com/topic/83900-lotsohelp-needed/#findComment-426998 Share on other sites More sharing options...
revraz Posted January 1, 2008 Share Posted January 1, 2008 You can use as many $_POST variables as you like, just name them differently. Link to comment https://forums.phpfreaks.com/topic/83900-lotsohelp-needed/#findComment-427022 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.