Jump to content

ambo

Members
  • Posts

    136
  • Joined

  • Last visited

About ambo

  • Birthday 06/15/1988

Contact Methods

  • Website URL
    http://www.Runkys.com

Profile Information

  • Gender
    Male

ambo's Achievements

Member

Member (2/5)

0

Reputation

2

Community Answers

  1. <?php session_start(); include_once '/functions/dbconnect.php'; if(isset($_SESSION['user'])!="") { header("Location: home.php"); } if(isset($_POST['btn-login'])) { $email = mysql_real_escape_string($_POST['email']); $uname = mysql_real_escape_string($_POST['uname']); $upass = mysql_real_escape_string($_POST['pass']); $email = trim($email); $uname = trim($uname); $upass = trim($upass); $res=mysql_query("SELECT user_id, user_name, user_pass FROM users WHERE user_name='$uname'"); $row=mysql_fetch_array($res); $count = mysql_num_rows($res); // if uname/pass correct it returns must be 1 row if($count == 1 && $row['user_pass']==md5($upass)) { $_SESSION['user'] = $row['user_id']; header("Location: home.php"); } else { ?> <script>alert('Username / Password Seems Wrong !');</script> <?php } } ?> <html lang="en"> <head> <meta charset="UTF-8"> <title>Runkys Small Engine Repair</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <!--[if lte IE 8]><script src="js/html5shiv.js"></script><![endif]--> <script src="js/jquery.min.js"></script> <script src="js/skel.min.js"></script> <script src="js/skel-layers.min.js"></script> <script src="js/init.js"></script> <noscript> <link rel="stylesheet" href="css/skel.css" /> <link rel="stylesheet" href="css/style.css" /> <link rel="stylesheet" href="css/style-xlarge.css" /> </noscript> </head> <body class="landing"> <!-- Header --><!-- Banner --> <section id="banner"> <h2>Runkys</h2> <p>Small Engine Repair</p> <ul class="actions"> <li> <form method="post"> <table id="form" align="center" width="30%" border="0"> <tr id="trlogim"> <td><input type="text" name="uname" placeholder="Username" required /></td> </tr> <tr id="trlogim"> <td><input type="password" name="pass" placeholder="Your Password" required /></td> </tr> <tr id="trlogim"> <td><button type="submit" name="btn-login">Sign In</button></td> </tr> </table> </form> I have a simple login script that I have been playing with and it was working on my local wamp server but when I uploaded it to the web server all works except the login part I know my dbconnect.php file is accurate because I can register new users I just cant sign them in
  2. session_start(); if(isset($_SESSION['user'])!="") { header("Location: home.php"); } include_once 'dbconnect.php'; if(isset($_POST['btn-signup'])) { $uname = mysql_real_escape_string($_POST['uname']); $email = mysql_real_escape_string($_POST['email']); $upass = md5(mysql_real_escape_string($_POST['pass'])); $phone = mysql_real_escape_string($_POST['phone']); $fname = mysql_real_escape_string($_POST['fname']); $lname = md5(mysql_real_escape_string($_POST['lname'])); $uname = trim($uname); $email = trim($email); $upass = trim($upass); $phone = trim($phone); $fname = trim($fname); $lname = trim($lname); // email exist or not $query = "SELECT user_name FROM users WHERE user_name='$uname'"; $result = mysql_query($query); $count = mysql_num_rows($result); // if email not found then register if($count == 0){ if(mysql_query("INSERT INTO `users` (`user_id`, `user_name`, `user_email`, `user_pass`, `user_phone`, `user_fname`, `user_lname`, `user_level`) VALUES(NULL,'$uname','$email','$upass','$phone','$fname','$lname',1)")) { ?> <script>alert('successfully registered ');</script> <?php } else { ?> <script>alert('error while registering you...');</script> <?php } } else{ ?> <script>alert('Sorry Email ID already taken ...');</script> <?php } } ?> <!DOCTYPE html PUBLIC > <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Runkys</title> <?php include_once 'csslist.php'; ?> </head> <body> <?php include_once 'header.php'; ?> <div id="body"> <div id="login-form"> <form method="post"> <table align="center" width="30%" border="0"> <tr> <td><input type="email" name="email" placeholder="Your Email" required /></td> </tr> <tr> <td><input type="text" name="uname" placeholder="User Name" required /></td> </tr> <tr> <td><input type="password" name="pass" placeholder="Your Password" required /></td> </tr> <tr> <td><input type="text" name="phone" placeholder="Phone Number" required /></td> </tr> <tr> <td><input type="text" name="fname" placeholder="First Name" required /></td> </tr> <tr> <td><input type="text" name="lname" placeholder="Last Name" required /></td> </tr> <tr> <td><button type="submit" name="btn-signup">Sign Me Up</button></td> </tr> <tr> <td><a href="index.php">Sign In Here</a></td> </tr> </table> </form> </div> </div> </body> </html> I am new to this and cant figure out what I am missing I modeled it after another page that I have that works this is a learning curve for me please teach me what I did wrong its simple register script where it checks to see if the username is already in the db
  3. never mind I figured it out
  4. <?php $notesget = mysql_query("SELECT * FROM notes ORDER BY note_date"); // selecting data through mysql_query() $notesfill = mysql_fetch_array($notesget); $notedate = $notesfill['note_date']; $time = strtotime($notedate); $notedateformat = date("n/j g:ia", $time); // we are running a while loop to print all the rows in a table echo'<tr>'; // printing table row echo '<td id="notename" align="right">'.$notesfill['note_user'].'</td></tr><tr><td id="notedata">'.$notesfill['note_data'].'</td></tr><tr><td id="notedate" align="right">'.$notedateformat.'</td></tr>'; ?> Having trouble looping data after date formatting
  5. Thank you just a new way of thinking I am blind sometimes
  6. SELECT cl_lname ,cl_fname FROM clientdata WHERE cl_lname='$cl_lname' AND cl_fname='$cl_fname' so something like this
  7. <?php include_once 'dbconnect.php'; include_once 'securitycheck.php'; if(isset($_POST['btn-signup'])) { $cl_fname = mysql_real_escape_string($_POST['cl_fname']); $cl_lname = mysql_real_escape_string($_POST['cl_lname']); $cl_address = mysql_real_escape_string($_POST['cl_address']); $cl_city = mysql_real_escape_string($_POST['cl_city']); $cl_state = mysql_real_escape_string($_POST['cl_state']); $cl_zipcode = mysql_real_escape_string($_POST['cl_zipcode']); $cl_hphone = mysql_real_escape_string($_POST['cl_hphone']); $cl_cphone = mysql_real_escape_string($_POST['cl_cphone']); $cl_fname = trim($cl_fname); $cl_lname = trim($cl_lname); $cl_address = trim($cl_address); $cl_city = trim($cl_city); $cl_state = trim($cl_state); $cl_zipcode = trim($cl_zipcode); $cl_hphone = trim($cl_hphone); $cl_cphone = trim($cl_cphone); // Checks to see if the names from the form exist in DB $query1 = "SELECT cl_lname cl_fname FROM clientdata WHERE cl_lname='$cl_lname'"; $result1 = mysql_query($query1); $count1 = mysql_num_rows($result1); $query2 = "SELECT cl_fname FROM clientdata WHERE cl_fname='$cl_fname'"; $result2 = mysql_query($query2); $count2 = mysql_num_rows($result2); if($count1 == 0){ if(mysql_query("INSERT INTO clientdata(cl_fname,cl_lname,cl_address,cl_city,cl_state,cl_zipcode,cl_hphone,cl_cphone) VALUES('$cl_fname','$cl_lname','$cl_address','$cl_city','$cl_state','$cl_zipcode','$cl_hphone','$cl_cphone')")) { ?> <META http-equiv="refresh" content="0;URL=client_list.php"> <?php } else { ?> <script>alert('There was a Error');</script> <?php } } else{ if($count2 == 0){ if(mysql_query("INSERT INTO clientdata(cl_fname,cl_lname,cl_address,cl_city,cl_state,cl_zipcode,cl_hphone,cl_cphone) VALUES('$cl_fname','$cl_lname','$cl_address','$cl_city','$cl_state','$cl_zipcode','$cl_hphone','$cl_cphone')")) { ?> <META http-equiv="refresh" content="0;URL=client_list.php"> <?php } else { ?> <script>alert('There was a Error');</script> <?php } } else{ ?> <script>alert('Customer already exists');</script> <?php } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Runkys</title> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body id="body"> <center> <?php include_once 'header.php'; ?> <div id="mainbody"> <form id="login-form" method="post"> <table id="inputtable" align="center" width="70%" border="0"> <tr> <td><input type="text" name="cl_fname" placeholder="First Name" required /></td> <td><input type="text" name="cl_lname" placeholder="Last Name" required /></td> </tr> <tr> <td><input type="text" name="cl_address" placeholder="Address" required /></td> <td><input type="text" name="cl_city" placeholder="City" required /></td> </tr> <tr> <td> <select name="cl_state"> <option value="CT">Connecticut</option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="DE">Delaware</option> <option value="DC">District Of Columbia</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West Virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> </select> </td> <td><input type="text" name="cl_zipcode" placeholder="Zipcode" required /></td> </tr> <tr> <td><input type="text" name="cl_hphone" placeholder="Home Phone" required /></td> <td><input type="text" name="cl_cphone" placeholder="Cell Phone" required /></td> </tr> <tr> <td><button type="submit" name="btn-signup">Add Client</button></td> </tr> <tr> <td><a href="home.php">Cancel</a></td> </tr> </table> </form> </div> </center> </body> </html> I have a simple script and I am new to this so the basic thing is I have a form that I can input client data into a database for later recall... if you fill out the form it will add the info to database so far I am able to grab the data have the script check the last name if the last name is in the DB it then checks to see if the first name is in the database. if the first name isn't in the database then its a new client with same last name it will add.. the issue is after it pulls the last name and there is a duplicate it then checks all the rows for the first name so if you have fname1, lname1 fname2,lname2 and I want to add fname2,lname1 I cant any ideas?
  8. Unfortunatly Black Red and white are the colors for ACE hardware and its ether a white or black background
  9. it seems to me that the Works pretty Fine as the what is 4+8 is not wraped with a <label tag and you can name the field spam so it shouldint read the text you can also use the name of the site and accept multiple answers like .com and what not
  10. Yeah thats or <td><?php echo"$callnumber"; ?></td>
  11. Dont Know if this is it but i usually use also you should add a limit 1 to your query if your only going to be updating 1 row and after that you have to start the loop <?php $result = mysql_query("SELECT * FROM samples WHERE id='$id' LIMIT 1") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { //Rows are being looped even though you only //call one row with limit 1 $oldname = $row['name']; $oldfilename = $row['filename']; $oldsdesc = $row['sdesc']; $oldldesc = $row['ldesc']; }// end row loop ?>
  12. I was going to comment on that to but i figured if it was working lol.... I combined that section of code together as well in the validation sample i showed him..
  13. I asked a question like this before and i got a really good answer you use a variable he used $readyform but you can use things like $validation <?php # Handle Contact Form $validation = true; //This sets the Form To True For error Checking $name = stripslashes($_REQUEST['name']); $email = $_REQUEST['email']; $location = stripslashes($_REQUEST['location']); $url = $_REQUEST['url']; $comments = stripslashes($_REQUEST['comments']); $ip = $HTTP_SERVER_VARS['REMOTE_ADDR']; $to = "david.adams5280@yahoo.com"; $subject = "Comments from DavidRaleigh.net"; $message = "<b>Name:</b> $name<br> <b>Email address:</b> $email<br> <b>Location:</b> $location<br> <b>Website:</b> $url<br><br> <b>Comments:</b> $comments "; $from = $_REQUEST['email']; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= "From: $from" . "\r\n"; if (!empty($_REQUEST['email'])) { $email = ($_REQUEST['email']); } else { $validation = false; // There Was an error The Field was empty so Validation was set to False Display error echo 'You forgot your email address.'; } if (!empty($_REQUEST['comments'])) { $comments = stripslashes($_REQUEST['comments']); } else { $validation = false; // There Was an error The Field was empty so Validation was set to False Display error echo 'You forgot to add your message.'; } if ($validation = true) { // If no errors then Validation stayed true and you can execute the script echo "Thank you for your comments $name."; mail($to,$subject,$message,$headers); } ?> For Spam bots you can do a form text field and say some thing like 4+8="Textfield" Then check with <?php if ($spamcheck == 12) { $validation = true; }else{ $validation = false; }?>
  14. Look into making your own site editor i made this on my site so i could change things on the fly. I made a file tree which grabs all files and folders in /root directory and display them as a link to fileview.php?file=../folder/file.php then fileview.php $_get['file']; and open the file in write mode explode it into a array and echo it into a textarea then submit it to fileedit.php?file=...... and write the file boom your done
  15. Also the games menu at the top its on a div with overflow-y:auto make it a horizontal menu or make a navigation panel on the left actually the one that i put in a project its called an accordian menu www.larsenacehardware.com the menu on the left
×
×
  • 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.