Jump to content

simon551

Members
  • Posts

    210
  • Joined

  • Last visited

    Never

Everything posted by simon551

  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
  14. $query="SELECT id FROM table"; $rs=mysql_query($query,$connection); $row=mysql_fetch_assoc($rs); echo $row['id']; in your case you are trying to echo the mysql operation. You can echo a query but not an operation like mysql_query();
  15. Maybe I should have titled my post php mail gmail html problem. Gmail loads my email as raw html code.
  16. what does this give you in your browser? what if you just put this in the page: <?php //SELECT UPDATEABLE FIELDS $result = mysql_query("SELECT date, pic, title, name, team, text FROM rumor LIMIT 5") or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { //HEADLINES $date=$row['date']; $pic="http://files.mblsim.com/reports/news/html/images/".$row['pic'].""; $title=$row['title']; $name=$row['name']; $team=$row['team']; $text=$row['text']; echo $text; } //CLOSE OUT WebUpdater Code ?> I don't see where you are setting a connection or selecting a database so I'm guessing it won't work. But let us know. Separately, after you get that figured out, when doing this: while x { do something } what you are telling php to do is to repeat an action as it loops through the rows in your sql output. for each row in your output it will (or at least try) to do the action you tell it to do. also, wrap your code in code (button that looks like the pound sign) tags not quote tags [/code]
  17. or you could use fetch_assoc instead of array. <?php //SELECT UPDATEABLE FIELDS $result = mysql_query("SELECT date, pic, title, name, team, text, pic FROM rumor LIMIT 5") or die(mysql_error()); while ($row = mysql_fetch_assoc($result) { //HEADLINES $date=$row['date']; $pic="http://files.mblsim.com/reports/news/html/images/".$row['pic'].""; $title=$row['title']; $name=$row['name']; $team=$row['team']; $text=$row['text']; ?> <table width="100%" height="100%" border="0" cellpadding="5" cellspacing="0"> <tr> <td valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td class="rumorHeader">MBL Rumor Central: <?php print $title; ?></td> </tr> <tr> <td bgcolor="#000066" class="dateBorder"><font color="#FFFFFF">Updated <?php print $date; ?> </font></td> </tr> <tr> <?php print "<td class=rumorPad> <table width=100% border=0 cellspacing=1 cellpadding=1> <tr> <td width=105 rowspan=3 valign=top> <div align=left><img src=".$pic." width=90 height=135 border=0></div></td> <td class=rumorTitle>".$title."</td> </tr> <tr> <td class=rumorName>".$name." | ".$team."</td> </tr> <tr> <td valign=top class=rumorText> <p>".$text."</p></td> </tr> </table></td>" ?> </tr> </table></td> </tr> </table> <?php } ?>
  18. or you could do something like this. put this on your pages: $page='fullurlofyourpage'; $_SESSION['referer']=$page; Then on your login page check to see if there is is a referer: //after logging in if(! $_SESSION['referer']==''){ //do something to redirect header("Location: ". $_SESSION['referer']); }
  19. Sorry. They are seeing plain text.
  20. I think you could try [] brackets instead of {} brackets around your php values. also, I think you want to do it more like this: <table> <?php while (something) { ?> <tr> <td></td> </tr> <?php } //end something ?> </table>
  21. I've been sending emails from my program for a while using the following code to generate an html email header. This has been working fine - it's a company intranet application that has a couple of outside people who receive some emails. Travel agents to be specific. There haven't been any issues going on a year or so with this but now one of the travel agents switched to gmail for email and gmail isn't digging my code. $random_hash = md5(date('r', time())); //email contents follow $body= ' --PHP-alt-'. $random_hash.' Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit You need to enable html email in order to receive the travel request in an email. You will need to check the application for the request. --PHP-alt-'.$random_hash.' Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <p>message text etc.</p> Let me know if I need to post more code (if you think this is a problem with my html I'll gladly post more.)
  22. figured it out. <?php mysql_select_db($database_conn_org, $conn_org); $query="SELECT etDetId FROM et_details WHERE etmId=3865"; $rs = mysql_query($query, $conn_org) or die(mysql_error()); $totalRows = mysql_num_rows($rs); $i=0; while ($row = mysql_fetch_array($rs)) { $i++; //transaction information $id[$i]= $row['etDetId']; } echo $id[1].'<br />'.$id[2];
  23. This returns 0 8 but I'm expecting it to return, according to my database records 10856 10857 <?php mysql_select_db($database_conn_org, $conn_org); $query="SELECT etDetId FROM et_details WHERE etmId=3865"; $rs = mysql_query($query, $conn_org) or die(mysql_error()); $row = mysql_fetch_array($rs); $totalRows = mysql_num_rows($rs); while ($row = mysql_fetch_array($rs)) { //transaction information $id= $row['etDetId']; } echo $id[1].'<br />'.$id[2];
×
×
  • 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.