Jump to content

ag3nt42

Members
  • Posts

    427
  • Joined

  • Last visited

    Never

Everything posted by ag3nt42

  1. Yup that did it.. working well now.. with this config NamVirtualHost *:80 <VirtualHost *:80> ServerName www.mysite.com ServerAlias mysite.com DocumentRoot C:\blah\blah\htdocs </VirtualHost> <VirtualHost *:80> ServerName mail.mysite.com DocumentRoot C:\blah\blah\htdocs\webmail </VirtualHost>
  2. OK I think its working!!!!!!!!!!! here is the updated script: <?php session_start(); require('../../config.php'); $Success=0; $Fail=0; /////////////////////// //* OPEN CONNECTION *// /////////////////////// $con = mssql_connect($dblocation,$dbusername,$dbpassword); if (!$con) { die('Could not connect: ' . mssql_error()); } mssql_select_db($dbname, $con); $datatable=$tblpre."Employee"; ////////////////// //* GET ACTION *// ////////////////// if(!(isset($_POST['action']))) { $action=''; } else { $action=$_POST['action']; } ///////////////////// //* WHICH ACTION? *// ///////////////////// if($action=='Create') { //////////////////////////// //* HARVEST CREATE INPUT *// //////////////////////////// if(!(isset($_POST['EmpID']))){$EmpID='';}else{$EmpID=$_POST['EmpID'];} if(!(isset($_POST['Department']))){$Department='';}else{$Department=$_POST['Department'];} if(!(isset($_POST['FirstName']))){$FirstName='';}else{$FirstName=$_POST['FirstName'];} if(!(isset($_POST['Initial']))){$Initial='';}else{$Initial=$_POST['Initial'];} if(!(isset($_POST['LastName']))){$LastName='';}else{$LastName=$_POST['LastName'];} if(!(isset($_POST['Addy1']))){$Addy1='';}else{$Addy1=$_POST['Addy1'];} if(!(isset($_POST['Addy2']))){$Addy2='';}else{$Addy2=$_POST['Addy2'];} if(!(isset($_POST['Phone']))){$Phone='';}else{$Phone=$_POST['Phone'];} if(!(isset($_POST['City']))){$City='';}else{$City=$_POST['City'];} if(!(isset($_POST['State']))){$State='';}else{$State=$_POST['State'];} if(!(isset($_POST['Zip']))){$Zip='';}else{$Zip=$_POST['Zip'];} //* SETUP SQL INJECTIONS *// $CreateSQL="INSERT INTO [".$datatable."] (EmpID, FirstName, Initial, LastName, Addy1, Addy2, Phone, Department, City, State, Zip) VALUES ('".$EmpID."', '".$FirstName."', '".$Initial."', '".$LastName."', '".$Addy1."', '".$Addy2."', '".$Phone."', '".$Department."', '".$City."', '".$State."', '".$Zip."')"; $CreateQuery=mssql_query($CreateSQL) or die(mssql_get_last_message()); //* RUN INJECTIONS *// if($CreateQuery) { $Success++;//Success } else { $Fail++;//FAILED } } //* ELSE *// if($action=='Delete') { //////////////////////////// //* HARVEST DELETE INPUT *// //////////////////////////// if(!(isset($_POST['Employeez']))){$Employeez='';}else{$Employeez=$_POST['Employeez'];} //* HOW MANY *// $EmpCount=count($Employeez); //* DECREMENT BY 1 TO MATCH ARRAYS *// $EmpCount--; /////////////////////////////// //* SETUP DELETE INJECTIONS *// /////////////////////////////// ///* IN FOR LOOP FOR MULTI */// /////////////////////////////// for($x=0;$x<=$EmpCount;$x++) { if($Employeez=='') { $Fail++; $NoEmpsSelected="You have not selected any Employees to delete!"; } else { $NoEmpsSelected=''; //INJECT QUERY $EmpDelete[$x]="DELETE FROM [".$datatable."] WHERE EmpID='".$Employeez[$x]."'"; //RUN INJECT $EmpQuery[$x]=mssql_query($EmpDelete[$x]) or die (mssql_get_last_message()); if($EmpQuery[$x]) { $Success++;//SUCCESS } else { $FAIL++;//FAILED } } } } //* ELSE *// if($action=='Details') { ///////////////////////////// //* HARVEST DETAILS INPUT *// ///////////////////////////// if(!(isset($_POST['Employeez']))){$Employeez='';}else{$Employeez=$_POST['Employeez'];} //* HOW MANY EMPZ? *// $EmpCount=count($Employeez); //* DECREMENT BY 1 TO MATCH ARRAYS *// $EmpCount--; /////////////////////////////// //* START DETAILS INTERFACE *// /////////////////////////////// echo(" <table style='width:100%;height:100%;text-align:center;vertical-align:middle;'> <tr> <td> <form action='' method='post'> "); //////////////////////////// //* START LOOP FOR MULTI *// //////////////////////////// for($x=0;$x<=$EmpCount;$x++) { //* CHANGE DATATABLE *// $datatable=$tblpre."cat_dep"; /////////////////////////////////// //* HARVEST DEPARTMENTS FROM DB *// /////////////////////////////////// $DepartmentSQL[$x]="SELECT * FROM [".$datatable."]"; $DepartmentResult[$x]=mssql_query($DepartmentSQL[$x]) or die (mssql_get_last_message()); //* RESET DATATABLE *// $datatable=$tblpre."Employee"; //////////////////////////////// //* HARVEST DB INFO FOR EMPz *// //////////////////////////////// $DetailsSQL[$x]="SELECT * FROM [".$datatable."] WHERE EmpID='".$Employeez[$x]."'"; $DetailsResult[$x]=mssql_query($DetailsSQL[$x]) or die (mssql_get_last_message()); while($row=mssql_fetch_array($DetailsResult[$x])) { $ID[$x]=$row[0]; $EmpID[$x]=$row[1]; $FirstName[$x]=$row[2]; $Initial[$x]=$row[3]; $LastName[$x]=$row[4]; $Addy1[$x]=$row[5]; $Addy2[$x]=$row[6]; $Phone[$x]=$row[7]; $Department[$x]=$row[8]; $City[$x]=$row[9]; $State[$x]=$row[10]; $Zip[$x]=$row[11]; } ////////////////////////////////// //* CONTINUE DETAILS INTERFACE *// ////////////////////////////////// echo(" <fieldset><legend>".$EmpID[$x]."</legend> <table> <tr> <td> ID: </td> <td> <input type='text' value='".$EmpID[$x]."' name='UEmpID[".$x."]' /> </td> </tr> <tr> <td> Department: </td> <td> <select name='UDepartment[".$x."]'> "); while($row=mssql_fetch_array($DepartmentResult[$x])) { if($Department[$x]==$row['cat_dep#']) { echo("<option SELECTED value='".$row['cat_dep#']."'>".$row['cat_dep#']." | ".$row['Description']."</option> "); } else { echo("<option value='".$row['cat_dep#']."'>".$row['cat_dep#']." | ".$row['Description']."</option> "); } } echo(" </select> </td> </tr> <tr> <td> First Name: </td> <td> <input type='text' value='".$FirstName[$x]."' name='UFirstName[".$x."]' /> </td> </tr> <tr> <td> Middle Initial: </td> <td> <input type='text' size='1' maxlength='1' value='".$Initial[$x]."' name='UInitial[".$x."]' /> </td> </tr> <tr> <td> Last Name: </td> <td> <input type='text' value='".$LastName[$x]."' name='ULastName[".$x."]' /> </td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <td> Address 1: </td> <td> <input type='text' value='".$Addy1[$x]."' name='UAddy1[".$x."]' /> </td> </tr> <tr> <td> Address 2: </td> <td> <input type='text' value='".$Addy2[$x]."' name='UAddy2[".$x."]' /> </td> </tr> <tr> <td> Phone #: </td> <td> <input type='text' size='10' maxlength='10' value='".$Phone[$x]."' name='UPhone[".$x."]' /> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </fieldset> "); } } //* ELSE *// if($action=='Update') { //DO UPDATE } //////////////////// //* SUCCESSFULL? *// //////////////////// if($Success>0) { //Successful echo("<table style='width:100%;height:100%;vertical-align:middle;text-align:center;'><tr><td><font color='green'><h1>Employee ".$action." Successful! x".$Success."</h1></font><br />Redirecting...</td></tr></table>"); echo("<meta http-equiv='refresh' content='1.5;url=http://".$domain.$sPath."admin/Edits/Employee.php'>"); } elseif($Fail>0) { //FAILED echo(" <table style='width:100%;height:100%;vertical-align:middle;text-align:center;'> <tr> <td> <font color='red'> <h1>Employee ".$action." FAILED! x".$Fail."</h1>".mssql_get_last_message()."</font> "); if($action=='Delete'){echo("<br /><br />".$NoEmpsSelected);} if($action=='Create'){echo('');} echo(" </td> </tr> </table> "); } ?> could you post a link to a tut on this kind of ifelse <?php $selected = ($account_info['dept_id'] == $depts['dept_id'])? "SELECTED" : ""; ?>
  3. i thought it was.. all the html and everything is inside that loop nvrmind the call to the databse wasn't inside the loop ok I got it creating the drop down for both emps
  4. ok.. I understand your logic but now i've gone and confused myself all to heck. and when I select more then one employee to view/edit the details for.. only the first employee gets the dropdown. I think I need a cig break. lol :-\
  5. i don't understand this part that you said but yes I already get the value of which department is assigned to the employee once I pull the details for that employee. I just can't figure out how to say Out of all of these departments select only the department which matches the one assigned to the employee yet list the rest of the departments for choosing. could I just do like this while($row=mssql_fetch_array($DepartmentResult[$x])) { if($row['cat_dep#']==$row['Department']) { echo(//SELECTED SELECT OPTION) } else { echo(//SELECT OPTIONS); } }
  6. Under the "Employee Table" the column "Department" holds the same value as the value in the column "cat_dep#" under the "Department table" here i have a better Idea.. here is my code two pages all together.. First page handles the "Creation" and "Deletion" forms The second page handles the "Details" form as well as ALL of the processing for ALL forms. First Page: <?php session_start(); require('../../config.php'); ///////////////////////////////// //*****************************// //***** L.O.T.U.S. AUTHOR *****// //****** ag3nt42 ******// //*****************************// //////////////////////////////// //* OPEN DATABASE CONNECTION *// //////////////////////////////// $con = mssql_connect($dblocation,$dbusername,$dbpassword); if (!$con) { die('Could not connect: ' . mssql_error()); } mssql_select_db($dbname, $con); $datatable=$tblpre."cat_dep"; //* DISPLAY INTERFACE *// echo(" <html> <head> <link rel='stylesheet' type='text/css' href='../admin.css' /> </head> <body> <table style='width:100%;height:100%;vertical-align:middle;text-align:center;'> <tr> <td colspan='2'><h1>SETUP EMPLOYEES</h1></td> </tr> <tr> <td colspan='2'><p>Here you can setup unlimited amount of Employees</p></td> </tr> <tr> <td colspan='2'><hr /></td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <td colspan='2'><hr /></td> </tr> <tr> <td><h2>CREATE NEW EMPLOYEE</h2></td> <td><h2>AVAILABLE EMPLOYEES</h2></td> </tr> <tr> <td width='48%'> <fieldset style='width:75%'><legend>Create New</legend> <form action='../Ca_info/Cus_info.php' method='post'> <table style='margin-left:25px;'> <tr> <td width='10%' style='text-align:left;'> ID: </td> <td style='text-align:left;'> <input type='text' size='3' maxlength='3' name='EmpID' /> </td> </tr> <tr> <td width='10%' style='text-align:left;'> Department: </td> <td style='text-align:left;'> <select name='Department'> "); //* LOOP FOR DEPARTMENTS *// //* GET DEPARMENTS *// $DepartmentSQL="SELECT * FROM [".$datatable."]"; $DepartmentResult=mssql_query($DepartmentSQL) or die (mssql_get_last_message()); while($row=mssql_fetch_array($DepartmentResult)) { echo("<option value='".$row['cat_dep#']."'>".$row['cat_dep#']." | ".$row['Description']."</option> "); } //END LOOP echo(" </select> </td> </tr> <tr> <td width='10%' style='text-align:left;'> First Name: </td> <td style='text-align:left;'> <input type='text' name='FirstName' /> </td> </tr> <tr> <td width='10%' style='text-align:left;'> Middle Initial: </td> <td style='text-align:left;'> <input type='text' size='1' maxlength='1' name='Initial' /> </td> </tr> <tr> <td width='10%' style='text-align:left;'> Last Name: </td> <td style='text-align:left;'> <input type='text' name='LastName' /> </td> </tr> <tr> <td> </td> </tr> <tr> <td width='10%' style='text-align:left;'> Address1: </td> <td style='text-align:left;'> <input type='text' name='Addy1' /> </td> </tr> <tr> <td width='10%' style='text-align:left;'> Address2: </td> <td style='text-align:left;'> <input type='text' name='Addy2' /> </td> </tr> <tr> <td width='10%' style='text-align:left;'> Phone #: </td> <td style='text-align:left;'> <input type='text' name='Phone' /> </td> </tr> <tr> <td width='10%' style='text-align:left;'> City: </td> <td style='text-align:left;'> <input type='text' name='City' /> </td> </tr> <tr> <td width='10%' style='text-align:left;'> State: </td> <td style='text-align:left;'> <input type='text' maxlength='2' size='2' name='State' /> </td> </tr> <tr> <td width='10%' style='text-align:left;'> Zip: </td> <td style='text-align:left;'> <input type='text' maxlength='5' size='5' name='Zip' /> </td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <td colspan='2'> <input type='reset' value='Reset' name='action' /> <input type='submit' value='Create' name='action' /> </td> </tr> </table> </form> </fieldset> </td> <td width='48%'> <fieldset><legend>Available List</legend> "); //////////////////////////////// //* START LOOP FOR AVAILABLE *// //////////////////////////////// $datatable=$tblpre."Employee"; //* GATHER AVAILABLE *// $AvailableSQL="SELECT * FROM [".$datatable."]"; $AvailableResult=mssql_query($AvailableSQL) or die (mssql_get_last_message()); $AvailableCount=mssql_num_rows($AvailableResult); //* ARE THERE NE AVAILABLE??? *// if($AvailableCount>0) { //THERE ARE SOME echo(" <form action='../Ca_info/Cus_info.php' method='post'> <select multiple name='Employeez[]' size='".$AvailableCount."'> "); while($row=mssql_fetch_array($AvailableResult)) { echo("<option value='".$row['EmpID']."'>".$row['EmpID']." | ".$row['FirstName']." | ".$row['Initial']." | ".$row['LastName']."</option>".PHP_EOL); } echo(" </select> <br /><br /> <input type='submit' value='Details' name='action' /> <input type='submit' value='Delete' name='action' /> </form> "); } else { echo("<h3>None Available</h3>"); } //* END AVAILABLE LOOP *// echo(" </fieldset> </td> </tr> </table> </body> </html> "); ?> Second Page : <?php session_start(); require('../../config.php'); $Success=0; $Fail=0; /////////////////////// //* OPEN CONNECTION *// /////////////////////// $con = mssql_connect($dblocation,$dbusername,$dbpassword); if (!$con) { die('Could not connect: ' . mssql_error()); } mssql_select_db($dbname, $con); $datatable=$tblpre."Employee"; ////////////////// //* GET ACTION *// ////////////////// if(!(isset($_POST['action']))) { $action=''; } else { $action=$_POST['action']; } ///////////////////// //* WHICH ACTION? *// ///////////////////// if($action=='Create') { //////////////////////////// //* HARVEST CREATE INPUT *// //////////////////////////// if(!(isset($_POST['EmpID']))){$EmpID='';}else{$EmpID=$_POST['EmpID'];} if(!(isset($_POST['Department']))){$Department='';}else{$Department=$_POST['Department'];} if(!(isset($_POST['FirstName']))){$FirstName='';}else{$FirstName=$_POST['FirstName'];} if(!(isset($_POST['Initial']))){$Initial='';}else{$Initial=$_POST['Initial'];} if(!(isset($_POST['LastName']))){$LastName='';}else{$LastName=$_POST['LastName'];} if(!(isset($_POST['Addy1']))){$Addy1='';}else{$Addy1=$_POST['Addy1'];} if(!(isset($_POST['Addy2']))){$Addy2='';}else{$Addy2=$_POST['Addy2'];} if(!(isset($_POST['Phone']))){$Phone='';}else{$Phone=$_POST['Phone'];} if(!(isset($_POST['City']))){$City='';}else{$City=$_POST['City'];} if(!(isset($_POST['State']))){$State='';}else{$State=$_POST['State'];} if(!(isset($_POST['Zip']))){$Zip='';}else{$Zip=$_POST['Zip'];} //* SETUP SQL INJECTIONS *// $CreateSQL="INSERT INTO [".$datatable."] (EmpID, FirstName, Initial, LastName, Addy1, Addy2, Phone, Department, City, State, Zip) VALUES ('".$EmpID."', '".$FirstName."', '".$Initial."', '".$LastName."', '".$Addy1."', '".$Addy2."', '".$Phone."', '".$Department."', '".$City."', '".$State."', '".$Zip."')"; $CreateQuery=mssql_query($CreateSQL) or die(mssql_get_last_message()); //* RUN INJECTIONS *// if($CreateQuery) { $Success++;//Success } else { $Fail++;//FAILED } } //* ELSE *// if($action=='Delete') { //////////////////////////// //* HARVEST DELETE INPUT *// //////////////////////////// if(!(isset($_POST['Employeez']))){$Employeez='';}else{$Employeez=$_POST['Employeez'];} //* HOW MANY *// $EmpCount=count($Employeez); //* DECREMENT BY 1 TO MATCH ARRAYS *// $EmpCount--; /////////////////////////////// //* SETUP DELETE INJECTIONS *// /////////////////////////////// ///* IN FOR LOOP FOR MULTI */// /////////////////////////////// for($x=0;$x<=$EmpCount;$x++) { if($Employeez=='') { $Fail++; $NoEmpsSelected="You have not selected any Employees to delete!"; } else { $NoEmpsSelected=''; //INJECT QUERY $EmpDelete[$x]="DELETE FROM [".$datatable."] WHERE EmpID='".$Employeez[$x]."'"; //RUN INJECT $EmpQuery[$x]=mssql_query($EmpDelete[$x]) or die (mssql_get_last_message()); if($EmpQuery[$x]) { $Success++;//SUCCESS } else { $FAIL++;//FAILED } } } } //* ELSE *// if($action=='Details') { ///////////////////////////// //* HARVEST DETAILS INPUT *// ///////////////////////////// if(!(isset($_POST['Employeez']))){$Employeez='';}else{$Employeez=$_POST['Employeez'];} //* HOW MANY EMPZ? *// $EmpCount=count($Employeez); //* DECREMENT BY 1 TO MATCH ARRAYS *// $EmpCount--; //* CHANGE DATATABLE *// $datatable=$tblpre."cat_dep"; /////////////////////////////////// //* HARVEST DEPARTMENTS FROM DB *// /////////////////////////////////// $DepartmentSQL="SELECT * FROM [".$datatable."]"; $DepartmentResult=mssql_query($DepartmentSQL) or die (mssql_get_last_message()); //* RESET DATATABLE *// $datatable=$tblpre."Employee"; /////////////////////////////// //* START DETAILS INTERFACE *// /////////////////////////////// echo(" <table style='width:100%;height:100%;text-align:center;vertical-align:middle;'> <tr> <td> <form action='' method='post'> "); //////////////////////////// //* START LOOP FOR MULTI *// //////////////////////////// for($x=0;$x<=$EmpCount;$x++) { //////////////////////////////// //* HARVEST DB INFO FOR EMPz *// //////////////////////////////// $DetailsSQL[$x]="SELECT * FROM [".$datatable."] WHERE EmpID='".$Employeez[$x]."'"; $DetailsResult[$x]=mssql_query($DetailsSQL[$x]) or die (mssql_get_last_message()); while($row=mssql_fetch_array($DetailsResult[$x])) { $ID[$x]=$row[0]; $EmpID[$x]=$row[1]; $FirstName[$x]=$row[2]; $Initial[$x]=$row[3]; $LastName[$x]=$row[4]; $Addy1[$x]=$row[5]; $Addy2[$x]=$row[6]; $Phone[$x]=$row[7]; $Department[$x]=$row[8]; $City[$x]=$row[9]; $State[$x]=$row[10]; $Zip[$x]=$row[11]; } $Selected = ($Department[$x] == $row['cat_dep#'])? "SELECTED" : ""; ////////////////////////////////// //* CONTINUE DETAILS INTERFACE *// ////////////////////////////////// echo(" <fieldset><legend>".$EmpID[$x]."</legend> <table> <tr> <td> ID: </td> <td> <input type='text' value='".$EmpID[$x]."' name='UEmpID[".$x."]' /> </td> </tr> <tr> <td> Department: </td> <td> <select name='UDepartment[".$x."]'> "); while($row=mssql_fetch_array($DepartmentResult[$x])) { echo("<option ".$Selected." value='".$row['cat_dep#']."'>".$row['cat_dep#']." | ".$row['Description']."</option> "); } echo(" </select> </td> </tr> <tr> <td> First Name: </td> <td> <input type='text' value='".$FirstName[$x]."' name='UFirstName[".$x."]' /> </td> </tr> <tr> <td> Middle Initial: </td> <td> <input type='text' size='1' maxlength='1' value='".$Initial[$x]."' name='UInitial[".$x."]' /> </td> </tr> <tr> <td> Last Name: </td> <td> <input type='text' value='".$LastName[$x]."' name='ULastName[".$x."]' /> </td> </tr> <tr> <td colspan='2'> </td> </tr> <tr> <td> Address 1: </td> <td> <input type='text' value='".$Addy1[$x]."' name='UAddy1[".$x."]' /> </td> </tr> <tr> <td> Address 2: </td> <td> <input type='text' value='".$Addy2[$x]."' name='UAddy2[".$x."]' /> </td> </tr> <tr> <td> Phone #: </td> <td> <input type='text' size='10' maxlength='10' value='".$Phone[$x]."' name='UPhone[".$x."]' /> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </fieldset> "); } } //* ELSE *// if($action=='Update') { //DO UPDATE } //////////////////// //* SUCCESSFULL? *// //////////////////// if($Success>0) { //Successful echo("<table style='width:100%;height:100%;vertical-align:middle;text-align:center;'><tr><td><font color='green'><h1>Employee ".$action." Successful! x".$Success."</h1></font><br />Redirecting...</td></tr></table>"); echo("<meta http-equiv='refresh' content='1.5;url=http://".$domain.$sPath."admin/Edits/Employee.php'>"); } elseif($Fail>0) { //FAILED echo(" <table style='width:100%;height:100%;vertical-align:middle;text-align:center;'> <tr> <td> <font color='red'> <h1>Employee ".$action." FAILED! x".$Fail."</h1>".mssql_get_last_message()."</font> "); if($action=='Delete'){echo("<br /><br />".$NoEmpsSelected);} if($action=='Create'){echo('');} echo(" </td> </tr> </table> "); } ?>
  7. No the department # name everything but the auto incremented ID is created by the user. Same with Employee
  8. ok i think i see what your saying btw my db is setup like this I have a table for departments themselves (departments/categories) Departments ____________ cat_dep# Description TimeSlots Hours ID (autoincrement) Then I have a table for employee's Employee ____________ ID (autoincrement) EmpID FirstName Initial LastName Addy1 Addy2 Phone Department * City State Zip hope that helps. ps(The specific "Piece" of the Department that gets put in the employee's "Department" section is the Department# [aka cat_dep#] ) that number is assigned by the user so i have no way of telling what it is. could be any number from 1-999
  9. I'm trying to think how i can word this correctly.. Here is my logic: 1st: Figure out which department was intially selected by the user for that employee 2nd: Generate a select option for each of the departments in the database 3rd: Compare initial selected department agaist each department listed from the database 4th: If match exists select the appropriate select option. #PROBLEM# 1st: How do I compare the intial value agaist a list of variable values to gain a match. 2nd: Once matched how do I then Select the appropriate option from the list? 3rd: While still giving the user the rest of the list of options.. (in case they want to change the department.) *Thoughts* I guess if I could somehow say in SQL SELECT * FROM departsments EXCEPT (The users default department) then I could first get the users department.. select it and then finish the list.. But I don't think you can do that with SQL really really stuck on this one guys.. thanks in advance I appreciate any suggestions.
  10. here is my loop for the departments on the "Details" screen <?php //* GET DEPARMENTS *// $DepartmentSQL="SELECT * FROM [".$datatable."]"; $DepartmentResult=mssql_query($DepartmentSQL) or die (mssql_get_last_message()); while($row=mssql_fetch_array($DepartmentResult)) { echo("<option value='".$row['cat_dep#']."'>".$row['cat_dep#']." | ".$row['Description']."</option> "); } ?> I hope everyone understands what I'm asking.. I kno it is confusing. If I had a static amount of options then I could do this: <?php if($Department=='100') { $Selected1='Selected'; } else { $Selected1=''; } if($Department=='200') { $Selected2='Selected'; } else { $Selected2=''; } echo(" <select name='Departments'> <option ".$Selected1." value='100'>Department1</option> <option ".$Selected2." value='200'>Department2</option> </select> "); ?>
  11. I thought of that tho.. the only problem is then how do they choose another department? See it like this First I have a screen where you can setup departments unlimited amount then on the employee's screen you can select a default department for that employee. then after creation of the employee you can view the details and change the details if you like. so there needs to be the whole list of departments in the dropdown.. with the department selected that was chosen during creation. so I can list out the departments just fine.. I can even figure out which department the user selected. my problem is how do I select the selected option.
  12. lunch brb 1hr have to compile a viewable selection of code for you... its alot of code. and its spread across mutliple pages.
  13. hello all, I'm having a logic problem here I'm working on a wep app where users are allowed to create "Departments" as many as they want to. They are also allowed to create "Employees" as many as they want.. when creating an employee you must choose a default department for that employee.. Which is fine.. after creation the users are then allowed to view the "Details" for the newly created employee. In the details section.. is the same form as the create section.. the only difference is that the forms inputs are now filled in with the information submitted previously. (So the user may update this information) My problem is that how do you say in code: List all departments.. and select department the user has in the DB (the one setup at creation).. now I know if I had a static list of departments I could simply say if($department=='ThisDepartment') { $Department1="SELECTED"; } else { $Department1=''; } then in the select form I can put this <option $Department1 value='Department1'>Department 1</option> <option $Department2 value='Department2'>Department 2</option> but how do i do this with dynamic options?
  14. ok..have to wait till i'm home tho.
  15. no i'm running broadband cable strait to the modem it doesn't prompt me to login.. it just tells me that the website requires it.
  16. well in the norm its says C:\blah\blah\htdocs like you say.. but the examples said it should be the other way.. I'll try that tonite and see if that works. why would I be getting the "This website requires you to login" message tho?
  17. well I thought I had this solved last nite but I do not.. Once I went back and checked mail.mysite.com it worked and went to the right place.. but then once I checked mysite.com it went to the same place as mail.mysite.com and it should not.. I tried messing around with it alot last nite but to no avail. so its still not working for me.. Once I thought I had it but then it said that my website was requiring that I login. and neither mail.mysite.com or mysite.com would work. I'm finding it hard to believe this is so simple being that I've setup everything else with such ease.. I mean installing and configuring apache with mysql and php5 was easier time then i'm having with this. the examples on apache.org say to do this NameVirtualServer *:80 <VirtualHost *:80> ServerName mail.mysite.com DocumentRoot /htdocs/webmail //Still getting confused on this part.. where does the this start at? </VirtualHost> <VirtualHost *:80> ServerName mysite.com DocumentRoot /htdocs </VirtualHost> my web root is htdocs.. the default for apache. when i put the above code into my httpd.conf file thats when I get the "This website requires you to login" message when I take it back out it all just goes to the webroot. Am I missing something? should I make a new set of directories?? I seen an example that said to do this c:/vhosts/site1 and c:/vhosts/site2 do you think that would be better then just htdocs and htdocs/webmail?
  18. this part was really confusing me <VirtualHost> ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /www/mydomain.com // and this here </VirtualHost> <VirtualHost> ServerName mail.mydomain.com DocumentRoot /www/mail.mydomain.com //this here </VirtualHost> But I got it working ne how by trying different combos finally got it working by say this instead DocumentRoot mypath/webmail //WITHOUT THE mail.mydomain.com.. that is what is so confusing about it.. and all the examples have this. but i did get it working.. thanks for the help thorpe..
  19. i'll be giving the virtual host a try once I get home. lol @work right now
  20. well then its a good thing we came across this aye.. Running XP HOME with apache 2.x and PHP5 I seldom leave any settings I know about at default.. This server is my personal server that I use to practice on and run my website. I was forced out of school my junior year.. got my GED in 4 days. honors GED I'm what I like to consider a jackOfAll Trades.. I paint cars and do autobody.. work on engines..I like to invent things.. I've worked construction jobs.. played sports for the better half of my life.. If it exists I've done it or am on my way to doing it. I am 21 btw 22 soon
  21. what can you tell me about electromagnetic induction?? ya kno.. aren't iptables for linux ne ways
  22. hey don't be putting people down here now.. no cause for that.. Sory my mommy and daddy didn't pay for me to go to college I had to learn everything myself.. lil hard to get all the info when you get in pieces
  23. ok, well i kept getting a wrong definition for vhost then.. now your making some sense So how do i set this up.. say my structure is this mysite.com goes to: htdocs/ mail.mysite.com goes to: htdocs/mail/ also.. why would my server be comprimised?
  24. are you talking about this?? IP-based virtual hosts ?
  25. how is Vhost my solution??? VHOST: Also known as an Internet Presence Provider (IPP), Vhost is short for virtual host and is a remote host computer that is run and maintained by another company. By having another company or ISP run and maintain the computers that host the files, this enables an individual or company not to have to worry about the maintenance, setup, upgrade, or security of a computer or group of computers. I don't have any other server but one.. and I don't need to remote to it. And my server is not comprimised sry if this is disrepectful towards you.. but everything your saying to me right now.. sounds like its coming from a pyscho person. It makes no sense.
×
×
  • 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.