Jump to content

rklockner

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by rklockner

  1. A friend of mine was able to clue me in, so I'd like to update with reason cURL wasn't working. SELinux. Once I disabled it, cURL worked fine. I hope this helps someone! EDIT: In the interest of the server being as secure as possible, a little research found that you can leave SELinux on, but run the following command to allow cURL traffic to pass through: setsebool -P httpd_can_network_connect on setsebool -P httpd_can_network_connect on
  2. I just tried running the following in the command line on the new server and received the expected result, so it would seem that the version of curl is working, but there is an error with php? $ curl google.com <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"><TITLE>301 Moved</TITLE></HEAD><BODY><H1>301 Moved</H1>The document has moved<A HREF="http://www.google.com/">here</A>.</BODY></HTML>
  3. Thanks for the quick reply. Doing a little research: Locally (working): 7.53.1 Centos 7 (woking): 7.29.0 Centos 8 (not working): 7.61.1 Since the new server is running a more recent version, I feel like upgrading won't do the trick...
  4. I have an integration with a third party that utilizes a SOAP API. On my current server AND my local environment, this works fine. I recently deployed a new server and it seems that cURL isn't doing anything. *The code is identical on all three installations. The "error" that I am seeing is no response at all (no response and no error, however, I can see that it is a "Resource"). After much trial and error, I tried creating a simple cURL example to test try to rule out other issues as the code itself is quite complex. My simple example, that also fails, is as follows: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "google.com"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); $err = curl_error($ch); print_r($err); echo $output; curl_close($ch); This does the same thing. On local, I get a "301 Moved" notice, on the new server, it is just a white screen. I have confirmed that php has curl installed in via command line (php -m) and using phpinfo(); in my code. It is definitely enabled. What would cause cURL to not have a response AND not have an error? My thought is a server setting, but I can't seem to find what might be causing this.
  5. I'm working on a project where a rate agreement needs to be signed. Right now our system emails the document, the person then prints/signs and faxes back (or scans/emails). I'd like to build a system like docusign, but I'm not sure what all needs to be done to make sure it would stand up in court. NOTE: The likelyhood of this going to court are slim to none, so I'm not overly concerned (the dollar amount of these agreements are quite low). I'm hoping that someone else has built something like this so I could take a short cut . Side note: I'm not sure this is the best place to post this, so please forgive me if it isn't... Thanks!
  6. Good thought, but I was holding back a twist. The 500 users are spread across three sub-domains (the one having the issue has roughly 60 of those users), the format is sub.domain.com. By typing www. to the front of the url actually sends you to an error page. Just for fun, I tried modifying the URL in different ways that are still valid, and it didn't log me out... Another side note, I use ajax to load each page into container div, so the entire page only loads on the initial log in (or when the page is refreshed), I use JS to update the url on a "new page load" like sub.domain.com/#new_page_name
  7. I don't have access to the location, so I can't really troubleshoot their location, however, I have told them that it is something in their office and to look into their firewall and anti-virus. As to JS not being enabled, the site his heavily js reliant. To the point that the homepage won't load unless JS is enabled.
  8. I have 500 users using software I have developed, and 495 do not have a timeout problem. Our default is to timeout after 60 minutes, but one particular office times out randomly and without warning. The normal procedure is, like online banking, a pop up comes up to let them know they will be logged out in 60 seconds, or they can click continue to stay logged in. The timer is based on JS, but on each page load a PHP function checks to see if they are timed out, and if they are, redirect them to the login page. The JS pop up never occurs, so obviously the countdown hasn't happened, but when they click on a link, they are redirected to the login page. Since the issue only occurs in one office, it leads me to believe it is a firewall or anti-virus issue, but I'm not sure... Anyone have any thoughts on this?
  9. I should also note that "foo" may, or may not, have quotes around it.
  10. I'm trying to search a string for all occurences of a pattern, then append text after that pattern. The example is: SUM("foo") as "bar" and have it display as: SUM("foo") over() as "bar" The "SUM" could be any SQL aggregate and be case insensitive. So For bonus points, let's say the valid aggregates are array('SUM', 'MAX', 'MIN', 'AVG'). My plan right now is to figure it out for SUM, then loop it replacing the aggregate. This is what I have so far... and it is not working. $l= 'SUM("foo") as "bar"'; $l=preg_replace('/([^"]+")/','\0 over()',$l); Thanks, Ryan
  11. Here goes my sheepish response... The tiff file I was using for testing had something wrong with it. Once I figured this out, getimagesize() worked which made me decide to give finfo a try again, and it also worked, so I switched it back to that. Thanks for the hints!
  12. I have a scenario where users are downloading files from a legacy system and uploading the files into a new system that I am supporting. Many of the files do not have an extension (most are tiffs). The issue we have is that the new system doesn't know how to open these files (we have them open in a preview window in the new system). I have tried numerous solutions, including finfo_file() and the depreciated mime_content_type() funcitons), but all they seem to return is "application/octet-stream". Thanks.
  13. I'm trying to pull emails off an Exchange server but keep coming up with errors. The imap_open command is below: $imap = imap_open("{edison.myserver.com:995/pop3/ssl/novalidate-cert}INBOX", $imap_user, $imap_pass) or die(print_r(imap_errors()) ); NOTE: I have been successful downloading emails in this manner from a non-Exchange server. NOTE 2: I have tried many combinations of the second half of the host (from the port number on) The errors vary slightly, but... Array ( [0] => Can't connect to edison.myserver.com,143: Timed out (10060) [1] => Can't open mailbox {edison.myserver.com:993/pop3/ssl/novalidate-cert}INBOX: invalid remote specification ) I have searched for the last couple hours but have only found threads with false answers or no answers at all. Does anyone have an answer? Thanks,
  14. I have a site that contains an internal messaging system. I've had users complain that they lost a message they were typing because the navigated away from the page. When this occurs, I'd like to display a custom popup box that I have built (with options, Save, Delete, and Cancel). If save is clicked, it would save a draft then continue to the link the user clicked. If Delete is clicked, it would not save a draft, then continue to the link. If Cancel is clicked, it would go back to the message and allow the user to continue typing. I've played with this option, but it displays the default alert option box. Not desireable. window.onbeforeunload = saveCurrentMessage; My only other thought is to do something like $('a').click(function(){ //cancel the href/onclick from the tag and store in a variable. //display my box. //depending on what the user clicks, Save/Delete would take that action then fire the href and/or onclick, Cancel would just cancel }); NOTE: I don't want to change the a tags on any other page than this, so modifying every link is not an option. Has anyone done this or have any thoughts in this direction? Thanks, Ryan
  15. Here is my theory. It isn't all worked out, but it will give an idea. Each company has a file that contains all custom code (we'll call it customizations.php). In this file, it will be a large case statement that will have the custom code. Each company has a companyId (in config). Like... BEGIN CONFIG: $customerId = 10000; END CONFIG BEGIN test.php: ...some code before... $customCode = 'test.php-'.$customerId.'-1'; include("customizations.php"); ...some code after... END test.php BEGIN customizations.php: switch($customCode) { case 'test.php-10000-1': echo 'Run this code!'; break; default: //Do Nothing break; } END customizations.php The idea is that I want to try and add in some additional checks to see if the custom code is being run from (1) the intended page, (2) the intended company, and (3) a unique identifier in case multiple lines need to be run. Thoughts?
  16. So far that is the best solution I can come up with, but what if it gets to the point where I have 100 companies and each has a slight variation. Then it becomes very difficult to manage. If that is the only option, then I suppose it is what I will do, albeit unhappily .
  17. First off, I know this is a PHP forum, but I have had great results from this site, so... I've been working on a project that is now in use by 4 separate companies, and will be adding more soon. Right now I am using SVN to control the versions, but one of the companies has asked for some custom code to be written that would not apply to any other customers. I obviously don't want to merge these changes with the others. Is there a way to have SVN ignore lines x through z of a file? I'm hoping for something like, /************ SVN PLEASE IGNORE ME . . . . . . . TO ME ******/ If that doesn't exist, does anyone else have any other solutions? Thanks!
  18. I have a page that contains 15 tabs. When each tab is pressed, it calls a function that uses .load() to load that tab. In my initial testing, all seems to go smoothly (loading in less than a second). However, once you click about 10 tabs, the pages start to load slower, and by click 13, it takes more than 30 seconds to load. If you refresh the page this process starts over and the outcome is the same (by click 12-13 it is unusable). Below is the code. FYI the reload_timer was an attempt to reload the page if the query was taking more than 10 seconds... It didn't work. I left it in for feedback in case I don't find a suitable solution to the actual issue. <a onclick="getNewPage('page_name', this, 'co_applicant');" >Co-Applicant</a> <div id="result_container"></div <script> function getNewPage(newpage, el, tab){ var reload_timer = setTimeout('window.location.reload()', 10000); $('#lead_content').html('<p>Data Loading: <img src="images/ajax-loader-2.gif" width="220" height="19" /></p>'); $('#result_container').load(newpage+".php?leadid=<?=$leadid?>new_tab="+tab, function(){ clearTimeout(reload_timer); }); $('a').attr('class', ''); el.className = 'selected'; } </script>
  19. I have a query SELECT id, name FROM a LEFT JOIN b ON b.bid = a.bid LEFT JOIN c ON c.cid = a.cid LEFT JOIN d ON d.did = a.did . . . LEFT JOIN k ON k.kid = a.kid WHERE a.id = 5 table b returns 3 results. table c returns 5 results. table d returns 25 results. . . . table k returns 10 results. What I would like is to know the number of d.did records are returned. I have tried using GROUP BY d.did and COUNT(d.did) as num_results, but I need the multiple records that are returned from the other tables. I'm sure the solution exists (I have tried searching, but I am not sure how to word the search), so any help is appreciated. Thanks!
  20. From the responses I am getting, I think I need to: 1 - create a function to adjust the timezone 2 - start implementing the function across the software 3 - gradually implement the new function on all date/time strings 4 - add the ability for user's to change their timezone. Based on everything I am hearing, this is the way to go. I cannot convert all DATETIMEs to TIMESTAMPs, so this wouldn't be a complete fix.
  21. It is 50/50, and very random. Would I be able to go through the database and just convert DATETIME to TIMESTAMP?
  22. I have inheritted an enormous code base that was never written to consider the timezone a user is in. I have been tasked with adding in a timezone field for users to select, then adjust the time everywhere it is used. There are literally hundreds (if not thousands) of places where the time is displayed. Hopefully there is a possibility to adjust this without having to adjust every MySQL query. Ideally, 1 - The query calls the data on the server 2 - Either PHP or MySQL recognizes it as a date and adjusts it based on the user's timezone automatically. NOTE: I am familiar with how the user can select their timezone in PHP (date_default_timezone_set) Not Ideal (as this would take weeks to implement), function scriptToChangeTZ($datetime){ ...adjust to new timezone code } $datetime = /*date from MySQL query */ $new_datetime = scriptToChangeTZ($datetime);
  23. By freezing, I am referring to anchoring the left most columns so that the rest of the table scrolls left to right, but the leftmost column is always visible. Lets say the table is 1000px wide, and I only want to show 500px, and you are able to scroll to the right to see the rest. Now let's say there are 1000 records, and the first column contains a name, and the last (which is not visible unless you scroll to the right) contains a phone number. It is not possible to see both at the same time unless there is a way to keep the name column visible while you scroll to the right. I have found options that use multiple tables each with a div around it to accomplish this which would work, but... I need the table to be sortable. In other words, I would like to click on the header "Name" (or any other column header) and sort alphabetically.
  24. I've been searching for a while, and I have found some great options for sorting a table, and some OK options for freezing the left column(s), but nothing that will do it together. The issue is that most of the "Freezing" solutions use numerous tables wrapped with div tags to accomplish this task, and all the "Sorting" solutions only work on one table. FYI - I am not looking to reload the page each time the sort is done. Anyone know of anything?
  25. Just so everyone can rest easy tonight... The problem had to do with a .blur() called within a jQuery function (by removing jQuery it just hid the problem). It appears to be that if .blur() is called on a non-Object it has funky results...
×
×
  • 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.