Jump to content

Complex PHP Help


SJamG

Recommended Posts

Hi There,

 

I have a website, which uses a script to syncronise properties from one site to another,  this is done by a number of PHP scripts, when i add the RSS URL into the PHP script (ezrsync.php), it generates the following error :

 

Fatal error: Call to a member function on a non-object in /homepages/24/d227024453/htdocs/ezrsync.php on line 154

 

I have attached the zip that contains all the files that should do the job (its probable really simple!)

 

Thanks for any help

 

[attachment deleted by admin]

Link to comment
Share on other sites

Hi There,

 

Here are the lines before 154 :

 

 

$count = 0;
foreach ($returnedElements_item as $item)
{
//Getting the item values
@$title = $item->getElement('title');
$title = $title->getValue();

//Check if isn't already added this item
if (!is_already_added($title))
{//End: Check if isn't already added this item

	@$lw_address = $item->getElement('lw:address');

	$lw_main_region = $lw_address->getAllChildren('lw:main_region');

 

Attached is the PHP file itself

 

Thanks

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

Thanks for the suggestion,

 

Unfortunately, its not made any difference, its still giving me the error :

 

Fatal error: Call to a member function on a non-object in /homepages/24/d227024453/htdocs/ezrsync.php on line 154

 

Thanks anyway, any other suggestions welcome.

Link to comment
Share on other sites

I would suggest that $item->getElement('lw:address') is not returning an object, hence $lw_address is not an object, so you can't try and call a method via it.

 

Without looking at more of the code (which I can't from here at work), I wouldn't really be able to help much. Are you sure lw:main_region is a valid element?

Link to comment
Share on other sites

Thanks for the reply, thorpe,

 

I dont really know much about php, I commissioned the work and now the person has gone AWAL & left us in the lurch! 

 

If you have time later, I would really appreciate it if you could have a look at the code in full (attached on first post in ZIP file)

 

Thanks kindly.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.