1.

Solve : php probs?

Answer»

So I am working on a php website. (version 5.4)
I am having issues, as I am a bit rusty and haven't done this for about 2 years.
My first issue is I am getting a parse error.
CODE: [Select]Parse error: SYNTAX error, unexpected 'functionName' (T_STRING) in filename.php on line 1(The error is not verbatim)
I don't UNDERSTAND why I a having issues as line 1 and 2 of this utility script are:
Code: [Select]<?php
function connectToProductDB($hostname = "localhost", $username = "public", $dbname = "db", $password = "password123"){To answer my first question:
The issue wasn't with the code itself but the file.
I was working on a different machine than usual, and downloaded the script from the server.
No error was reported by filezilla but for some reason my local php interpretor and the server didn't like the downloaded copy.
My solution was to just redownload it and it then worked like normal.
Out of curiosity can ANYONE explain what POSSIBLY could have happened?No, but what I've found is that the line referred to in an error message for PHP, isn't necessarily where the root of the problem is.



Discussion

No Comment Found