
ublapach
Members-
Posts
76 -
Joined
-
Last visited
Never
Everything posted by ublapach
-
errors dont know how to not show them of page
ublapach replied to ublapach's topic in PHP Coding Help
is there a way the silence the errors that show up even after i fix this code? -
errors dont know how to not show them of page
ublapach replied to ublapach's topic in PHP Coding Help
oh my bad thats cause it not on that page it on this one http://ceiscorp.com/newsite/bidrequest.php -
ok heres the page im building and the errors are at the bottom http://ceiscorp.com/newsite and heres the code i have for the page <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTDjavascript:void(0); XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <?PHP require_once("db_connx.php"); $sql="SELECT * FROM bidrequests;"; $result= @mysql_query($sql); if (@$_POST['co_name'] == "" && @$_POST['op']=="ds"){ $co_name_err = "<font color=red>Please Enter Your Company Name!</font><br/>"; $send = "no"; } if (@$_POST['first_name'] == "" && @$_POST['op']=="ds"){ $first_name_err = "<font color=red>Please Enter Your First Name!</font><br/>"; $send = "no"; } if (@$_POST['last_name'] == "" && @$_POST['op']=="ds"){ $last_name_err = "<font color=red>Please Enter Your Last Name!</font><br/>"; $send = "no"; } if (@$_POST['email'] == "" && @$_POST['op']=="ds"){ $email_err = "<font color=red>Please Enter an Email Address!</font><br/>"; $send = "no"; } if (@$_POST['areacode'] == "" && @$_POST['op']=="ds"){ $areacode_err = "<font color=red>Please Enter the Area Code of Your Phone Number!</font><br/>"; $send = "no"; } if (@$_POST['first3'] == "" && @$_POST['op']=="ds"){ $first3_err = "<font color=red>Please Enter the First Three Digits of Your Phone Number!</font><br/>"; $send = "no"; } if (@$_POST['last4'] == "" && @$_POST['op']=="ds"){ $last4_err = "<font color=red>Please Enter the Last Four Digits of Your Phone Number!</font><br/>"; $send = "no"; } if (@$_POST['job_desc'] == "" && @$_POST['op']=="ds"){ $job_desc_err = "<font color=red>Please Enter a Breif Desciption of the Job!</font><br/>"; $send = "no"; } if (@$_POST['city'] == "" && @$_POST['op']=="ds"){ $city_err = "<font color=red>Please Enter The City Where Your Company Is Located!</font><br/>"; $send = "no"; } if (@$_POST['state'] == "Initial" && @$_POST['op']=="ds"){ $state_err = "<font color=red>Please Select the State Where Your Company Is Located!</font><br/>"; $send = "no"; } if (@$_POST['zipcode'] == "" && @$_POST['op']=="ds"){ $zipcode_err = "<font color=red>Please Enter a Zip Code!</font><br/>"; $send = "no"; } ?> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-2" /> <meta name="author" content="Luka Cvrk (www.solucija.com)" /> <link rel="stylesheet" href="newsite/style.css" type="text/css" /> <title>CEIS/TECHSICO</title> </head> <body> <div id="content"> <div id="header"> <div id="logo"> <img src="newsite/images/techsico banner.gif" height="235" width="900" align="middle" /></div> <div id="tabs"> <ul> <li><a href="index.php" >Home</a></li> <li><a href="devisions.htm">Devisions</a></li> <li><a href="products.htm">Products</a></li> <li><a href="engproc.htm">Engineering</a></li> <li><a href="newsite/tracking/bidrequest2.php" class="current">Bid Form</a></li> <li></li> <li></li> <li><a href="staff.htm" >Staff</a></li> <li><a href="contact.htm" >Contact Us</a></li> </ul> <div id="search"> </div> </div> <div class="left"> <div class="left_articles"> <p> <?php $form_block = " <form id=\"bidrequest\" name=\"form1\" method=\"POST\" action=\"$PHP_SELF\"> <label> <h1>Information About You and Your Company </h1> <hr /> <h2>Company Name: <input type=\"text\" name=\"co_name\" tabindex=\"1\" size=\"50\" align=\"right\" value=\"" .@$_POST['co_name']. "\" /> <br/> ".@$co_name_err." <br /> <br /> First Name: <input type=\"text\" name=\"first_name\" tabindex=\"2\" value=\"" .@$_POST['first_name']. "\" /> <br/>".@$first_name_err." </h2> <h2> Last Name: <input type=\"text\" name=\"last_name\" tabindex=\"3\" value=\"" .@$_POST['last_name']. "\" /><br/>".@$last_name_err." </label> </h2> <h2> <label> E-mail Address: </label> <input type=\"text\" name=\"email\" tabindex=\"4\" value=\"" .@$_POST['email']. "\" /><br/>".@$email_err." <label><br /> <br /> Phone Number: ( <input type=\"text\" name=\"areacode\" size=\"3\" maxlength=\"3\" tabindex=\"5\" value=\"" .@$_POST['areacode']. "\" /> ) <input type=\"text\" name=\"first3\" size=\"3\" maxlength=\"3\" tabindex=\"6\" value=\"" .@$_POST['first3']. "\" /> - <input type=\"text\" name=\"last4\" size=\"4\" maxlength=\"4\" tabindex=\"7\" value=\"" .@$_POST['last4']. "\" /><br/>".@$areacode_err."<br/>".@$first3_err."<br/> ".@$last4_err." </label> <br /> <br /> </h2> <h1>Job Details</h1><br /><hr /> <br /> <label> <h2>Job Description: <br/> <input type=\"text\" name=\"job_desc\" size=\"50\" value=\"" .@$_POST['job_desc']. "\" /><br/>".@$job_desc_err." <br /> <br /> Job Location: (City) <input type=\"text\" name=\"city\" size=\"15\" value=\"" .@$_POST['city']. "\"/><br/>".@$city_err."<br/> (state) <select name=\"state\" value=\"" .@$_POST['state']. "\" id=\"state\"><br/>".@$state_err." <option value=\"Intial\">Please Select State</option> <option value=\"".@$_POST['state']."\">" .@$_POST['state']." </option> <option value=\"AK\">AK - Alaska</option> <option value=\"AL\">AL - Alabama</option> <option value=\"AR\">AR - Arkansas</option> <option value=\"AZ\">AZ - Arizona</option> <option value=\"CA\">CA - California</option> <option value=\"CO\">CO - Colorado</option> <option value=\"CT\">CT - Connecticut</option> <option value=\"DC\">DC - Dist of Columbia</option> <option value=\"DE\">DE - Delaware</option> <option value=\"FL\">FL - Florida</option> <option value=\"GA\">GA - Georgia</option> <option value=\"HI\">HI - Hawaii</option> <option value=\"IA\">IA - Iowa</option> <option value=\"ID\">ID - Idaho</option> <option value=\"IL\">IL - Illinois</option> <option value=\"IN\">IN - Indiana</option> <option value=\"KS\">KS - Kansas</option> <option value=\"KY\">KY - Kentucky</option> <option value=\"LA\">LA - Louisiana</option> <option value=\"MA\">MA - Massachusetts</option> <option value=\"MD\">MD - Maryland</option> <option value=\"ME\">ME - Maine</option> <option value=\"MI\">MI - Michigan</option> <option value=\"MN\">MN - Minnesota</option> <option value=\"MO\">MO - Missouri</option> <option value=\"MS\">MS - Mississippi</option> <option value=\"MT\">MT - Montana</option> <option value=\"NC\">NC - North Carolina</option> <option value=\"ND\">ND - North Dakota</option> <option value=\"NE\">NE - Nebraska</option> <option value=\"NH\">NH - New Hampshire</option> <option value=\"NJ\">NJ - New Jersey</option> <option value=\"NM\">NM - New Mexico</option> <option value=\"NV\">NV - Nevada</option> <option value=\"NY\">NY - New York</option> <option value=\"OH\">OH - Ohio</option> <option value=\"OK\">OK - Oklahoma</option> <option value=\"OR\">OR - Oregon</option> <option value=\"PA\">PA - Pennsylvania</option> <option value=\"RI\">RI - Rhode Island</option> <option value=\"SC\">SC - South Carolina</option> <option value=\"SD\">SD - South Dakota</option> <option value=\"TN\">TN - Tennessee</option> <option value=\"TX\">TX - Texas</option> <option value=\"UT\">UT - Utah</option> <option value=\"VA\">VA - Virginia</option> <option value=\"VT\">VT - Vermont</option> <option value=\"WA\">WA - Washington</option> <option value=\"WI\">WI - Wisconsin</option> <option value=\"WV\">WV - West Virginia</option> <option value=\"WY\">WY - Wyoming</option> </select><br /><br/> Zipcode:<br/> <input type=\"text\" name=\"zipcode\" value=\"" .@$_POST['zipcode']."\" /><br/>".@$zipcode_err." <br /><br/> Attach a more detailed description:<br /> <input type=\"file\" name=\"file1\" value=\"".@$_POST['file1']."\" /> <br /> <input type=\"file\" name=\"file2\" value=\"".@$_POST['file2']."\" /> <br /> Additional Comments:<br /> <textarea rows=\"10\" name=\"details\" cols=\"65\"></textarea> </h2> <input type=\"hidden\" name=\"op\" value=\"ds\"> <input type=\"submit\" name=\"submit\" value=\"Submit Bid Request\"> <input name=\"reset\" type=\"reset\" id=\"reset\" value=\"Reset Form\"> </form>" ?> <?PHP if(@$_POST['op'] !="ds"){ echo $form_block; } else if (@$_POST['op']=="ds"){ if(@$send !="no"){ $sqlinsert = "INSERT INTO bidrequests (co_name, first_name, last_name, email, phone, job_desc, city, state, file1, file2, details) VALUES ('$_POST[co_name]', '$_POST[first_name]', '$_POST[last_name]', '$_POST[email]', '$_POST[areacode]'"."'$_POST[first3]'"."'$_POST[last4]', '$_POST[job_desc]','$_POST[city]', '$_POST[state]', '$_POST[file1]','$_POST[file2]','$_POST[details]')"; $resultlog = mysql_query($sqlinsert); echo "Your Request has Been Processed Please Wait 2 to 3 days For a Phone Call or an Email Reply!"; } if(@$send =="no"){ echo $form_block;} } ?> </p> </div> </div> <div id="right"> <div class="boxtop"> <div class="boxtop"></div> <div class="box"> <p>To Tack a job <a href="index.php">click here</a> </p> <p></p> </div> </div> <p> </div> <!--<div class="boxtop"></div> <div class="box"> <p>News Can Go Here!</p> </div>--> </div> <div class="footer"> <?php $phone = "$areacode, $first3, $last4"; $subject = "Bid from Online form from $co_name"; $contents= "$co_name, $first_name, $last_name, $email, $phone, $job_desc, $city, $state, $zipcode, $details"; $to = "[email protected]"; $from_header = "From: $email"; if(@$_POST['op']=="ds") { mail($to, $subject, $contents, $from_header); } else { print("<HTML><BODY>Error, no comments were submitted!"); print("</BODY></HTML>"); } ?> <p>© <a href="mailto:[email protected]">Michael LaPach</a></p> </div> </div> </body> </html> i just want to know how to get rid of the errors at the bottom
-
[SOLVED] Getting an error when script is rendered
ublapach replied to ublapach's topic in PHP Coding Help
ok thanks -
Im getting this error Parse error: parse error, unexpected $ in /usr/home/jlytal/public_html/newsite/projnew.php on line 513 when i try to load this page heres the code <? require ("./siteclas.php"); $dbh = new CEIS_DB; require ("./auth.php"); $username = $_SESSION['username']; $recUser = $dbh->UserInfo($username); //REDIRECT IF THE USER IS NOT AN ADMIN OR IS A CUSTOMER WITHOUT ACCESS TO CREATE NEW PROJECTS if ($recUser['accesslvl'] != "admin") { // Get the project creation access records $sQuery = "SELECT pca.`projectcreationaccessid`, wu.`username`, wu.`fname`, wu.`lname` " . "FROM `projectcreationaccess` pca " . "INNER JOIN `webusers` wu ON wu.`username` = pca.`ceis_username` " . "WHERE pca.`cust_username` = '$recUser[username]' " . "ORDER BY pca.`ceis_username` ASC"; $resProjectCreationAccess = $dbh->query($sQuery); if (!$resProjectCreationAccess || mysql_num_rows($resProjectCreationAccess) == 0) { $sURL = "http://" . $_SERVER['SERVER_NAME'] . "index.php"; header("Location: $sURL"); exit; } } // GET THE ENGINEER'S INFO IF ONE HAS BEEN SELECTED if (isset($_POST[selEngName])) $recEngineer = $dbh->UserInfo($_POST[selEngName]); else $recEngineer = $recUser; //************************************************************ // CREATE A NEW JOB IF THE FORM HAS BEEN SUBMITTED //************************************************************ if ($_POST[beenSubmitted]) { // MAKE SURE THAT THE JOB NUMBER IS UNIQUE $query = "SELECT COUNT(*) as numrows FROM `projects` WHERE jobnum=$_POST[txtJobNum]"; $row = $dbh->query($query); $ticketNumCount = mysql_result($row, 0); if ((int) $ticketNumCount > 0) { echo "Ticket Number $_POST[txtJobNum] already exists. This must be a unique value."; } else { // MAKE A DIRECTORY FOR THE UPLOADS mkdir("./" . $_POST[txtJobNum], 0777) or die("Could not create directory /tracking/" . $_POST[txtJobNum] . " for job #" . $_POST[txtJobNum] . ". Does this job number already exist? Are the permissions incorrect?<br><br>Use the back button to return to the form."); // CREATE A BLANK INDEX.PHP TO PREVENT FILE BROWSING touch("./" . $_POST[txtJobNum] . "/index.php") or die ("Could not create a blank index.php. Please check permissions or contact the admin/developer"); require("./fileupload-class.php"); $path = "./" . $_POST[txtJobNum] . "/"; $mode = 2; $my_uploader = new uploader('en'); $my_uploader->max_filesize(20000000); $my_uploader->max_image_size(1920, 1080); $filenameArray = array(); //GET THE PICTURES FIRST for ($i = 1; $i <= 10; $i++) { $upload_file_name = "upFile" . $i; if ($_FILES[$upload_file_name]['name'] != '') { // UPLOAD the file if ($my_uploader->upload($upload_file_name, $acceptable_file_types, $default_extension)) { $my_uploader->save_file($path, $mode); } if ($my_uploader->error) { echo $my_uploader->error . "<br>\n"; } else { // Successful upload! //print ($my_uploader->file['name'] . " was uploaded successfully.<br>"); $filenameArray[$x++] = $my_uploader->file['name']; } } } //2004-09-27 RKB: ADD CAPABILITY FOR MULTIPLE SOWS (3 ENABLED) //UPLOAD THE SOWS for ($i = 1; $i <= 10; $i++) { $upload_file_name = "upFileSOW" . $i; if ($_FILES[$upload_file_name]['name'] != '') { //UPLOAD THE FILE if ($my_uploader->upload($upload_file_name, $acceptable_file_types, $default_extension)) { $my_uploader->save_file($path, $mode); } if ($my_uploader->error) { echo $my_uploader->error . "<br>\n"; } else { // SUCCESSFUL UPLOAD! $sFileSOW .= $my_uploader->file['name'] . ","; } } } if (strlen($sFileSOW) > 0) $sFileSOW = substr($sFileSOW, 0, strlen($sFileSOW) - 1); //2004-09-27 RKB: REMOVED AS-BUILTS FROM PROJNEW FORM //UPLOAD THE AS-BUILT //if ($my_uploader->upload("upFileAsBuilt", $acceptable_file_types, $default_extension)) { // $my_uploader->save_file($path, $mode); //} //if ($my_uploader->error) { // echo $my_uploader->error . "<br>\n"; //} else { //print ($my_uploader->file['name'] . " was uploaded successfully.<br>"); // $sFileAsBuilt = $my_uploader->file['name']; //} //CHMOD THE NEW DIRECTORY SO THE FILES CAN BE DELETED BY THE FTP USER'S ACCOUNT chmod ($path, 0777); //MAKE A STRING WITH THE PICTURE NAMES foreach ($filenameArray as $sName) $sPics .= $sName . ","; $sPics = substr($sPics, 0, strlen($sPics) - 1); $sNow = date("Y-m-d G:i:s"); //DO THE DB INSERT if ($recUser['accesslvl'] == "admin") { $create_engname = $_POST[selEngName]; } else { $create_engname = $recUser['username']; } $sQuery = "INSERT INTO `projects` ( `custid`, `po_num`, `wo_num`, `jobtitle`, `ceis_engineer`, `status`, `jobnum`, `stickernum`, `ceis_invoice`, `details`, `date_start`, `date_projected`, `file_sow`, `file_asbuilt`, `pics`, `ceis_admin`, `date_created`, `city`, `state`, `site_id`, `email_distro`, `bidprice`, `DivisionID` ) VALUES ( '$create_engname', '$_POST[txtPO]', '$_POST[txtWO]', '$_POST[txtCEISJobTitle]', '$_POST[selCEISName]', '$_POST[selJobStatus]', $_POST[txtJobNum], $_POST[txtStickerNum], '$_POST[txtInvoiceNum]', '$_POST[txtADetails]', '$_POST[txtStartDate]', '$_POST[txtCompleteDate]', '$sFileSOW', '$sFileAsBuilt', '$sPics', '$recUser[username]', '$sNow', '$_POST[txtCity]', '$_POST[selState]', '$_POST[txtSiteID]', '$_POST[txtA_Emails]', '$_POST[txtBidPrice]', $_POST[selCEISDivision] )"; $resIns = $dbh->query($sQuery); //echo $sQuery; if (!$resIns) { echo ("INSERT query failed: " . mysql_error()) . "<br/><br/>" . $sQuery; exit; } // 2006-12-31 RKB // ADD MULTIPLE CEIS ENGINEERS WITH ACCESS TO THE PROJECT for ($i = 2; $i <= 5; $i++) { $ceis_name = "selCEISName" . $i; if ($_POST[$ceis_name] <> "NOTSELECTED") { $sQuery = "INSERT INTO `projectengineers` ( `ProjectEngineersID` , `username` , `jobnum` ) VALUES (NULL , '$_POST[$ceis_name]', '$_POST[txtJobNum]')"; $resIns = $dbh->query($sQuery); } } //GET THE PROJET DETAILS AGAIN $recProject = $dbh->ProjectDetails($_POST[txtJobNum]); //GET THE FULL NAME AND EMAIL/PHONE OF THE CEIS ENGINEER $recCEISName = $dbh->UserInfo($_POST[selCEISName]); //SEND AN EMAIL $content = "New " . $recProject[DivisionName] . " Ticket #" . date("Ymd", $recProject[ftime]) . $_POST[txtJobNum] . "\r\n" . "\r\nSticker Number: " . $recProject[stickernum] . "\r\nCustomer/Engineer Name: " . $recEngineer[fname] . " " . $recEngineer[lname] . "\r\nOffice Phone #: " . $_POST[txtPhone] . "\r\nEmail Address: " . $_POST[txtEmail] . "\r\nCompany Name: " . $_POST[selCompany] . "\r\n\r\n" . $recProject[DivisionName] . " Job Title: " . $_POST[txtCEISJobTitle] . "\r\n" . $recProject[DivisionName] . " Assigned Engineer: " . $recCEISName[fname] . " " . $recCEISName[lname] . "\r\n Phone: " . $recCEISName[phone_office] . "\r\n Email: " . $recCEISName[email] . "\r\nWork Order #: " . $_POST[txtWO] . "\r\n\r\nPO #: " . $_POST[txtPO] . "\r\n" . $recProject[DivisionName] . " Invoice #: " . $_POST[txtInvoiceNum] . "\r\nJob Status: " . $_POST[selJobStatus] . "\r\nJob Details: " . $_POST[txtADetails] . "\r\nCity: " . $_POST[txtCity] . "\r\nState: " . $_POST[selState] . "\r\nSite ID: " . $_POST[txtSiteID] . "\r\n\r\nStart Date: " . $_POST[txtStartDate] . "\r\nProjected Completion Date: " . $_POST[txtCompleteDate]; if ($sFileSOW != '') { $content .= "\r\n\r\nCopy of SOW:\r\n" . "http://" . $_SERVER['SERVER_NAME'] . "/tracking/" . $_POST[txtJobNum] . "/" . $sFileSOW; } //RKB 2004-09-27 REMOVED AS-BUILTS FROM NEW PROJECT FORM //if ($sFileAsBuilt != '') { // $content .= "\r\n\r\nCopy of AsBuilt:\r\n" . "http://" . $_SERVER['SERVER_NAME'] . "/tracking/" . $_POST[txtJobNum] . "/" . $sFileAsBuilt; //} if (!empty($filenameArray)) { $content .= "\r\n\r\nPictures:"; foreach ($filenameArray as $sName) { $content .= "\r\n" . "http://" . $_SERVER['SERVER_NAME'] . "/tracking/" . $_POST[txtJobNum] . "/" . $sName; } } $content .= "\r\n\r\nTo view this project, please go to http://" . $_SERVER['SERVER_NAME'] . "/tracking/projlist.php?id=" . $_POST[txtJobNum] . " and log in with your " . "assigned username and password.\r\n"; //PRODUCTION $totag = "CEIS/TECHSICO Sales <[email protected]>"; //DEVELOPMENT //$totag = ""; $fromtag = "From: \"CEIS/TECHSICO PROJECT CREATION\" <[email protected]>\nX-Mailer: PHP/" . phpversion(); $subjtag = "New Project #" . $_POST[txtJobNum] . " Created"; mail($totag, $subjtag, $content, "$fromtag\n" . "Cc: $recCEISName[email] \n" . "Bcc: \n" . "X-Mailer: PHP 4.x"); // RKB 2007-10-25 Log Email $dbh->LogEmail($totag, $subjtag, $_POST[txtJobNum]); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-2" /> <meta name="author" content="Luka Cvrk (www.solucija.com)" /> <link rel="stylesheet" href="style.css" type="text/css" /> <script type="text/javascript" src="newsite/login/char.js"></script> <SCRIPT LANGUAGE="JavaScript" SRC="/include/javascript_all.js"></SCRIPT> <script type="text/javascript"> function user() { document.getElementById('username').value=""; } function pass() { document.getElementById('passwd').value=""; } </script> <SCRIPT Language="Javascript"> function TryCallFunction() { var sd = document.MForm.mydate1.value.split("-"); document.MForm.iday.value = sd[1]; document.MForm.imonth.value = sd[0]; document.MForm.iyear.value = sd[2]; } var styleVar = "td { font-family:Courier; font-size:12 }"; function subChangeCust(f, g) { if (f.value != 'NOTSELECTED') { this.document.frmNewProject.CompanyChanged.value = g; this.document.frmNewProject.submit(); } } function subSubmitForm() { f = this.document.frmNewProject; if (f.txtCEISJobTitle.value == '') { alert ("You must enter a job title to create a new job."); return 0; } if (isNaN(f.txtJobNum.value) || f.txtJobNum.value == '') { alert ("The CEIS job number must be a number with no spaces."); return 0; } if (isNaN(f.txtStickerNum.value) || f.txtStickerNum.value == '') { alert ("The CEIS Sticker number must be a number with no spaces."); return 0; } f.BeenSubmitted.value = 1; f.submit(); } function showdiv(sDiv) { var obj; if(document.getElementById) {obj = document.getElementById(sDiv); }else{obj = document.all[sDiv];} if (obj.style.display == "") { obj.style.display = "none"; }else{ obj.style.display = ""; } } </SCRIPT> <title>CEIS/TECHSICO</title> </head> <body> <form name="frmNewProject" enctype="multipart/form-data" method="POST" action="<? echo $PHP_SELF ?>"> <input type="hidden" name="BeenSubmitted" value="0"> <input type="hidden" name="CompanyChanged" value="0"> <? if ($_POST[beenSubmitted]) { // 2004-10-15 RKB : AFTER CREATING THE RECORD, VIEW SHOULD COME UP echo "<SCRIPT LANGUAGE=\"JAVASCRIPT\">window.open('projview.php?ProjectNum=$_POST[txtJobNum]', '', \"fullscreen=no,toolbar=yes,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=775,height=590,left=10,top=10\");</SCRIPT>"; } ?> <div id="content"> <div id="header"> <div id="logo"> <img src="newsite/images/techsico banner.gif" height="235" width="900" align="middle" /></div> <div id="tabs"> <ul> <li><a href="index.php" class="current">Home<br/> </a></li> <li><a href="devisions.php">Devisions</a></li> <li><a href="products.php">Products</a></li> <li><a href="engproc.php">Engineering</a></li> <li><a href="bidrequest.php">Bid Form</a></li> <li></li> <li></li> <li><a href="staff.php" >Staff</a></li> <li><a href="contact.php" >Contact Us</a></li> </ul> <div id="spacer"> <p></p> </div> </div> <div class="left"> <div class="left_articles"> <p><table border="0" cellspacing="0" cellpadding="0" width="460"> <tr><td width="460" valign="top" height="6"></td></tr> <tr> <td width="460" valign="top"> <font face="Arial" style="font-size:16px" color="#003366"><b>Select Customer</b></font> </td> </tr> <tr><td width="460" valign="top" bgcolor="#336699" height="2"></td></tr> <tr><td width="460" valign="top" height="6"></td></tr> <tr> <td width="460" valign="top" class="formtext"><span style="color:red">*</span> Company Name</td> </tr> <tr> <td width="460" valign="baseline"> <? if ($recUser['accesslvl'] == "admin") { ?> <select name="selCompany" style="width:460px;" onChange="subChangeCust(this, 1);"> <? echo $dbh->co_box(); ?> </select> <? } else { ?> <select name="selCompany" style="width:460px; disabled:true;" disabled> <option value="<? echo $recUser['company'] ?>"><? echo $recUser['company'] ?></option> </select> <? } ?> </td> </tr> <? if (isset($_POST[selCompany]) || $recUser['accesslvl'] != "admin") { ?> <tr><td height="6"></td></tr> <tr> <td width="460" valign="top" class="formtext"><span style="color:red">*</span> Customer/Engineer Name</td> </tr> <tr> <td width="460" valign="baseline"> <? if ($recUser['accesslvl'] == "admin") { ?> <select name="selEngName" style="width:460px;" onChange="subChangeCust(this, 0);"> <? $cust_options = $dbh->eng_box(false, $_POST[selEngName], true, $_POST[selCompany]); echo $cust_options; ?> <? } else { ?> <select name="selEngName" style="width:460px; disabled:true;" disabled> <option value="<? echo $recUser['username'] ?>"><? echo $recUser['lname'] . ", " . $recUser['fname'] ?></option> </select> <? } ?> </select> </td> </tr> <? } if ((isset($_POST[selEngName]) && !$_POST[CompanyChanged]) || $recUser['accesslvl'] != "admin") { //RKB 2006-07-29 Get Next Ticket # $query = "SELECT jobnum FROM `projects` ORDER BY date_created DESC LIMIT 0,1"; $result = $dbh->query($query); $nextJob = (int) mysql_result($result,0) + 1; ?> <tr><td height="6"></td></tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="460"> <tr> <td width="200" valign="top" nowrap class="formtext">Office Phone #</td> <td width="54"></td> <td width="200" valign="top" nowrap class="formtext">Email Address</td> </tr> <tr> <td width="200" valign="baseline"> <input type="text" name="txtPhone" value="<? echo $recEngineer[phone_office] ?>" style="width:200px" maxlength="40" onFocus="blur();"> </td> <td width="54"></td> <td width="200" valign="baseline"> <input type="text" name="txtEmail" value="<? echo $recEngineer[email] ?>" style="width:206px;" maxlength="40" onFocus="blur();"> </td> </tr> <tr><td colspan="3" height="15"></td></tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="460"> <tr> <td width="460" valign="top"> <font face="Arial" style="font-size:16px" color="#003366"><b>Input Project Details</b></font> </td> </tr> <tr><td width="460" valign="top" bgcolor="#336699" height="2"></td></tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:10px">Ticket Number (The system will prefix with project creation date)</td> </tr> <tr> <td width="460" colspan="4" valign="baseline"> <input type="text" name="txtJobNum" style="width:460px;" maxlength="6" value="<? echo $nextJob ?>"> </td> </tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:10px">Work Order Number</td> </tr> <tr> <td width="460" colspan="4" valign="baseline"> <input type="text" name="txtWO" style="width:460px;" maxlength="30" value="<? echo $_POST[txtWO] ?>"> </td> </tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:6px">PO Number</td> </tr> <tr> <td width="460" colspan="4" valign="baseline"> <input type="text" name="txtPO" style="width:460px;" maxlength="30" value="<? echo $_POST[txtPO] ?>"> </td> </tr> <tr> <td colspan="3" valign="top" class="formtext" style="padding-top:6px">CEIS Invoice Number</td> </tr> <tr> <td colspan="3" valign="baseline"> <input type="text" name="txtInvoiceNum" style="width:460px;" value="<? echo $_POST[txtInvoiceNum] ?>"> </td> </tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:6px"><span style="color:red">*</span> CEIS Job Title/Desc</td> </tr> <tr> <td width="460" colspan="4" valign="baseline"> <input type="text" name="txtCEISJobTitle" style="width:460px;" value="<? echo $_POST[txtCEISJobTitle] ?>"> </td> </tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:6px">Bid Price</td> </tr> <tr> <td width="460" colspan="4" valign="baseline"> <input type="text" name="txtBidPrice" style="width:460px;"> </td> </tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:6px"> <table width="460" border="0" cellpadding="0" cellspacing="0"> <tr><td width="300" class="formtext">City</td> <td width="160" class="formtext" align="right">State</td> </tr> </table> </td> </tr> <tr> <td width="460" colspan="4" valign="baseline"> <table width="460" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="300"> <input type="text" name="txtCity" style="width:300px;" value="<? echo $_POST[txtCity] ?>"> </td> <td width="160" align="right"> <select name="selState" style="width:130px;"> <option value="AK">Alaska</option> <option value="AL">Alabama</option> <option value="AR">Arkansas</option> <option value="AS">American Samoa</option> <option value="AZ">Arizona</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Conneticut</option> <option value="DC">District of Colombia</option> <option value="DE">Delaware</option> <option value="FL">Florida</option> <option value="FM">Federated States</option> <option value="GA">Georgia</option> <option value="GU">Guam</option> <option value="HI">Hawaii</option> <option value="IA">Iowa</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="MA">Massachusetts</option> <option value="MD">Maryland</option> <option value="ME">Maine</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MO">Missouri</option> <option value="MS">Mississippi</option> <option value="MT">Montana</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="NE">Nebraska</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NV">Nevada</option> <option value="NY">New York</option> <option value="OH">Ohio</option> <option value="OK" selected>Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="PR">Puerto Rico</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="VI">Virgin Islands</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WI">Wisconsin</option> <option value="WV">West Virginia</option> <option value="WY">Wyoming</option> <option value="XX">Other...</option> </select> </td> </tr> </table> </td> </tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:6px">Site ID</td> </tr> <tr> <td width="460" colspan="4" valign="baseline"> <input type="text" name="txtSiteID" style="width:460px;" value="<? echo $_POST[txtSiteID] ?>"> </td> </tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:6px">CEIS Engineer Name</td> </tr> <tr> <? if ($recUser['accesslvl'] == "admin") { $eng_options = $dbh->eng_box(false, $sCEISName, true, 'CEIS'); } else { $eng_options = "<option value=\"NOTSELECTED\">SELECT AN ENGINEER</option>"; while ($recAllowedEng = mysql_fetch_array($resProjectCreationAccess)) { $eng_options .= "<option value=\"$recAllowedEng[username]\">$recAllowedEng[lname], $recAllowedEng[fname]</option>"; } } ?> <td width="460" valign="baseline"> <select name="selCEISName" style="width:390px;"> <? echo $eng_options; ?> </select> <a href="#" onClick="javascript:showdiv('more_engineers');">+more</a> </td> </tr> <tr> <td style="width:460px"> <div id="more_engineers" style="display:none"> <table style="width:460px" cellpadding="0" cellspacing="0"> <tr> <td style="width:460px" valign="baseline"> <select name="selCEISName2" style="width:390px;"> <? echo $eng_options; ?> </select> </td> </tr> <tr> <td style="width:460px" valign="baseline"> <select name="selCEISName3" style="width:390px;"> <? echo $eng_options; ?> </select> </td> </tr> <tr> <td style="width:460px" valign="baseline"> <select name="selCEISName4" style="width:390px;"> <? echo $eng_options; ?> </select> </td> </tr> <tr> <td style="width:460px" valign="baseline"> <select name="selCEISName5" style="width:390px;"> <? echo $eng_options; ?> </select> </td> </tr> </table> </div> </td> </tr> <tr> <td width="460" valign="top" class="formtext" style="padding-top:6px">Division:</td> </tr> <tr> <td width="460" class="baseline"> <select name="selCEISDivision" style="width:100%;"> <? $ceis_divisions = $dbh->division_box(); echo $ceis_divisions; ?> </select> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="460"> <tr> <td width="200" valign="top" nowrap class="formtext" style="padding-top:6px; padding-right:54px">Job Status</td> <td width="200" valign="top" nowrap class="formtext" style="padding-top:6px">Sticker Number</td> </tr> <tr> <td width="200" valign="baseline" style="padding-right:54px"> <select name="selJobStatus" style="width:200px"> <option value="new">NEW</option> <option value="assigned">ASSIGNED</option> </select> </td> <td width="200" valign="baseline"> <input type="text" name="txtStickerNum" value="<? if ($_POST[txtStickerNum] == '') echo '0'; else echo $_POST[txtStickerNum]; ?>" style="width:200px" /> </td> </tr> <tr> <td colspan="3" valign="top" class="formtext" style="padding-top:6px">Job Details</td> </tr> <tr> <td colspan="3" valign="baseline"> <textarea name="txtADetails" style="width:460px;" rows="5"><? echo $_POST[txtADetails] ?></textarea> </td> </tr> <tr> <td width="200" valign="top" nowrap class="formtext" style="padding-top:6px; padding-right:54px">Start Date</td> <td width="200" valign="top" nowrap class="formtext" style="padding-top:6px">Projected Completion Date</td> </tr> <tr> <td width="200" valign="baseline" nowrap style="padding-right:54px"> <input type="text" name="txtStartDate" style="width:175px;" value="<? echo date("Y-m-d"); ?>"><img align="absmiddle" name="mpick1" src="Calendar.gif" border="0" onClick="javascript:show_calendar('frmNewProject.txtStartDate', '', '', 'YYYY-MM-DD', 'INLINE')" onMouseOver="this.style.cursor='hand';"> </td> <td width="200" valign="baseline" nowrap> <input type="text" name="txtCompleteDate" style="width:176px;" value="<? echo $_POST[txtCompleteDate] ?>"><img align="absmiddle" name="mpick1" src="Calendar.gif" border="0" onClick="javascript:show_calendar('frmNewProject.txtCompleteDate', '', '', 'YYYY-MM-DD', 'INLINE')" onMouseOver="this.style.cursor='hand';"><br> </td> </tr> <tr> <td width="460" valign="top" colspan="3" class="formtext" style="padding-top:6px">Copy of SOW(s)</td> </tr> <tr> <td width="460" valign="top" colspan="3" class="formtext"> <input name="upFileSOW1" type="file" id="upFileSOW1" style="width:460px;" maxlength="255" value="<? echo $_POST[upFileSOW1] ?>"> </td> </tr> <tr> <td width="460" valign="top" colspan="3" class="formtext"> <input name="upFileSOW2" type="file" id="upFileSOW2" style="width:460px;" maxlength="255" value="<? echo $_POST[upFileSOW2] ?>"> </td> </tr> <tr> <td width="460" valign="top" colspan="3" class="formtext"> <input name="upFileSOW3" type="file" id="upFileSOW3" style="width:460px;" maxlength="255" value="<? echo $_POST[upFileSOW3] ?>"> </td> </tr> <!-- 2004-09-27 RKB: REMOVED AS-BUILTS FROM PROJNEW FORM <tr><td colspan="3" height="6"></td></tr> <tr> <td width="460" valign="top" colspan="3" class="formtext">Copy of AsBuilt</td> </tr> <tr> <td width="460" valign="top" colspan="3" class="formtext"> <input name="upFileAsBuilt" type="file" id="upFileAsBuilt" style="width:460px;" maxlength="255" value="<? echo $_POST[upFileAsBuilt] ?>"> </td> </tr> --> <tr> <td width="460" valign="top" colspan="3" class="formtext" style="padding-top:6px">Upload Pictures</td> </tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile1" type="file" id="upFile1" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile2" type="file" id="upFile2" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile3" type="file" id="upFile3" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile4" type="file" id="upFile4" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile5" type="file" id="upFile5" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile6" type="file" id="upFile6" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile7" type="file" id="upFile7" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile8" type="file" id="upFile8" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile9" type="file" id="upFile9" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" colspan="3" class="formtext"><input name="upFile10" type="file" id="upFile10" style="width:460px;" maxlength="255"></td></tr> <tr><td width="460" valign="top" height="6"></td></tr> <tr> <td width="460" colspan="4" valign="top" class="formtext">Email addresses for project distro (COMMA-SEPARATED)</td> </tr> <tr> <td width="460" colspan="4" valign="baseline"> <textarea name="txtA_Emails" style="width:460px;" rows="5"><? echo $_POST[txtA_Emails] ?></textarea> </td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="460"> <tr> <td align="right" style="padding-top:6px"> <input type="reset" value="Clear" class="button" style="width:100px; margin-right:15px"> <input type="button" value="Submit" onClick="javascript:subSubmitForm();" class="button" style="width:100px"> </td> </tr> <? } ?> </table> </p> </div> <!--<div class="thirds"> <div class="smallboxtop"></div> <div class="smallbox">Comments From Users Could Go Here</div> </div> <div class="thirds"> <div class="smallboxtop"></div> <div class="smallbox">Here </div> </div> <div class="thirds"> <div class="smallboxtop"></div> <div class="smallbox">And Here</div> </div>--> </div> <div id="right"> <div class="boxtop"></div> <div class="box"> <p> <!--<?php if (isset($_SESSION['problem'])) { echo "{$_SESSION['problem']}"; } ?>Login to Job Tracking<form action="newsite/login/authuser.php" method="post" class="formation"> <input type="text" id="username" name="username" value="User Name" onclick="user()" onkeydown="valid(this,'special');" onblur="valid(this,'special');" /> <input type="password" id="passwd" name="passwd" value="Password" onclick="pass()" onkeydown="valid(this,'special');" onblur="valid(this,'special');" /><br/> <input type="submit" name="submit" value="Log In"/></form></p> <p><a href="newsite/login/pass.php">Forgot Password?</a></p>--> <td class="head">Project Tracking Options for <?php echo strtoupper($username) ?></td> <td class="head" align="right"><a class="colhead" href="/newsite/logout.php">Logout</a></td> </tr> <? if ($recUser[accesslvl] == "cust") { ?> <tr><td class="formtext" colspan="2"><a href="./projlist.php"><li>View Your Projects</li></a></td></tr> <?php // Get the project creation access records $sQuery = "SELECT `projectcreationaccessid` FROM `projectcreationaccess` WHERE `cust_username` = '$recUser[username]'"; $res = $dbh->query($sQuery); if ($res && mysql_num_rows($res) > 0) { ?> <tr><td class="formtext" colspan="2"><a href="./projnew.php"><li>Create a New Project</li></a></td></tr> <?php } } if ($recUser[accesslvl] == "admin" || $recUser[accesslvl] == "ceis") { ?> <tr><td class="formtext" colspan="2"><a href="./projlist.php"><li>View/Edit/Update Projects</li></a></td></tr> <tr><td class="formtext" colspan="2"><a href="./addressbook/index.php"><li>Address Book</li></a></td></tr> <?php } if ($recUser[accesslvl] == "admin") { ?> <tr><td class="formtext" colspan="2"><a href="./projnew.php"><li>Create a New Project</li></a></td></tr> <tr><td class="formtext" colspan="2"><a href="./reports.php"><li>Reports</li></a></td></tr> <?php } ?> <!--<div class="boxtop"></div> <div class="box"> <p>News Can Go Here!</p> </div> --></div></div> <div class="footer"> <p>© <a href="mailto:[email protected]">Michael LaPach</a></p> </div> </div> </body> </html> Please help
-
im trying to put somone elses code into this web site they just wanted a new design so i dont even know exactly how it works
-
yes i changed it and now instead of the error im getting a blank page
-
its a linux sever and i have the file path right anything else that could cause this
-
ceiscorp.com/newsite/Tracking/siteclas.php
-
Im having problems with some code that is spost to be including a file with the require function but i get an error when i run the script heres the code and the error <?php require ("tracking/siteclas.php"); $dbh = new CEIS_DB; require ("tracking/auth.php"); $username = $_SESSION['username']; $recUser = $dbh->UserInfo($username); ?> and the error im getting is Warning: main(tracking\siteclas.php): failed to open stream: No such file or directory in /usr/home/jlytal/public_html/newsite/index.php on line 6 Fatal error: main(): Failed opening required 'tracking\siteclas.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /usr/home/jlytal/public_html/newsite/index.php on line 6
-
it just goes back to the login page and i cant figure out why
-
<?php require_once "../tracking/db_connx.php"; session_start(); if (isset ($_POST['submit'])) { if (preg_match('/[!@#$%^&*()-+=`~<>,.?}{|]/', $_POST['username'])) { echo "Illegal Characters In Username"; } else { if (preg_match('/[!@#$%^&*()-+=`~<>,.?}{|]/', $_POST['passwd'])) { echo "Illegal Characters In Password"; } else { $username = $_POST['username']; $password = $_POST['passwd']; $sql = "SELECT * FROM webusers WHERE username='$username' AND passwd='$passwd'"; if ($r = mysql_query ($sql)) { $row = mysql_fetch_array ($r); $num = mysql_num_rows ($r); if ($num > 0) { @$_SESSION['username'] = $row['username']; @$_SESSION['fname'] = $row['fname']; @$_SESSION['lname'] = $row['lname']; @$_SESSION['email'] = $row['email']; @$_SESSION['accesslvl'] = $row['accesslvl']; @$_SESSION['logged_in'] = TRUE; $cookiename = 'ceiscorp.com'; $cookievalue=rand(100000,999999); $_SESSION['cookieverify'] = $cookievalue; setcookie($cookiename,$cookievalue,time()+3600,"/"); $today=date('r'); mysql_query("UPDATE webusers SET logged_in = '$today' WHERE username = '$username'") or die (mysql_error()); if($_SESSION['accesslvl'] = 'admin') { header("Location:../indexadmin.php"); exit; } else if($_SESSION['accesslvl'] = 'ceis') { header("Location:../indexceis.php"); exit; } else if($_SESSION['accesslvl'] = 'cust') { header("Location:../indexcust.php"); exit; } } else { @$_SESSION['problem'] ="Username or Password are Incorrect Please Try again"; header ('Location: ../indexlog.php'); exit; } } } } } ?> I have this to authenticate a user and send them to different pages based on user access level and this on the top of each page to check to see if the user is logged in <?php session_start(); if (isset($_COOKIE["ceiscorp.com"])) { if($_COOKIE['ceiscorp.com']==@$_SESSION['cookieverify']) { if($_SESSION['logged_in'] == TRUE) { header("Location: indexin.php"); } else{header("Location:indexlog.php");}//not logged in } else{header("Location:indexlog.php");}//validationfailed } else{header("Location:indexlog.php");} //nocookies ?>
-
Can you name a cookie whatever you want?
-
are you sure cause it worked just like it is until i tried adding the if else statements so it would go to different pages based on user access level
-
there isnt 44 lines of code
-
here is the entire code for you <?php require_once "../tracking/db_connx.php"; session_start(); if (isset ($_POST['submit'])) { if (preg_match('/[!@#$%^&*()-+=`~<>,.?}{|]/', $_POST['username'])) { echo "Illegal Characters In Username"; } else { if (preg_match('/[!@#$%^&*()-+=`~<>,.?}{|]/', $_POST['passwd'])) { echo "Illegal Characters In Password"; } else { $username = $_POST['username']; $password = $_POST['passwd']; $sql = "SELECT * FROM webusers WHERE username='$username' AND passwd='$passwd'"; if ($r = mysql_query ($sql)) { $row = mysql_fetch_array ($r); $num = mysql_num_rows ($r); if ($num > 0) { @$_SESSION['username'] = $row['username']; @$_SESSION['fname'] = $row['fname']; @$_SESSION['lname'] = $row['lname']; @$_SESSION['email'] = $row['email']; @$_SESSION['accesslvl'] = $row['accesslvl']; @$_SESSION['logged_in'] = TRUE; $cookiename = 'ceiscorp.com'; $cookievalue=rand(100000,999999); $_SESSION['cookieverify'] = $cookievalue; setcookie($cookiename,$cookievalue,time()+3600,"/"); $today=date('r'); mysql_query("UPDATE webusers SET logged_in = '$today' WHERE username = '$username'") or die (mysql_error()); if($_SESSION['accesslvl'] = 'admin'){ header("Location:../indexadmin.php"); exit;} else if($_SESSION['accesslvl'] = 'ceis'){ header("Location:../indexceis.php"); exit;} else if($_SESSION['accesslvl'] = 'cust'){ header("Location:../indexcust.php"); exit; }else{ @$_SESSION['problem'] ="Username or Password are Incorrect Please Try again"; header ('Location: ../indexlog.php'); exit; } } } } } ?>
-
Help got an error think im doing this right can you help i want a login system to have a different header page for each user based on access level heres the code i got so far im getting and error Parse error: parse error, unexpected $ on line 60 of this file <?php require_once "../tracking/db_connx.php"; session_start(); if (isset ($_POST['submit'])) { if (preg_match('/[!@#$%^&*()-+=`~<>,.?}{|]/', $_POST['username'])) { echo "Illegal Characters In Username"; } else { if (preg_match('/[!@#$%^&*()-+=`~<>,.?}{|]/', $_POST['passwd'])) { echo "Illegal Characters In Password"; } else { $username = $_POST['username']; $password = $_POST['passwd']; $sql = "SELECT * FROM webusers WHERE username='$username' AND passwd='$passwd'"; if ($r = mysql_query ($sql)) { $row = mysql_fetch_array ($r); $num = mysql_num_rows ($r); if ($num > 0) { @$_SESSION['username'] = $row['username']; @$_SESSION['fname'] = $row['fname']; @$_SESSION['lname'] = $row['lname']; @$_SESSION['email'] = $row['email']; @$_SESSION['accesslvl'] = $row['accesslvl']; @$_SESSION['logged_in'] = TRUE; $cookiename = 'ceiscorp.com'; $cookievalue=rand(100000,999999); $_SESSION['cookieverify'] = $cookievalue; setcookie($cookiename,$cookievalue,time()+3600,"/"); $today=date('r'); mysql_query("UPDATE webusers SET logged_in = '$today' WHERE username = '$username'") or die (mysql_error()); if($_SESSION['accesslvl'] = 'admin'){ header("Location:../indexadmin.php"); exit;} else if($_SESSION['accesslvl'] = 'ceis'){ header("Location:../indexceis.php"); exit;} else if($_SESSION['accesslvl'] = 'cust'){ header("Location:../indexcust.php"); exit; }else{ @$_SESSION['problem'] ="Username or Password are Incorrect Please Try again"; header ('Location: ../indexlog.php'); exit; } } } } } ?>
-
its on line 65 and thats the line that starts with else if (@$_SESSION['accesslvl'] == 'ceis') {
-
unxpected t_else error
-
i know that the first thing i tried i think it might be that im trying to do an if if then else
-
that give a error unexpected { expecting (
-
how would i do this heres my code that logs users in and sets a cookie and session variables to hold the information i need but i tryed adding an if else statement after it and i get an error if ($num > 0) { @$_SESSION['username'] = $row['username']; @$_SESSION['fname'] = $row['fname']; @$_SESSION['lname'] = $row['lname']; @$_SESSION['email'] = $row['email']; @$_SESSION['accesslvl'] = $row['accesslvl']; @$_SESSION['logged_in'] = TRUE; $cookiename = 'ceiscorp.com'; $cookievalue=rand(100000,999999); $_SESSION['cookieverify'] = $cookievalue; setcookie($cookiename,$cookievalue,time()+3600,"/"); $today=date('r'); mysql_query("UPDATE webusers SET logged_in = '$today' WHERE username = '$username' AND password = '$passwd'") or die (mysql_error()); if (@$_SESSION['accesslvl'] = 'admin') header("Location:../indexadmin.php"); exit; else if (@$_SESSION['accesslvl'] = 'ceis') header("Location:../indexceis.php"); exit; else if (@$_SESSION['accesslvl'] = 'cust') header("Location:../indexcust.php"); exit; else{ @$_SESSION['problem'] ="Username or Password are Incorrect Please Try again"; header ('Location: ../indexlog.php'); exit; please help
-
mysqli_connect abstracted into include file help
ublapach replied to amedhussaini's topic in PHP Coding Help
ya here you go <?php $dbc=@mysql_connect("localhost", "usrename", "password") or die ("The Database server is unavailable."); if (!@mysql_select_db("Database Name", $dbc)) { die ("The database is unavailable."); } ?> -
thanks for the help
-
and how would i echo that out again