-1

I don't have very much PHP experience so I don't know if this is usual or anything, but I'm having a problem with the "->" sign. I was looking up how to get the value of a XML node and came across something like this

$file = simplexml_load_file($url);
$output['value'] = $file->node[0];

I don't know if this code will work correctly, but the problem I'm having is that everything after the "->" is just printed out on the page and not processed as php code. Including the ?> php ending tag. I don't know what I can do to fix this. Maybe someone can help me to explain this problem.

HenkSpook
  • 1
  • 1
  • 5
    Your PHP is misconfigured/not present/file named wrong, and the ` – Marc B Nov 06 '14 at 19:48
  • It's hard to know without the code bu if `$file->node[0]` evaluates to a string with a wrongly managed quotation mark you could end up with this problem. Try dumping it out with `var_dump()` and then maybe you will need to sanitize it or escape it before assigning. You should definitely be sanitizing imo. – Elin Nov 06 '14 at 20:02

1 Answers1

-1

Error might be due to modified server tags. In servers, default tags are called to execute the php script. sometimes people may define their own custom tags for server side programming.

Atul Jindal
  • 946
  • 8
  • 8