Jump to content

grogers

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by grogers

  1. I'm struggle to build an appropriately formatted URL request for a particular API (not really important which, but it's for Toodledo). The API documentation says: I've tried about 100 different combinations of code like the following: $arr = array ('id'=>$id,'completed'=>1,'reschedule'=>1); $tasks = json_encode(array($arr)); $params = array('key'=> $this->key); $params['tasks'] = $tasks ; $params['fields'] = 'id,completed,reschedule' ; $url="http://api.toodledo.com/2/tasks/edit.php?".http_build_query($params) ; $response = file_get_contents($url); None seems to get me to a URL formatted like they ask. Can someone help me out? I'm tired of banging my head against the table. [Note... the fields I'm passing in single element of the $tasks array are different than in the example... but it's the format, not the content, that I can't get right] Thanks in advance!
  2. I'm guessing this is more of a hosting/mail question than specifically php, but here goes... I have this very basic code to send a test email: <?php $to = 'me@mydomain.com'; $subject = 'Test email'; $message = "Hello World!"; $mail_sent = mail( $to, $subject, $message); echo $mail_sent ? "Mail sent" : "Mail failed"; ?> and the following in my php5.ini: When the mail is received, it's showing as coming from "auserid@p3nlh263.shr.prod.phx3.secureserver.net". How can I get this to show as something more reasonable and related to my domain? Ideally something more like admin@malvernaquarium.com. Thanks in advance! Greg
  3. For what it's worth, this does seem to be a problem with my particular host (GoDaddy) and allowing outgoing file requests (through just about any method) to ports other than port 80. I moved the service from which I was trying to get the XML from port 8080 to port 80 to test and everything works fine.
  4. The file I'm trying to grab is just sitting out there, no scripts, etc. I tried the user_agent approach with cURL but got the same results. I found this blurb on php.net: I don't believe this applies to GoDaddy hosts, but I'm really not sure. I have a note in to their support.
  5. I'm new to the PHP world and trying to work my way through a problem. I've gone down many roads, but can't seem to find the answer. I'm not even sure this is so much a PHP question at this point as a host configuration issue. I'm trying to grab an XML file from a remote server. My first try was to try to shell out a wget as follows: exec("wget -q -O status.xml - http://$username:$password@$hostname:$port/cgi-bin/status.xml",$xmlget,$err); This didn't work. Not a surprise since doing it directly from SSH gave: Connecting to mydomain.com|99.99.99.99|:8080... failed: Connection refused. [Note that the port 8080 above is, I think, key] I've since tried method using both file_get_contents and cURL. Similar results for all. I won't clutter this up with the code unless you ask. It's all very straightforward. [file_get_contents complains 'Connection refused' and curl_error says 'couldn't connect to host']. With all of the methods, I'm able to grab, say, google.com AND a page from mydomain.com (default port 80), just not from port 8080. I've set 'allow_url_fopen = on' in php.ini and in my code for good measure. Also, the XML file that lives at 8080 is retrieved fine through a browser. I'm hosted at GoDaddy on their "deluxe shared linux" plan. Is there something obvious I'm missing that would allow all this to work over port 80, but not 8080? Thanks is advance! Greg
×
×
  • 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.