ID;
$postcontent = “Please create your post here.”;

// check account settings and redirect if someone has tried to circumvent the payment process

$conn = new mysqli(“localhost”, “wordpress_8”, “60OqoY_Tt4”, “wordpress_a”);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}

$sql = “SELECT fldPurchaseAction FROM pp_pc_users WHERE fldUserIDNUM = “.$userid;
//echo “sql is “.$sql;
$result = $conn->query($sql);

while($row = $result->fetch_assoc()) {
$action=$row[‘fldPurchaseAction’];
}

$conn->close();
//echo “action is “.$action;
//exit();
if($action==”None”){
echo ““;
}

$authorise = $_GET[‘a’];
if($authorise!=”1”){
echo ““;
}

if($_POST[‘action’]==”postevent”) {
$bodytext = $_POST[‘editor1’];
$newbodytext = str_replace(‘\”‘, ”, $bodytext);
$posttitle = $_POST[‘posttitle’];
$startdate = $_POST[‘timestamp’];
$enddate = $_POST[‘timestamp2’];
$company = $_POST[‘company’];
$websitelinkurl = $_POST[‘websitelinkurl’];
$venuename = $_POST[‘venuename’];
$venuestreet = $_POST[‘venuestreet’];
$venuetowncity = $_POST[‘venuetowncity’];
$venuestatecounty = $_POST[‘venuestatecounty’];
$country = $_POST[‘country’];
$region = $_POST[‘region’];
$category = $_POST[‘category’];

$conference = “false”;
$exhibition = “false”;
$training = “false”;
$virtualcongress = “false”;
$webinar = “false”;

if(isset($_POST[‘conference’])){
$conference=”true”;
}

if(isset($_POST[‘exhibition’])){
$exhibition=”true”;
}

if(isset($_POST[‘training’])){
$training=”true”;
}

if(isset($_POST[‘virtualcongress’])){
$virtualcongress=”true”;
}

if(isset($_POST[‘webinar’])){
$webinar=”true”;
}

$categorystring = “930”; //there may be be more numbers?
$tags = $_POST[‘tags’];
$tagsarray = explode(“,”, $tags, 0);

$overallstring = “”;
$overallstring = $overallstring.$newbodytext.”


“;
$overallstring = $overallstring.”

“.$company.”



“;
$overallstring = $overallstring.”Start Date : “.$startdate.” End Date : “.$enddate.”

“;
$overallstring = $overallstring.”
Region : “.$region;
$overallstring = $overallstring.”
Event Category : “.$category;
$overallstring = $overallstring.”

Event Components :
“;
if($conference==”true”){
$overallstring = $overallstring.”Conference
“;
}
if($exhibition==”true”){
$overallstring = $overallstring.”Exhibition
“;
}
if($training==”true”){
$overallstring = $overallstring.”Training
“;
}
if($virtualcongress==”true”){
$overallstring = $overallstring.”Virtual Congress
“;
}
if($webinar==”true”){
$overallstring = $overallstring.”Webinar
“;
}

$overallstring = $overallstring.”

Venue Information :”;
$overallstring = $overallstring.”
“.$venuename.”
“.$venuestreet.”
“.$venuetowncity.”
“.$venuestatecounty.”
“.”Click here to visit their site”;

// Create post object
$my_post = array(
‘post_title’ =>$posttitle,
‘post_content’ =>$overallstring,
‘post_status’ =>’publish’,
‘post_author’ =>$userid,
‘post_category’=>array($categorystring),
‘tags_input’=>$tagsarray
);
$post_id = wp_insert_post( $my_post, $wp_error );

//upload the featured image to the below url here
$target_dir = “/data/www/pharmaphorum.com/wp-content/uploads/”;

$target_file = $target_dir . basename($_FILES[“fileToUpload”][“name”]);
//echo “target file is “.$target_file;
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST[“submit”])) {
$check = getimagesize($_FILES[“fileToUpload”][“tmp_name”]);
if($check !== false) {
// echo “File is an image – ” . $check[“mime”] . “.”;
$uploadOk = 1;
} else {
// echo “File is not an image.”;
// $uploadOk = 0;
}
}
// Check if file already exists
if (file_exists($target_file)) {
// echo “Sorry, file already exists.”;
// $uploadOk = 0;
}
// Check file size
if ($_FILES[“fileToUpload”][“size”] > 5000000) {
// echo “Sorry, your file is too large.”;
// $uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != “jpg” && $imageFileType != “png” && $imageFileType != “jpeg”
&& $imageFileType != “gif” ) {
// echo “Sorry, only JPG, JPEG, PNG & GIF files are allowed.”;
// $uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo “Sorry, your file was not uploaded.”;
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES[“fileToUpload”][“tmp_name”], $target_file)) {
//echo “The file “. basename( $_FILES[“fileToUpload”][“name”]). ” has been uploaded.”;
} else {
// echo “Sorry, there was an error uploading your file.”;
}
}

