Jump to content

MarkusJ

Members
  • Posts

    6
  • Joined

  • Last visited

MarkusJ's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the feedback If I can ask as direct php question if(isset($matches[0][$i]))// Is this correct? { $innerContent = $innerContent.$matches[0][$i]." "; // Is this how to append a result to an existing string? } Is the above the best way to check for a null reference and to append a string to itself? Thanks!
  2. Hi, I am still learning PHP and given some HTML I am trying to extract all links and iframes from the HTML and append them to a different string. I am still learning PHP so I am not sure if how I am checking that the returned array has values (isset) or if I should be appending strings together (.) is correct The code that I have so far is function GetLinksIFrames($content) { $innerContent =''; $regex_pattern_links = "/<a href=\"(.*)\">(.*)<\/a>/"; preg_match_all($regex_pattern_links,$content,$matches); for ($i = 0; $i < count($matches); $i++) { if(isset($matches[0][$i]))// Is this correct? { $innerContent = $innerContent.$matches[0][$i]." "; // Is this how to append a result to an existing string? } } $regex_pattern_iframe = "/<iframe src=\"(.*)\">(.*)<\/iframe>/"; preg_match_all($regex_pattern_iframe,$content,$matches); for ($i = 0; $i < count($matches); $i++) { if(isset($matches[0][$i])) { $innerContent = $innerContent.$matches[0][$i]." "; } } return $innerContent; } Any help appreciated Thanks Mark
  3. Hi, if I simply do an echo var_dump($client) I get the following object(SoapClient)#173 (2) { ["_soap_version"]=> int(1) ["sdl"]=> resource(95) of type (Unknown) } thanks again
  4. LOL, sorry; you are correct (wood for the trees!) I am getting an "Object not set to an instance of an object" error when I call the line $result = $client->LogUser($parameters); // This is the line that is causing the error Thanks again
  5. Hi, I have spent the last few hours trying to consume a .NET webservice (.asmx) from a php page. I have tried all sorts of recommendations but I am still getting the following error SoapClient->__call('LogUser', Array) #1 /home/mywebsite/public_html/sitefun.com/wp-content/themes/supermodne/functions.php(18): SoapClient->LogUser(Object(stdClass)) The actual .NET webservice that I am trying to call is an extremely simple .asmx webservice (not WCF) and the method is very simple (interface is below) [WebMethod] public string LogUser(string IPAddress, string Key, string ID, string Referrer) { This is the code that I am using to call the webservice in php $client = new SoapClient('http://services.mywebsite.net/webservices/visitorlog.asmx?WSDL'); $requestvar = $_SERVER['REMOTE_ADDR']; $requestKey = 'guid'; $requestID = '6' $referrer = $_SERVER['HTTP_REFERER']; if (!empty($_SERVER['HTTP_REFERER'])) { $parameters = array('IPAddress'=>$requestvar,'Key'=>$requestKey,'ID'=>$requestID,'Referrer'=>$referrer); $result = $client->LogUser($parameters); // This is the line that is causing the error I must be doing something silly as I am new to php / services so I would appreciate any help Best wishes and thanks in advance Mark
×
×
  • 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.