Unable to connect to the database server at this time.
" );
}
else
{
// Select the jokes database
if (! @mysql_select_db("bikerpla_dwh") )
{
echo( "Unable to locate the dwh database at this time.
" );
}
else
{
if($pid)
{
$stm_event =mysql_query("SELECT EVENT_ID,
SEO_NAME,
NAME
FROM EVENT
WHERE EVENT_ID = " . $pid);
$row_event = mysql_fetch_array($stm_event);
}
if($submit==1)
{
if ($_POST["event_name"] && $_POST["city"] && $_POST["state"] && $_POST["month"]&& $_POST["year"] &&
$_POST["name"] && $_FILES['imagefile1']["type"])
{
$stm_proc_max_id = mysql_query("SELECT IFNULL(MAX(EVENT_PHOTO_ID), 0) MAX_ID
FROM EVENT_PHOTO_PROC");
$row_proc_max_id = mysql_fetch_array($stm_proc_max_id);
$proc_max_id = $row_proc_max_id["MAX_ID"];
$stm_max_id = mysql_query("SELECT IFNULL(MAX(EVENT_PHOTO_ID), 0) MAX_ID
FROM EVENT_PHOTO");
$row_max_id = mysql_fetch_array($stm_max_id);
$max_id = $row_max_id["MAX_ID"];
if($proc_max_id>$max_id)
{
$v_event_photo_id = $proc_max_id + 1;
}
else
{
$v_event_photo_id = $max_id + 1;
}
$insert = mysql_query("INSERT INTO EVENT_PHOTO_PROC(EVENT_PHOTO_ID, EVENT_ID, EVENT_NAME, STATE, CITY,
YEAR, MONTH, DESCRIPTION, NAME, EMAIL, EVENT_SEO_NAME)
VALUES('" . $v_event_photo_id . "',
'" . $row_event["EVENT_ID"] . "',
'" . urlencode(ucwords(strtolower(str_replace("''", "~~~" , $_POST["event_name"])))) . "',
'" . $_POST["state"] . "',
'" . urlencode(ucwords(strtolower(str_replace("''", "~~~" , $_POST["city"])))) . "',
'" . urlencode($_POST["year"]) . "',
'" . urlencode($_POST["month"]) . "',
'" . urlencode(ucwords(strtolower(str_replace("''", "~~~" , $_POST["description"])))) . "',
'" . urlencode(ucwords(strtolower(str_replace("''", "~~~" , $_POST["name"])))) . "',
'" . urlencode(ucwords(strtolower(str_replace("''", "~~~" , $_POST["email"])))) . "',
'" . $row_event["SEO_NAME"] . "')");
$mime = $_FILES['imagefile1']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_1.jpg";
$image_name1 = $v_event_photo_id . "_1.jpg";
move_uploaded_file($_FILES['imagefile1']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile2']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_2.jpg";
$image_name2 = $v_event_photo_id . "_2.jpg";
move_uploaded_file($_FILES['imagefile2']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile3']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_3.jpg";
$image_name3 = $v_event_photo_id . "_3.jpg";
move_uploaded_file($_FILES['imagefile3']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile4']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_4.jpg";
$image_name4 = $v_event_photo_id . "_4.jpg";
move_uploaded_file($_FILES['imagefile4']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile5']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_5.jpg";
$image_name5 = $v_event_photo_id . "_5.jpg";
move_uploaded_file($_FILES['imagefile5']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile6']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_6.jpg";
$image_name5 = $v_event_photo_id . "_6.jpg";
move_uploaded_file($_FILES['imagefile6']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile7']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_7.jpg";
$image_name5 = $v_event_photo_id . "_7.jpg";
move_uploaded_file($_FILES['imagefile7']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile8']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_8.jpg";
$image_name5 = $v_event_photo_id . "_8.jpg";
move_uploaded_file($_FILES['imagefile8']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile9']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_9.jpg";
$image_name5 = $v_event_photo_id . "_9.jpg";
move_uploaded_file($_FILES['imagefile9']['tmp_name'], $image_name);
clearstatcache;
}
$mime = $_FILES['imagefile10']["type"];
if($mime=="image/jpeg" || $mime=="image/pjpeg")
{
clearstatcache;
$image_name = "image/photo/" . $v_event_photo_id . "_10.jpg";
$image_name5 = $v_event_photo_id . "_10.jpg";
move_uploaded_file($_FILES['imagefile10']['tmp_name'], $image_name);
clearstatcache;
}
//if(file_exists($image_name))
// {
// echo("exists");
// }
// else {echo("do not exists");}
}
else
{
$v_refill = 1;
}
}
}
}
mysql_close($dbcnx);
?>
BikerPlaza.com - Official Motorcycle Event Photo Submission
Show your motorcycle for all to see
Your submission failed, please check the following:
1. Make sure that all the fields in Red are populated correctly.
2. Make sure that there are no HTML tags in the Comments.
3. Remove any none-alphanumeric characters from the Event Name, City, Comments, and Your Name("&', etc).
4. Remove any & and ' from the Comments.
");
echo(mysql_error());
}
else
{
if ($submit==1)
{
echo("
Thank you for your photos submission
");
echo(" ");
}
}
?>
Add photos of " . $row_event["NAME"] . " from past years, it will give your event more visibility, credibility and attract more bikers. ");
}
?>
Please enter the Motorcycle Event photos information below, it will be approved and posted within few hours.
Fields in Red must be populated !!!
");
?>