//end upload

//append the featured image to the post

$image_url = “https://pharmaphorum.com/wp-content/uploads/”.basename($_FILES[“fileToUpload”][“name”]);
//echo “url is “.$image_url;
$filename = basename($image_url);
if($filename!=””){
$wp_filetype = wp_check_filetype( $filename, null );

// Set attachment data
$attachment = array(
‘post_mime_type’ => $wp_filetype[‘type’],
);

// Create the attachment
$attach_id = wp_insert_attachment( $attachment, $filename, $post_id );

// Include image.php
require_once(ABSPATH . ‘wp-admin/includes/image.php’);

// Define attachment metadata
$attach_data = wp_generate_attachment_metadata( $attach_id, $filename );

// Assign metadata to attachment
wp_update_attachment_metadata( $attach_id, $attach_data );

// And finally assign featured image to post
set_post_thumbnail( $post_id, $attach_id );
}

//end of append featured image

//update the db

//$timestamp = microtime();

$sqlpp_post = “INSERT INTO pp_pc_posts (fldPostIDNUM, fldUserIDNUM, fldPostTitle, fldPostCategory, fldPostedOnBehalfOfName, fldMicrotimePosted, fldPostContent, fldPostTags, fldEventStartDate, fldEventEndDate, fldWebsiteLink, fldVenueName, fldVenueStreetAddress, fldVenueTownCity, fldVenueStateCounty, fldVenueCountry, fldRegion, fldCategory, fldConference, fldExhibition, fldTraining, fldVirtualCongress, fldWebinar) VALUES (“.$post_id.”, “.$userid.”, ‘”.$posttitle.”‘, ‘Event’, ‘”.$company.”‘, 100, ‘”.$newbodytext.”‘, ‘”.$tags.”‘, ‘”.$startdate.”‘, ‘”.$enddate.”‘, ‘”.$websitelinkurl.”‘, ‘”.$venuename.”‘, ‘”.$venuestreet.”‘, ‘”.$venuetowncity.”‘, ‘”.$venuestatecounty.”‘, ‘”.$country.”‘, ‘”.$region.”‘, ‘”.$category.”‘, ‘”.$conference.”‘, ‘”.$exhibition.”‘, ‘”.$training.”‘, ‘”.$virtualcongress.”‘, ‘”.$webinar.”‘)”;

//echo “sql is : “.$sqlpp_post;

$conn = new mysqli(“localhost”, “wordpress_8”, “60OqoY_Tt4”, “wordpress_a”);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}

$result = $conn->query($sqlpp_post);

//resets fldpurchaseaction in pp_pc_users to none

$sqlupdateuser = “UPDATE pp_pc_users SET fldPurchaseAction = ‘None’ WHERE fldUserIDNUM = “.$userid;

$resultupdateuser = $conn->query($sqlupdateuser);

$conn->close();
}

