Jump to content

simon551

Members
  • Posts

    210
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

simon551's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. This is very strange. I don't think I've ever had this problem before. I can view this file in my browser: file:///C:/xampp/htdocs/autoocomplete/demo/index.html but not this one: http://localhost/autocomplete/demo/index.html which returns an Object not found! page message. Error 404 localhost 1/6/2010 9:05:45 PM Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0
  2. This is the get call, the previous was the post call. $(document).ready(function() { $.getJSON('../sources-json/et-index.php, callback ); }); I did a little checking about random variable and tried this: $(document).ready(function() { var d= Math.floor(Math.random()*50000); $.getJSON('../sources-json/et-index.php?d='+d, callback ); }); Still only works if I disable cache.
  3. Not sure how to include a random variable. function submitStatus(submittype, action){ //alert(submittype+action); var $status = $('#erStatus').text(); var $etmId = $('#etmId').text(); var $access=$('#accesslevel').text(); if(bp==0){if ($access==1){$access=4;}} $.post('../postingfiles/et_statusUpdate.php', { status: $status, etmId: $etmId, access: $access, action:action, submittype:submittype }, function(data){ //alert("Data Loaded: " + data); $('#erStatus').text(data); //run the opening script //alert('trying to get the page to update now'); findstatus(); erStatus(data); } ); if (action=='print'){ print_r(); } if(gotoindex==1){ indexpage=$('#indexpage').text(); //alert(indexpage); window.location=indexpage; } }
  4. I'm stuck. I have a page that loads json data and has a link that takes you to another page where you update info through an ajax post. I'm finding that it (the ajax post) doesn't work unless I turn off the cache on the client side. I'm trying to fix this on the server side, but it doesn't seem to be working. I've tried putting this everywhere I can think of: header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past session_start(); I'm not really familiar with how this all works but I read something in the manual which led me to believe that would work. One note is that this is an intranet site, not a www..com site and I don't know whether that changes the script I'm supposed to invoke. Any ideas?
  5. Yeah. I was creating a string and then dumping it in the array. that was creating an array with a string in it rather than adding each string element to the array which I wanted to do. I fixed it. Thanks for the help! <?php session_start(); require_once('../Connections/conn_org.php'); require_once('../security/adminTest.php'); $empid = $_COOKIE['empid'.$companyName]; $div = $_COOKIE['divisionId']; //contract manager mysql_select_db($database_conn_org, $conn_org); $qManager = "SELECT DISTINCT contract_teamdets.contractId as x FROM contract_teamdets WHERE ((contract_teamdets.teamRoleID = 1 OR contract_teamdets.teamRoleId=4) AND contract_teamdets.empID = $empid) "; $rsManager = mysql_query($qManager, $conn_org) or die(mysql_error()); $total_contracts_admin=mysql_num_rows($rsManager); ////start array my contracts////////////////////////////////////////////////////// $myContractsArray=array(); $contractAdminArray=array(); while ($row_rsManager = mysql_fetch_assoc($rsManager)) { array_push ($myContractsArray, $row_rsManager['x']); array_push ($contractAdminArray, $row_rsManager['x']); } //ownership items $qOwner = "SELECT DISTINCT contracts.contractId as x FROM contracts Inner Join tblclients ON contracts.clientId = tblclients.clientId WHERE tblclients.empID_relationshipHolder=$empid "; $rsOwner = mysql_query($qOwner, $conn_org) or die(mysql_error()); $total_contracts_admin=mysql_num_rows($rsOwner); ///continue array while ($row_rsOwner = mysql_fetch_assoc($rsOwner)) { array_push ($myContractsArray, $row_rsOwner['x']); array_push ($contractAdminArray, $row_rsOwner['x']); } /////////////////////////////////////////////////////////////////////////////////////////////////// $myContractsArrayString= implode(',',$myContractsArray); //add any personal contracts to the new array before building up further. //array_push ($contractAdminArray, $myContractsArrayString); if ($_SESSION['divisionAdmin']=='yes'){ $query_rsDivisionContracts = "SELECT contracts.contractId as x, contracts.divisionId FROM contracts WHERE contracts.divisionId = $div "; $rsDivisionContracts = mysql_query($query_rsDivisionContracts, $conn_org) or die(mysql_error()); //continue building array while ($row_rsDivisionContracts = mysql_fetch_assoc($rsDivisionContracts)) { array_push ($contractAdminArray, $row_rsDivisionContracts['x']); } } //continue building array if (($_SESSION['globalAdmin']=='yes')||($_SESSION['HRAdmin']=='yes')){ $query_rsGlobalContracts = "SELECT DISTINCT contracts.contractId as x FROM contracts"; $rsGlobalContracts = mysql_query($query_rsGlobalContracts, $conn_org) or die(mysql_error()); while ($row_rsGlobalContracts = mysql_fetch_assoc($rsGlobalContracts)) { array_push ($contractAdminArray, $row_rsGlobalContracts['x']); } } //array is complete ///turn it into a string to be used in a query $contractAdminArrayString= implode(',',$contractAdminArray); //$result=count($contractAdminArray); ?>
  6. oh. maybe there's a problem in how I'm creating the array. This is the code: $empid = $_COOKIE['empid'.$companyName]; $div = $_COOKIE['divisionId']; //contract manager mysql_select_db($database_conn_org, $conn_org); $qManager = "SELECT DISTINCT contract_teamdets.contractId as x FROM contract_teamdets WHERE ((contract_teamdets.teamRoleID = 1 OR contract_teamdets.teamRoleId=4) AND contract_teamdets.empID = $empid) "; $rsManager = mysql_query($qManager, $conn_org) or die(mysql_error()); $total_contracts_admin=mysql_num_rows($rsManager); ////start array my contracts////////////////////////////////////////////////////// $myContractsArray=array(); while ($row_rsManager = mysql_fetch_assoc($rsManager)) { array_push ($myContractsArray, $row_rsManager['x']); } //ownership items $qOwner = "SELECT DISTINCT contracts.contractId as x FROM contracts Inner Join tblclients ON contracts.clientId = tblclients.clientId WHERE tblclients.empID_relationshipHolder=$empid "; $rsOwner = mysql_query($qOwner, $conn_org) or die(mysql_error()); $total_contracts_admin=mysql_num_rows($rsOwner); ///continue array while ($row_rsOwner = mysql_fetch_assoc($rsOwner)) { array_push ($myContractsArray, $row_rsOwner['x']); } /////////////////////////////////////////////////////////////////////////////////////////////////// $myContractsArrayString= implode(',',$myContractsArray); $contractAdminArray=array(); //add any personal contracts to the new array before building up further. array_push ($contractAdminArray, $myContractsArrayString); if ($_SESSION['divisionAdmin']=='yes'){ $query_rsDivisionContracts = "SELECT contracts.contractId as x, contracts.divisionId FROM contracts WHERE contracts.divisionId = $div "; $rsDivisionContracts = mysql_query($query_rsDivisionContracts, $conn_org) or die(mysql_error()); //continue building array while ($row_rsDivisionContracts = mysql_fetch_assoc($rsDivisionContracts)) { array_push ($contractAdminArray, $row_rsDivisionContracts['x']); } } //continue building array if (($_SESSION['globalAdmin']=='yes')||($_SESSION['HRAdmin']=='yes')){ $query_rsGlobalContracts = "SELECT DISTINCT contracts.contractId as x FROM contracts"; $rsGlobalContracts = mysql_query($query_rsGlobalContracts, $conn_org) or die(mysql_error()); while ($row_rsGlobalContracts = mysql_fetch_assoc($rsGlobalContracts)) { array_push ($contractAdminArray, $row_rsGlobalContracts['x']); } } I have build one array that has a specific purpose and then I want to use that array in another array. I should find a better way to do that.
  7. Array ( [0] => 72,21,62,16,37,6,86,104,49,29,100,104 ) no72,21,62,16,37,6,86,104,49,29,100,104
  8. $contractId="37"; if (in_array($contractId, $contractAdminArray)) { $admin='yes'; } else { $admin='no';} echo $admin; $contractAdminArrayString= implode(',',$contractAdminArray); echo $contractAdminArrayString; result no72,21,62,16,37,6,86,104,49,29,100,104 clearly 37 is in the array but the script says it's not. what am I doing wrong?
  9. Got it. Thanks. phpmyadmin/config.inc.php I don't use it either except for setting up security. I use navicat for my database needs. you?
  10. I created a new xampp installation today and went in and changed the password for the root user at localhost. Now I am locked out of phpmyadmin altogether. I get this message: Error MySQL said: Documentation #1045 - Access denied for user 'root'@'localhost' (using password: NO) phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server. It's not prompting me to login. I'm not sure what I did wrong but I must have messed up somewhere. Any idea?
  11. <?php $query_rsAdmin = ("SELECT users.empId, COALESCE(users.HRAdmin, 0) AS hradminv, COALESCE(users.DivisionAdmin, 0) AS divadminv, COALESCE(users.GlobalAdmin, 0) AS globaladminv, COALESCE(users.travelAdmin,0) AS traveladminv, COALESCE(users.projectAdmin, 0) AS projectadminv, COALESCE(users.accountingadmin, 0) AS accountingadminv, tblgroups.divisionId FROM users Inner Join tblemployees ON users.EmpID = tblemployees.EmpID Inner Join tblgroups ON tblemployees.groupId = tblgroups.groupId WHERE users.EmpID = $empid"); $rs = mysql_query($query_rsAdmin, $conn_org) or die(mysql_error()); $arr = array(); while($obj = mysql_fetch_object($rs)) { $arr[] = $obj; } $arr[]="'koala'->1"; echo json_encode($arr); ?> returns: [{"empId":"18","hradminv":"0","divadminv":"1","globaladminv":"0","traveladminv":"0","projectadminv":"0","accountingadminv":"0","divisionId":"1"},"'koala'->1"] but I want it to return [{"empId":"18","hradminv":"0","divadminv":"1","globaladminv":"0","traveladminv":"0","projectadminv":"0","accountingadminv":"0","divisionId":"1","koala":"1"}] I'm lost.
  12. <?php echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="itemdetails"> <tr> <td width="1100" height="350" bgcolor="#FFFFFF" class="tento"> <table class="cafe"><tr><td width="547"> <a href="#"><h3 align="justify" style="position:relative; height:5px; top: 10px;">'.$row[2].'</h3></a> </td> </tr> </table> <table width="1215" height="609" class="chencho" > <td class="largethumb" rowspan="8" align="center"> <a href="#"><img src="../images/image1.jpg" width="270" height="160" alt="coloe"/></a></td> <td width="340" rowspan="8" padding="0" ><table width="252" style="font-size:12px; position:relative; top:-6px;"> <td width="1"> </td> <td width="54" bgcolor="#FFFFFF"><strong>Price:</strong></td> <td colspan="7">$<span class="style3">'.$row[6] .'</span></td> <tr> <td class="style1"> </td> <td colspan="7" class="style3"> </td> </tr> <tr><td> </td><td><strong>Raiting:</strong></td> <td><table height"50" width="47%"> '. $ratingData = Rating::OutputRating($platename); if (Error::HasErrors()) { echo Error::ShowErrorMessages(); Error::ClearErrors(); } else { echo $ratingData; } .'</table></td> </tr>';
  13. php can't find the file. are you sure it's there? /home/suni4691/public_html/domain.com/admin/FCKeditor/fckeditor.php
×
×
  • 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.