php


Internal Server Error - Is it my syntax?


I've just wrote out this slab of PHP. I get an internal server error when I run it, however. Is it a syntax error? Would anyone mind looking over it?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
echo error_reporting(E_ALL);
$p1MON = strval($_GET['p1MON']);
$p1TUE = strval($_GET['p1TUE']);
$p1WED = strval($_GET['p1WED']);
$p1THU = strval($_GET['p1THU']);
$p1FRI = strval($_GET['p1FRI']);
$p2MON = strval($_GET['p2MON']);
$p2TUE = strval($_GET['p2TUE']);
$p2WED = strval($_GET['p2WED']);
$p2THU = strval($_GET['p2THU']);
$p2FRI = strval($_GET['p2FRI']);
$p3MON = strval($_GET['p3MON']);
$p3TUE = strval($_GET['p3TUE']);
$p3WED = strval($_GET['p3WED']);
$p3THU = strval($_GET['p3THU']);
$p3FRI = strval($_GET['p3FRI']);
$p4MON = strval($_GET['p4MON']);
$p4TUE = strval($_GET['p4TUE']);
$p4WED = strval($_GET['p4WED']);
$p4THU = strval($_GET['p4THU']);
$p4FRI = strval($_GET['p4FRI']);
$p5MON = strval($_GET['p5MON']);
$p5TUE = strval($_GET['p5TUE']);
$p5WED = strval($_GET['p5WED']);
$p5THU = strval($_GET['p5THU']);
$p5FRI = strval($_GET['p5FRI']);
$p6MON = strval($_GET['p6MON']);
$p6TUE = strval($_GET['p6TUE']);
$p6WED = strval($_GET['p6WED']);
$p6THU = strval($_GET['p6THU']);
$p6FRI = strval($_GET['p6FRI']);
$con = mysqli_connect('localhost','XXXX','XXXX','XXXX');
if (!$con) {
die('Could not connect: ' . mysqli_error($con));
} else {
$sql = "INSERT INTO Caspar (day, P1, P2, P3, P4, P5, P6)
VALUES ('MON', '$p1MON', '$p2MON', '$p3MON', '$p4MON', '$p5MON', '$p6MON')";
if (mysqli_query($con, $sql)) {
echo "okay";
} else {
echo "error";
}
}
mysqli_close($con);
}
?></body>
</html>
Thank you. If you find anything, or would like any more information, please let me know.
First of all, no need to use echo before error_reporting(E_ALL);
then your last curly bracket is invalid, remove it and try again. Hope it helps.

Related Links

What does the number after type means in var_dump(object) PHP? [duplicate]
Does a MySQL table require an auto-incrementing ID?
PDO Suggest refine results different than wildcard symbol
PHP-Variable scope [duplicate]
How to execute code in PHP
jQuery Autocomplete ComboBox Options Echo'd by PHP Getting Removed when Match Typed
How to enable SQLite Support on CloudFoundry (PHP Buildpack)
Preserve the folder structure when creating a Zip archive
Call method B of class X from method A of class X?
Twig enable cache after loading Environment
how to install php with nginx
How to get selected value of dropdown list in PHP [closed]
A PHP Error was encountered (trying to upload .json file into webpanel in my database)
Php syntax and programmatical grammer explanation
How to set the filename of a file generated in PHP
Google Hotel Finder, file_get_contents PHP

Categories

HOME
user-interface
svn
generics
jms
redmine
swi-prolog
hid
kivy
ontology
visualforce
google-search-console
supercollider
cdi
specifications
log4j2
grocery-crud
jquery-file-upload
orange-api
pygobject
mixpanel
hidden
deepfreeze
jest
pe
web-analytics
react-dnd
dragula
jpa-2.1
cellular-network
ipa
ruby-daemons
cube
unmarshalling
matlab-app-designer
rspec-rails
private-key
quickcheck
buildforge
code-rally
django-crispy-forms
ms-dos
recovery
flowchart
python-jira
newtons-method
access-denied
optionaldataexception
destroy
wysihtml5
nothing
mura
ptvs
mobile-angular-ui
finder
boost-compute
ogg
scheduledexecutorservice
cefpython
livereload
raw-sockets
nsdata
wicked-pdf
odp.net-managed
persistent-object-store
django-validation
enunciate
odesk
arbre
bjam
org-babel
fasterxml
juttle
rubber
window-resize
producer
android-2.3-gingerbread
air-native-extension
frontbase
mute
libxml-js
jacob
red-system
handshake
zend-pdf
clrprofiler
coordinate
server-name
affinetransform
memory-pool
sigar
litespeed
filelock
space-partitioning
winsxs
eaccelerator
android-2.1-eclair
uninstaller
principles

Resources

Encrypt Message