Posted 19 March 2013 - 07:46 AM
<?PHP
$conexion = mysql_connect("mysql3.000webhost.com", "a6845877_aptget", "mysql_query");
mysql_select_db("a6845877_aptget", $conexion);
$action = $_POST['action'];
if ("1" == $action) {
// Post program
$packagename = $_POST['packagename'];
$version = $_POST['version'];
$downloadLink = $_POST['downloadLink'];
$dependencies = $_POST['dependencies'];
$packagename = stripslashes($packagename);
$packagename = mysql_real_escape_string($packagename);
$version = stripslashes($version);
$version = mysql_real_escape_string($version);
$downloadLink = stripslashes($downloadLink);
$downloadLink = mysql_real_escape_string($downloadLink);
$dependencies = stripslashes($dependencies);
$dependencies = mysql_real_escape_string($dependencies);
$result = mysql_query("INSERT INTO packages(PackageName, Verison, DownloadLink, Dependencies) VALUES('$packagename', '$version', '$downloadLink', '$dependencies')")
}
if ("2" == $action) {
// Download program
$packageid = $_POST['packageid'];
$packageid = stripslashes($packageid);
$packageid = mysql_real_escape_string($packageid);
$sql="SELECT * FROM packages WHERE id='$packageid'";
while ($row = mysql_fetch_assoc($result)) {
echo $row['DownloadLink'];
}
}
if ("3" == $action) {
// Search program
$packagename = $_POST['packagename'];
$packagename = stripslashes($packagename);
$packagename = mysql_real_escape_string($packagename);
$sql="SELECT * FROM packages WHERE PackageName='$packagename'";
while ($row = mysql_fetch_assoc($result)) {
echo $row['id'];
}
}
if ("4" == $action) {
// Getinfo about the server
echo "ALLOWPOST = true
ALLOWSEARCH = true
";
}
if ("5" == $action) {
// Get the display
$packageid = $_POST['packageid'];
$packageid = stripslashes($packageid);
$packageid = mysql_real_escape_string($packageid);
$sql="SELECT * FROM packages WHERE id='$packageid'";
while ($row = mysql_fetch_assoc($result)) {
echo $row['display'];
}
}
if ("6" == $action) {
// Get the version
$packageid = $_POST['packageid'];
$packageid = stripslashes($packageid);
$packageid = mysql_real_escape_string($packageid);
$sql="SELECT * FROM packages WHERE id='$packageid'";
while ($row = mysql_fetch_assoc($result)) {
echo $row['version'];
}
}
<?
Parse error: syntax error, unexpected '}' in /home/a6845877/public_html/action.php on line 20