Jump to content

gingar

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gingar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i have this site that i just did, that uses xml to pull info from my supplier. i'm using this. function send_request_test($data, $path, $host) { $header = "POST ".$path." HTTP/1.0\r\n"; $header .= "Host: ".$host."\r\n"; $header .= "Content-Type: text/xml\r\n"; $header .= "Content-Length: " . strlen($data) . "\r\n\r\n"; // open socket # $fp = pfsockopen('ssl://www.example.com', 443, $errno, $errstr, 60); $fp = fsockopen($host, 80, $errno, $errstr, 60); $retval=''; if (!$fp) { return "Error: " . $errstr; } else { fputs($fp, $header.$data); while (!feof($fp)) { $retval .= fread($fp, 1024); } fclose ($fp); } return $retval; } $test_xml = " <?xml version ='1.0' encoding='UTF-8'?> <root> <header> <protocol>1</protocol> <oem>supplier</oem> <agentID>11111</agentID> <password>password</password> <sessionID>5bcsx0ut3e0pck45fikpgd55</sessionID> </header> <body> <opCode>OP_SET_INFO</opCode> <deferPayment>0</deferPayment> <reserveDetails> <step>SAVE_RES</step> </reserveDetails> <pfileNumOnlyInResponse></pfileNumOnlyInResponse> </body> </root> "; $test_content = send_request_test($test_xml, $test_path, $test_host); $pos = strpos($test_content, '<body>'); if ($pos === false) { //echo "The string '$findme' was not found in the string '$mystring'"; } else { $test_data = substr($test_content, $pos); $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startTag_reservation", "endTag_reservation"); xml_set_character_data_handler($xml_parser, "contents_test_reservation"); if(!(xml_parse($xml_parser, $test_data))){ die("Error on line " . xml_get_current_line_number($xml_parser)); } xml_parser_free($xml_parser); } the above code appears to send and receive the data i requested. However, the sessionID that is supposed to be returned with the data changes with each response. This should not be the case, as i tried sending the exact same xml via a standalone xml program (SendXML) the sessionID remained consistent. Is there anything that i might have missed or included that somehow resets the xml request? or anything? i was stuck on this for 1 whole week before it suddenly hit me that the sessionid wasn't consistent. Please help!
  2. ok, i've change the codes, works fine on my localhost and my hoster.. sent it off to my client.. *fingers crossed* thanks guys!
  3. Hi guys, i'm developing a site for my client. On my localhost, i'm using Apache/2.0.50 (Win32) PHP/5.0.0 . The files work just fine. Even when i upload to my hosting server, Apache/1.3.41 (Unix) PHP/5.2.6, the files load just as it does on my localhost. However, when she uploads the exact same files to her server, which is running PHP 5.2.6 & Apache 2.2.8, the files do not work! The layout goes haywire and simple php arrays to display in a tables write out the php code to the screen instead! Is it really the php & apache version that is causing these discrepancies? Please advise! many many thanks!
  4. At present, i'm using curl. I am able to send the xml query over, and get a response. but the response is not what i am expecting. This is the code im using.. $url = "http://xxx"; $xml = '<?xml version ="1.0" encoding="UTF-8"?> <root> <header> <protocol>1</protocol> <oem>xx</oem> <agentID>xxx</agentID> <password>xxxx</password> </header> <body> <opCode>XX_AREAS_XX</opCode> <item name=”ANTALYA” ID=”5” /> <item name=”JERUSALEM” ID=”1” /> </body> </root> '; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml")); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, 'xml=' . $xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $content = curl_exec($ch); #this returns html how come when i use a standalone program to submit the exact same xml string to the same url, using post, i get this reply. <body><version>3.91</version><opCode>OP_AREAS_LIST</opCode><country ID="27"><item name="Aachen, Germany" ID="13547" coreID="0"/><item name="Augsburg, Germany" ID="4408" coreID="0"/><item name="Bad Homburg, Germany" ID="5867" coreID="0"/><item name="Baden-Baden, Germany" ID="229" coreID="0"/><item name="Bautzen, Germany" ID="5889" coreID="0"/></country></body> but when i use the above code, i get this instead? <body><version>3.91</version><opCode>OP_OK</opCode></body> is there something wrong with the way i'm executing the code?
  5. I've got this site that displays a list of properties from database using php. Each property has got an 'info' button that pops up a window, that displays the property's info, also retrieved from database using php. Here's the problem, using IE 7, when the listing page is still loading, i click the 'info' button for a property that has already been loaded, the window pops up and gives me an error page! says no internet connection/problem displaying page. Only when i click on the 'info' after the listing page has completed loading, does the 'info' window load. However, when I do the exact same thing using Firefox, the 'info' window loads just fine, even when the listing page hasn't completely finished loading! Any thoughts on this one?
  6. Hi guys, any idea how to insert an image into a php generated xls such that even when the pc is not logged on to the internet, the image on the excel file still shows?
  7. oh.. so i need to reduce my tables and use more <div>?
  8. thanks lumio! anyone knows if 'views' in mysql run queries faster than combining multiple tables @ runtime? erm.. i mean is querying a view that combines multiple tables faster than a query with multiple join statements?
  9. i wish i didnt have to use frames either.. i inherited the code. the previous fella quit. how do you check if the code is valid?
  10. http://www.motormuse.com/dev/ login: test password: 123456
  11. Hi guys, I've got this website. It loads quite fast in firefox, like in a matter of 2-5 seconds.. but in ie 6, it takes more than 1 minute to load the same page! I ran the microtime, and time elapsed in IE (time elasped B :0.12592887878418 secs) is similar to that of the time elapsed in firefox (time elasped B :0.12102603912354 secs). So it appears IE took a gazillion years to display the page.. any idea why? I've got lotsa tables and div tags.. does it affect? Images have been optimised as well. another qns, does 'views' in mysql help run queries faster than combing multiple tables @ runtime?
  12. Hi guys, I've encountered a really weird problem. I've written this emailer program that pulls emails addresses from a db that was previously uploaded via csv file based on the contact list selected. It sends out the emails fine. Whenever I blast out a newsletter, I will send it out to 3 different contact lists, about 1000 email addresses. However, I've been getting feedback that some recipients receive multiple copies of the same email within a span of 2 days. I've removed their email addresses after receiving their request to be removed from the mailing list. However, they still claim to be receiving the multiple newsletters! I've checked the database, their email addresses have been removed from the database. At first I thought maybe my loop or sql statement was pulling the same contact twice, but i printed out all my results, nope. each email appears only once! I'm using php mail() to send out the emails in a while loop to retrieve the address from the db. Could it be the mail server is resending? Or the email addresses are in cache somewhere? I'm stumped. Any idea anyone?
×
×
  • 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.