<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
This is the start of my php document, and it throws up T_STRING errors with validation programs. I have tried viewing the document using XAMPP, and it worked fine, but when I uploaded the document to a server (this is for a class), I was given a server error. To make matters worse, this exact code is in all my other (working) php documents.
The code in its entirety is probably too long to post for a full diagnosis, so I wanted to know if this alone would cause the server error. If not this, what are some common causes?
Other things that seem suspicious:
$values = ["","","","","","",""];
I don't know if this is how a array should be created/cleared, but it was another error brought up with validation programs.
if (strlen($customerlname)>30) {
....
if (!is_numeric($postcode)) {
etc. These are supposed to be fine, though they don't seem to be recognised by N++.
The problem is that the document works with XAMPP, just not on the server. Is XAMPP just being nice and "knowing what I mean"? The only part that I can't test in XAMPP is the database connection:
$conn = mysql_connect("localhost", "XXXX", "XXXX");
mysql_select_db("XXXX", $conn)
or die ('Database not found '.mysql_error());
which again, is in various other (working) documents. Is this probably going to be a server-side issue?
edit: I've found the apparent issue, thank you. The document is running now. The problem was the array, had to change a few instances to $variable = array(...); Thank you all for your help. It's also nice to know about phpinfo() for future reference.