if($_POST[‘action’]==”postappointment”) {
$bodytext = $_POST[‘editor1’];
$newbodytext = str_replace(‘\”‘, ”, $bodytext);
$posttitle = $_POST[‘posttitle’];
//$startdate = $_POST[‘timestamp’];
//$enddate = $_POST[‘timestamp2’];
$company = $_POST[‘company’];
$websitelinkurl = $_POST[‘websitelinkurl’];
$venuename = $_POST[‘venuename’];
$venuestreet = $_POST[‘venuestreet’];
$venuetowncity = $_POST[‘venuetowncity’];
$venuestatecounty = $_POST[‘venuestatecounty’];
$country = $_POST[‘country’];
$region = $_POST[‘region’];
$category = $_POST[‘category’];

$conference = “false”;
$exhibition = “false”;
$training = “false”;
$virtualcongress = “false”;
$webinar = “false”;

if(isset($_POST[‘conference’])){
$conference=”true”;
}

if(isset($_POST[‘exhibition’])){
$exhibition=”true”;
}

if(isset($_POST[‘training’])){
$training=”true”;
}

if(isset($_POST[‘virtualcongress’])){
$virtualcongress=”true”;
}

if(isset($_POST[‘webinar’])){
$webinar=”true”;
}

$categorystring = “934”; //there may be be more numbers?
$tags = $_POST[‘tags’];

$overallstring = “”;
$overallstring = $overallstring.$newbodytext.”


“;
$overallstring = $overallstring.”

“.$company.”



“;
//$overallstring = $overallstring.”Start Date : “.$startdate.” End Date : “.$enddate.”

“;
$overallstring = $overallstring.”
Region : “.$region;
//$overallstring = $overallstring.”
Event Category : “.$category;
//$overallstring = $overallstring.”

Event Components :
“;
if($conference==”true”){
$overallstring = $overallstring.”Conference
“;
}
if($exhibition==”true”){
$overallstring = $overallstring.”Exhibition
“;
}
if($training==”true”){
$overallstring = $overallstring.”Training
“;
}
if($virtualcongress==”true”){
$overallstring = $overallstring.”Virtual Congress
“;
}
if($webinar==”true”){
$overallstring = $overallstring.”Webinar
“;
}

//$overallstring = $overallstring.”

Venue Information :”;
//$overallstring = $overallstring.”
“.$venuename.”
“.$venuestreet.”
“.$venuetowncity.”
“.$venuestatecounty.”
“;
$overallstring = $overallstring.”

Click here to visit their site”;

// Create post object
$my_post = array(
‘post_title’ =>$posttitle,
‘post_content’ =>$overallstring,
‘post_status’ =>’publish’,
‘post_author’ =>$userid,
‘post_category’=>array($categorystring),
‘tags_input’=>array($tags)
);
$post_id = wp_insert_post( $my_post, $wp_error );

//upload the featured image to the below url here
$target_dir = “/data/www/pharmaphorum.com/wp-content/uploads/”;

$target_file = $target_dir . basename($_FILES[“fileToUpload”][“name”]);
//echo “target file is “.$target_file;
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST[“submit”])) {
$check = getimagesize($_FILES[“fileToUpload”][“tmp_name”]);
if($check !== false) {
// echo “File is an image – ” . $check[“mime”] . “.”;
$uploadOk = 1;
} else {
// echo “File is not an image.”;
// $uploadOk = 0;
}
}
// Check if file already exists
if (file_exists($target_file)) {
// echo “Sorry, file already exists.”;
// $uploadOk = 0;
}
// Check file size
if ($_FILES[“fileToUpload”][“size”] > 5000000) {
// echo “Sorry, your file is too large.”;
// $uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != “jpg” && $imageFileType != “png” && $imageFileType != “jpeg”
&& $imageFileType != “gif” ) {
// echo “Sorry, only JPG, JPEG, PNG & GIF files are allowed.”;
// $uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo “Sorry, your file was not uploaded.”;
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES[“fileToUpload”][“tmp_name”], $target_file)) {
//echo “The file “. basename( $_FILES[“fileToUpload”][“name”]). ” has been uploaded.”;
} else {
// echo “Sorry, there was an error uploading your file.”;
}
}

//end upload

//append the featured image to the post

$image_url = “https://pharmaphorum.com/wp-content/uploads/”.basename($_FILES[“fileToUpload”][“name”]);
//echo “url is “.$image_url;
$filename = basename($image_url);
if($filename!=””){
$wp_filetype = wp_check_filetype( $filename, null );

// Set attachment data
$attachment = array(
‘post_mime_type’ => $wp_filetype[‘type’],
);

// Create the attachment
$attach_id = wp_insert_attachment( $attachment, $filename, $post_id );

// Include image.php
require_once(ABSPATH . ‘wp-admin/includes/image.php’);

// Define attachment metadata
$attach_data = wp_generate_attachment_metadata( $attach_id, $filename );

// Assign metadata to attachment
wp_update_attachment_metadata( $attach_id, $attach_data );

// And finally assign featured image to post
set_post_thumbnail( $post_id, $attach_id );
}

//end of append featured image

//update the db

//$timestamp = microtime();

