Skip to content

Commit

Permalink
change image problem solved
Browse files Browse the repository at this point in the history
  • Loading branch information
umaljayawardena committed Jun 27, 2021
1 parent 2b61177 commit 33bb2bd
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions change_image.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<?php
<?php

if(isset($URL[2]) && isset($URL[2]) == "cover" && count($_FILES) > 0 && isset($group_data))
{
$URL[1] = "cover";
}

if(isset($group_data)){

$user_data = $group_data;
}

if(isset($URL[1]) && ($URL[1] == "profile" || $URL[1] == "cover"))
if(isset($_GET['change']) && ($_GET['change'] == "profile" || $_GET['change'] == "cover"))
{

if(isset($_FILES['file']['name']) && $_FILES['file']['name'] != "")
Expand Down Expand Up @@ -40,10 +30,10 @@
$change = "profile";

//check for mode
if(isset($URL[1]))
if(isset($_GET['change']))
{

$change = $URL[1];
$change = $_GET['change'];
}


Expand All @@ -68,9 +58,6 @@
{

$userid = $user_data['userid'];
if(isset($group_data)){
$userid = $group_data['userid'];
}

if($change == "cover")
{
Expand All @@ -91,14 +78,9 @@
//create a post
$post = new Post();

if(isset($group_data)){
$post->create_post($userid, $_POST,$filename,$group_data['userid']);
header(("Location: ".ROOT."group/". $group_data['userid']));
}else{
$post->create_post($userid, $_POST,$filename);
header(("Location: ".ROOT."profile"));
}

$post->create_post($userid, $_POST,$filename);

header(("Location: profile.php"));
die;
}

Expand Down

0 comments on commit 33bb2bd

Please sign in to comment.