Jump to content

2old2learn?

Members
  • Content Count

    288
  • Joined

  • Last visited

Everything posted by 2old2learn?

  1. Okay found the "{" error..so now I get this error...
  2. this is my selection option set up is this right also.. <td>Location:</td><td><select name="location" > <option value="Selection"> Make Selection </option> <option value="250y"> 250Yonge </option> <option value="20q"> 20 Queen </option> <option value="1dundas"> 1 Dundas </option> <option value="galleria_mall"> Galleria/Mall </option></td>
  3. Well, I've looked it over and over I guess I need fresh eyes..to find the "{" error... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>insert.php</title><link rel="stylesheet" type="text/css" href="/icc/skins/My_Start_Style.css" /><?phpinclude('config.php');foreach($_POST as $key => $value){ if(empty($_POST[$key])){ $formValid = false; };};?></head><body><?php$formValid = true;if($formValid){ //$con = mysql_connect("localhost","root",""); // if (!$con){ //die('Could not connect: ' . mysql_error()); // }; // mysql_select_db("tecicc", $con); //$select = $_POST['location']; $validTable=array('250y','20q','1dundas','galleria_mall'); if(in_array($select,$vaildTable)) //if ($_POST['location'] = "20q") { $sql="INSERT INTO $select ( srnumber, tenant, floor, location, job_description, employee, labour_cost, material_cost, date_twa_sent_to_tenant, date_twa_approved, date_parts_ordered, supplier, date_job_completed, date_billing_given_to_accounting, employee_comments, managers_comments) values ('$_POST[srnumber]','$_POST[tenant]','$_POST[floor]','$_POST[location]','$_POST[job_description]','$_POST[employee]','$_POST[labour_cost]','$_POST[material_cost]','$_POST[date_twa_sent_to_tenant]','$_POST[date_twa_approved]','$_POST[date_parts_ordered]','$_POST[supplier]','$_POST[date_job_completed]','$_POST[date_billing_given_to_accounting]','$_POST[employee_comments]','$_POST[managers_comments]')";} if (!mysql_query($sql,$con)){ die('Error: ' . mysql_error()); } echo "<script type='text/javascript'>alert('1 Record added');</script>"; if (isset($_POST['srnumber'])) { include('index_sr.php'); }mysql_close($con);{else}echo "<script type='text/javascript'>alert('Sorry, there was a problem with the form. Please check all data entries, try again');</script>"; if (isset($_POST['srnumber'])) { include('index_sr.php'); }}; ?> </body></html>
  4. Sorry even after being given the answers..I didn't do anything testing of it for a long time as a matter fact..was busy with other things...but today started working again on project..and ran into some little errors.. Below is my if/elseif statements and I get..error message... $select=$_POST['location']; if ( $select= '250y' ) { $sql="INSERT INTO 250y ( srnumber, tenant, floor, location, job_description, employee, labour_cost, material_cost, date_twa_sent_to_tenant, date_twa_approved, date_parts_ordered, supplier, date_job_completed, date_billing_given_to_accounting, employee_comments, managers_comments) values ('$_POST[srnumber]','$_POST[tenant]','$_POST[floor]','$_POST[location]','$_POST[job_description]','$_POST[employee]','$_POST[labour_cost]','$_POST[material_cost]','$_POST[date_twa_sent_to_tenant]','$_POST[date_twa_approved]','$_POST[date_parts_ordered]','$_POST[supplier]','$_POST[date_job_completed]','$_POST[date_billing_given_to_accounting]','$_POST[employee_comments]','$_POST[managers_comments]')";} elseif($select == '20q') { $sql="INSERT INTO 20q ( srnumber, tenant, floor, location, job_description, employee, labour_cost, material_cost, date_twa_sent_to_tenant, date_twa_approved, date_parts_ordered, supplier, date_job_completed, date_billing_given_to_accounting, employee_comments, managers_comments) values ('$_POST[srnumber]','$_POST[tenant]','$_POST[floor]','$_POST[location]','$_POST[job_description]','$_POST[employee]','$_POST[labour_cost]','$_POST[material_cost]','$_POST[date_twa_sent_to_tenant]','$_POST[date_twa_approved]','$_POST[date_parts_ordered]','$_POST[supplier]','$_POST[date_job_completed]','$_POST[date_billing_given_to_accounting]','$_POST[employee_comments]','$_POST[managers_comments]')";} elseif($select== '1dundas') { $sql="INSERT INTO 1dundas ( srnumber, tenant, floor, location, job_description, employee, labour_cost, material_cost, date_twa_sent_to_tenant, date_twa_approved, date_parts_ordered, supplier, date_job_completed, date_billing_given_to_accounting, employee_comments, managers_comments) values ('$_POST[srnumber]','$_POST[tenant]','$_POST[floor]','$_POST[location]','$_POST[job_description]','$_POST[employee]','$_POST[labour_cost]','$_POST[material_cost]','$_POST[date_twa_sent_to_tenant]','$_POST[date_twa_approved]','$_POST[date_parts_ordered]','$_POST[supplier]','$_POST[date_job_completed]','$_POST[date_billing_given_to_accounting]','$_POST[employee_comments]','$_POST[managers_comments]')";} else($select=='galleria_mall') { <<<<< Line 49 error message.. $sql="INSERT INTO galleria_mall ( srnumber, tenant, floor, location, job_description, employee, labour_cost, material_cost, date_twa_sent_to_tenant, date_twa_approved, date_parts_ordered, supplier, date_job_completed, date_billing_given_to_accounting, employee_comments, managers_comments) values ('$_POST[srnumber]','$_POST[tenant]','$_POST[floor]','$_POST[location]','$_POST[job_description]','$_POST[employee]','$_POST[labour_cost]','$_POST[material_cost]','$_POST[date_twa_sent_to_tenant]','$_POST[date_twa_approved]','$_POST[date_parts_ordered]','$_POST[supplier]','$_POST[date_job_completed]','$_POST[date_billing_given_to_accounting]','$_POST[employee_comments]','$_POST[managers_comments]')";} I hope I am getting this right...
  5. I saw his nice form format I like it and doing the same but the opposite way..I will be drawing from database as invoice..to tenant...
  6. never mind got what I want...
  7. Hey;I like the look of your form...I am interested in how you did it..I am looking to do something like it for my project at work..would like to see the script that makes it look the way it does..if you don't mind.. Thanks..
  8. Okay just reading over the posts..between you and SI0G, and I looked over this script you gave..if I run this it will encrypt my password to sha256???Many thanks....
  9. Solved...in phpmyadmin in the browse you can set it up either as "md5"or"sha1"...thanks all for your input..
  10. Thanks for info this project is just for office use...only wish to create a login script..no register, users will be manually entered....
  11. Cool its just a test database right now..so any error's is not a big deal...Thanks JSG
  12. Hey Okay I found how to do it the encryption thru phpMyAdmin..will make these changes once I get home from work..thanks all...as usual....
  13. Hey thanks..I am aware that php and javascript have a function to return..just wanted to make sure before I proceeded on...
  14. Hey thanks I thought there was something there but wasn't too sure..this also can be done creating a create " Table " , " User " , " password " file...
  15. Hey; I have in the table " users " and in the table I already have a field " passwords " is there a way in phpmyadmin to change the field into a " md5 " instead of seeing the password.... At this time I don't have a registration form for users..and wish to get this done with out using a registration form..I will input users manually.. Thanks..
  16. okay modified your script and works well with redirecting back to home page where login script is... <?php //This block prevents users from viewing this page unless logged insession_start();if(isset($_SESSION['logged_in'])){ //show the page to the user}else{ //lock them out header('Location: home.php');};?>
  17. I came across this script doing a google search..but can't seem to find it now...yea, your right should stick to the session route..until I get more familar with php...thanks...
  18. Then whats this all about..from your first post????
  19. Show us the form.php code to see line 17;thanks
  20. What field's are you calling for in the $sql statement;$sql= "Select * From Orders"; <<<<< Looks incomplete... here is an example: SELECT column_name(s) FROM table_name
  21. Now to think about it...your right it could be a false positive ..I think I will have to modify it..I think I know how..I will post my results later...thanks bud.. :)I tried this..not too sure if this makes any difference .. but I don't think so..if(isset($_members-> username))
  22. What are you trying to get from this line:..$sql= "Select * From Orders"; <<<<< Looks incomplete...
  23. LOL I this I am starting to get this..so far looks good got this to work..at least so far..Below is the change I just made...and now no error's if(isset($_username-> username)) { seems to be getting somewhere with this...
  24. Okay I get this error now.. This is line 4:if ($_username->username) {
×
×
  • Create New...