$sqlpp_post = “INSERT INTO pp_pc_posts (fldPostIDNUM, fldUserIDNUM, fldPostTitle, fldPostCategory, fldPostedOnBehalfOfName, fldMicrotimePosted, fldPostContent, fldPostTags, fldWebsiteLink, fldVenueName, fldVenueStreetAddress, fldVenueTownCity, fldVenueStateCounty, fldVenueCountry, fldRegion, fldCategory, fldConference, fldExhibition, fldTraining, fldVirtualCongress, fldWebinar) VALUES (“.$post_id.”, “.$userid.”, ‘”.$posttitle.”‘, ‘Event’, ‘”.$company.”‘, 100, ‘”.$newbodytext.”‘, ‘”.$tags.”‘, ‘”.$websitelinkurl.”‘, ‘”.$venuename.”‘, ‘”.$venuestreet.”‘, ‘”.$venuetowncity.”‘, ‘”.$venuestatecounty.”‘, ‘”.$country.”‘, ‘”.$region.”‘, ‘”.$category.”‘, ‘”.$conference.”‘, ‘”.$exhibition.”‘, ‘”.$training.”‘, ‘”.$virtualcongress.”‘, ‘”.$webinar.”‘)”;

//echo “sql is : “.$sqlpp_post;

$conn = new mysqli(“localhost”, “wordpress_8”, “60OqoY_Tt4”, “wordpress_a”);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}

$result = $conn->query($sqlpp_post);

//resets fldpurchaseaction in pp_pc_users to none

$sqlupdateuser = “UPDATE pp_pc_users SET fldPurchaseAction = ‘None’ WHERE fldUserIDNUM = “.$userid;

$resultupdateuser = $conn->query($sqlupdateuser);

$conn->close();
}

if($_POST[‘action’]==”postpressrelease”) {
$bodytext = $_POST[‘editor1’];
$newbodytext = str_replace(‘\”‘, ”, $bodytext);
$posttitle = $_POST[‘posttitle’];
//$startdate = $_POST[‘timestamp’];
//$enddate = $_POST[‘timestamp2’];
$company = $_POST[‘company’];
$websitelinkurl = $_POST[‘websitelinkurl’];
$venuename = $_POST[‘venuename’];
$venuestreet = $_POST[‘venuestreet’];
$venuetowncity = $_POST[‘venuetowncity’];
$venuestatecounty = $_POST[‘venuestatecounty’];
$country = $_POST[‘country’];
$region = $_POST[‘region’];
$category = $_POST[‘category’];

$conference = “false”;
$exhibition = “false”;
$training = “false”;
$virtualcongress = “false”;
$webinar = “false”;

if(isset($_POST[‘conference’])){
$conference=”true”;
}

if(isset($_POST[‘exhibition’])){
$exhibition=”true”;
}

if(isset($_POST[‘training’])){
$training=”true”;
}

if(isset($_POST[‘virtualcongress’])){
$virtualcongress=”true”;
}

if(isset($_POST[‘webinar’])){
$webinar=”true”;
}

$categorystring = “932”; //there may be be more numbers?
$tags = $_POST[‘tags’];

$overallstring = “”;
$overallstring = $overallstring.$newbodytext.”


“;
$overallstring = $overallstring.”

“.$company.”



“;
//$overallstring = $overallstring.”Start Date : “.$startdate.” End Date : “.$enddate.”

“;
$overallstring = $overallstring.”
Region : “.$region;
//$overallstring = $overallstring.”
Event Category : “.$category;
//$overallstring = $overallstring.”

Event Components :
“;
if($conference==”true”){
$overallstring = $overallstring.”Conference
“;
}
if($exhibition==”true”){
$overallstring = $overallstring.”Exhibition
“;
}
if($training==”true”){
$overallstring = $overallstring.”Training
“;
}
if($virtualcongress==”true”){
$overallstring = $overallstring.”Virtual Congress
“;
}
if($webinar==”true”){
$overallstring = $overallstring.”Webinar
“;
}

//$overallstring = $overallstring.”

Venue Information :”;
//$overallstring = $overallstring.”
“.$venuename.”
“.$venuestreet.”
“.$venuetowncity.”
“.$venuestatecounty.”
“;
$overallstring = $overallstring.”

Click here to visit their site”;

// Create post object
$my_post = array(
‘post_title’ =>$posttitle,
‘post_content’ =>$overallstring,
‘post_status’ =>’publish’,
‘post_author’ =>$userid,
‘post_category’=>array($categorystring),
‘tags_input’=>array($tags)
);
$post_id = wp_insert_post( $my_post, $wp_error );

//upload the featured image to the below url here
$target_dir = “/data/www/pharmaphorum.com/wp-content/uploads/”;

$target_file = $target_dir . basename($_FILES[“fileToUpload”][“name”]);
//echo “target file is “.$target_file;
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST[“submit”])) {
$check = getimagesize($_FILES[“fileToUpload”][“tmp_name”]);
if($check !== false) {
// echo “File is an image – ” . $check[“mime”] . “.”;
$uploadOk = 1;
} else {
// echo “File is not an image.”;
// $uploadOk = 0;
}
}
// Check if file already exists
if (file_exists($target_file)) {
// echo “Sorry, file already exists.”;
// $uploadOk = 0;
}
// Check file size
if ($_FILES[“fileToUpload”][“size”] > 5000000) {
// echo “Sorry, your file is too large.”;
//$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != “jpg” && $imageFileType != “png” && $imageFileType != “jpeg”
&& $imageFileType != “gif” ) {
// echo “Sorry, only JPG, JPEG, PNG & GIF files are allowed.”;
// $uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo “Sorry, your file was not uploaded.”;
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES[“fileToUpload”][“tmp_name”], $target_file)) {
//echo “The file “. basename( $_FILES[“fileToUpload”][“name”]). ” has been uploaded.”;
} else {
// echo “Sorry, there was an error uploading your file.”;
}
}

//end upload

//append the featured image to the post

$image_url = “https://pharmaphorum.com/wp-content/uploads/”.basename($_FILES[“fileToUpload”][“name”]);
//echo “url is “.$image_url;
$filename = basename($image_url);
if($filename!=””){
$wp_filetype = wp_check_filetype( $filename, null );

// Set attachment data
$attachment = array(
‘post_mime_type’ => $wp_filetype[‘type’],
);

// Create the attachment
$attach_id = wp_insert_attachment( $attachment, $filename, $post_id );

// Include image.php
require_once(ABSPATH . ‘wp-admin/includes/image.php’);

// Define attachment metadata
$attach_data = wp_generate_attachment_metadata( $attach_id, $filename );

// Assign metadata to attachment
wp_update_attachment_metadata( $attach_id, $attach_data );

// And finally assign featured image to post
set_post_thumbnail( $post_id, $attach_id );
}

//end of append featured image

//update the db

//$timestamp = microtime();

$sqlpp_post = “INSERT INTO pp_pc_posts (fldPostIDNUM, fldUserIDNUM, fldPostTitle, fldPostCategory, fldPostedOnBehalfOfName, fldMicrotimePosted, fldPostContent, fldPostTags, fldWebsiteLink, fldVenueName, fldVenueStreetAddress, fldVenueTownCity, fldVenueStateCounty, fldVenueCountry, fldRegion, fldCategory, fldConference, fldExhibition, fldTraining, fldVirtualCongress, fldWebinar) VALUES (“.$post_id.”, “.$userid.”, ‘”.$posttitle.”‘, ‘Event’, ‘”.$company.”‘, 100, ‘”.$newbodytext.”‘, ‘”.$tags.”‘, ‘”.$websitelinkurl.”‘, ‘”.$venuename.”‘, ‘”.$venuestreet.”‘, ‘”.$venuetowncity.”‘, ‘”.$venuestatecounty.”‘, ‘”.$country.”‘, ‘”.$region.”‘, ‘”.$category.”‘, ‘”.$conference.”‘, ‘”.$exhibition.”‘, ‘”.$training.”‘, ‘”.$virtualcongress.”‘, ‘”.$webinar.”‘)”;

//echo “sql is : “.$sqlpp_post;

$conn = new mysqli(“localhost”, “wordpress_8”, “60OqoY_Tt4”, “wordpress_a”);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}

$result = $conn->query($sqlpp_post);

//resets fldpurchaseaction in pp_pc_users to none

$sqlupdateuser = “UPDATE pp_pc_users SET fldPurchaseAction = ‘None’ WHERE fldUserIDNUM = “.$userid;

$resultupdateuser = $conn->query($sqlupdateuser);

$conn->close();
}

if($_GET[‘posttype’]==”event”){?>


Title
Start Date :
End Date :
Company
Featured image
Website link
Body text
Venue Information
Venue Name
Street
Town/City
State/County
Country
Region
Category
Event type (please tick all that apply)
Conference
Exhibition
Training
Virtual Congress
Webinar
Please type tags separated by a comma
Tags




Title
Company
Featured image
Website link
Body text
Country
Region
Category
Please type tags separated by a comma
Tags




Title
Company
Featured image
Website link
Body text
Country
Region
Category
Please type tags separated by a comma
Tags

CONTINUE TO SITE >
X
Close in 10 seconds