Ejemplo n.º 1
0
    $ext2 = strtolower(end(explode(".", $_FILES[$thimag]["name"][$key])));
    if ($ext2 == "jpg" || $ext2 == "jpeg" || $ext2 == "png" || $ext2 == "gif") {
        $filename3 = $folder . time() . $image;
        $filename33 = $folder1 . time() . $image;
        $copied = copy($_FILES[$thimag]['tmp_name'][$key], $filename33);
        $throompic = $filename3;
    }
    //echo "INSERT INTO allroom set `p_id`='$insertId',`roomname`='$roomname',`cap1`='$cap1',`cap2`='$cap2',`picture`='$roompic',`thumb`='$throompic',`videofrom`='$videotype'".'---------<br/>';
    $db->exec("INSERT INTO allroom set `p_id`='{$insertId}',`roomname`='{$roomname}',`description`='{$description}',`cap1`='{$cap1}',`cap2`='{$cap2}',`picture`='{$roompic}',`thumb`='{$throompic}',`videofrom`='{$videotype}'");
}
$qperma = $db->prepare('select `permalink` from `permalink` where `pageid`=?');
$qperma->execute(array($category));
$rperma = $qperma->fetch();
$name = htmlspecialchars_decode($name);
$name = strtolower(str_replace(" ", "_", trim($name)));
$name = str_replace("&#39;", "", $name);
$name = str_replace(")", "", $name);
$name = str_replace("(", "", $name);
$name = str_replace("+", "", $name);
writeht($insertId, $name, $rperma['permalink']);
function writeht($id, $folder, $cat)
{
    $fp = fopen('../../.htaccess', 'a+');
    if ($fp) {
        fwrite($fp, 'RewriteRule ^' . $cat . '/' . $folder . '$ venuedetails.php?did=' . $id . ' [QSA,L]
               ');
        fclose($fp);
    }
}
$msg = "Added successfully";
header("location:add_directory.php?msg={$msg}");
Ejemplo n.º 2
0
}
$picture1 = $_FILES['thimg']['name'];
$ext2 = end(explode(".", $_FILES["thimg"]["name"]));
if ($ext2 == "jpg" || $ext2 == "jpeg" || $ext2 == "png" || $ext2 == "gif") {
    $folder = "upload/";
    $filename1 = $folder . time() . $picture1;
    $copied1 = copy($_FILES['thimg']['tmp_name'], $filename1);
}
if ($picture != '' && $picture1 != '') {
    $db->exec("update `blog` set `heading`='{$heading}',`permalink`='{$permalink}',`shortdesc`='{$shortdesc}',`desc`='{$desc}',`image`='{$filename}',`thumb`='{$filename1}' where `id`='{$idval}'");
} elseif ($picture != '') {
    $db->exec("update `blog` set `heading`='{$heading}',`permalink`='{$permalink}',`shortdesc`='{$shortdesc}',`desc`='{$desc}',`image`='{$filename}' where `id`='{$idval}'");
} elseif ($picture1 != '') {
    $db->exec("update `blog` set `heading`='{$heading}',`permalink`='{$permalink}',`shortdesc`='{$shortdesc}',`desc`='{$desc}',`thumb`='{$filename1}' where `id`='{$idval}'");
} else {
    $db->exec("update `blog` set `heading`='{$heading}',`permalink`='{$permalink}',`shortdesc`='{$shortdesc}',`desc`='{$desc}' where `id`='{$idval}'");
}
if ($prevper == '' && $permalink != '') {
    writeht($idval, $permalink);
}
function writeht($id, $folder)
{
    $fp = fopen('../.htaccess', 'a+');
    if ($fp) {
        fwrite($fp, 'RewriteRule ^' . $folder . '$ blog1.php?id=' . $id . ' [QSA,L]
	       ');
        fclose($fp);
    }
}
$msg = "Blog Updated successfully.";
header("location:addblog.php?msg={$msg}");
Ejemplo n.º 3
0
$picture = $_FILES['catimg']['name'];
$ext1 = end(explode(".", $_FILES["catimg"]["name"]));
if ($ext1 == "jpg" || $ext1 == "jpeg" || $ext1 == "png" || $ext1 == "gif") {
    $folder = "upload/";
    $filename = $folder . time() . $picture;
    $copied = copy($_FILES['catimg']['tmp_name'], $filename);
}
$stmtt = $db->prepare("SELECT * FROM category WHERE name=?");
$stmtt->execute(array($catagory));
$row_count = $stmtt->rowCount();
if ($row_count == 0) {
    $stmt = $db->exec("INSERT INTO category set name='{$catagory}',custom_button='{$custom}',example='{$example}',description='{$example_descp}',image='{$filename}',color='{$color}'");
    $cid = $db->lastInsertId();
    $msg = "Succesfully category created";
} else {
    $msg = "Create another category";
}
$catagory = str_replace(" ", "_", $catagory);
$db->exec("insert into `permalink` set `pageid`='{$cid}',`permalink`='{$catagory}'");
writeht($cid, $catagory);
function writeht($id, $folder)
{
    $fp = fopen('../.htaccess', 'a+');
    if ($fp) {
        fwrite($fp, 'RewriteRule ^' . $folder . '/(css|js|images|img|admin/upload|upload)/(.*)?$ /$1/$2 [L,QSA,R=301]
	       RewriteRule ^' . $folder . ' shortlisted.php?cid=' . $id . ' [QSA,L]
	       ');
        fclose($fp);
    }
}
header("location:add_category.php?mess={$msg}");
Ejemplo n.º 4
0
<?php

ini_set("display_errors", 1);
include_once "../function.php";
$qwe = $db->prepare('select d.`id`,d.`name`,p.`permalink` from `directory` d,`permalink` p where d.category=p.pageid');
$qwe->execute();
while ($res = $qwe->fetch()) {
    $res['name'] = htmlspecialchars_decode($res['name']);
    $name = strtolower(str_replace(" ", "_", trim($res['name'])));
    $name = str_replace("&#39;", "", $name);
    $name = str_replace(")", "", $name);
    $name = str_replace("(", "", $name);
    $name = str_replace("+", "", $name);
    writeht($res['id'], $name, $res['permalink']);
    //echo "RewriteRule ^".$res['permalink']."/".$name."$ venuedetails.php?did=".$res['id']." [QSA,L]" .'<br/>';
}
function writeht($id, $folder, $cat)
{
    $fp = fopen('../.htaccess', 'a+');
    if ($fp) {
        fwrite($fp, 'RewriteRule ^' . $cat . '/' . $folder . '$ venuedetails.php?did=' . $id . ' [QSA,L]
               ');
        fclose($fp);
    }
}
Ejemplo n.º 5
0
    $fp = fopen('.htaccess', 'a+');
    if ($fp) {
        fwrite($fp, 'RewriteRule ^' . $url . '$ template/index.php?id=' . $idd . ' [QSA,L]
               ');
        fclose($fp);
    }
}
//echo $rcount;
if ($rcount == 0) {
    $qwe = $db->prepare('insert into `my_template` set `user_id`=?,`page1theme`=?,`page2theme`=?,`eventname`=?,`url`=?,`maintxtcolor`=?,`maintextfontsize`=?,`headerclr`=?,`backclr`=?,`eventtitle`=?,`description1`=?,`description2`=?,`rsvptitle`=?,`rsvpbuttonname`=?,`gallerytitle`=?');
    $qwe->execute(array($id, $coverpage, $story, $_SESSION['name'], $url, '#000000', '48', '#03a196', '#ffffff', 'Story', 'Insert Paragraph here', 'Insert Paragraph here', 'Event Details', 'RSVP', 'Gallery'));
    $idd = $db->lastInsertId();
    $db->exec("insert into `gallery` set `user_id`={$id},`website_id`='{$idd}',`type`='profilephoto',`image`='upload/1436452650Solemnization(600X400).jpg'");
    if ($story == 'Couple') {
        $db->exec("insert into `gallery` set `user_id`={$id},`website_id`='{$idd}',`type`='headshot',`image`='upload/imgo.jpg'");
        $db->exec("insert into `gallery` set `user_id`={$id},`website_id`='{$idd}',`type`='headshot',`image`='upload/imgo.jpg'");
    } else {
        if ($story == '4 Pictures') {
            $db->exec("insert into `gallery` set `user_id`={$id},`website_id`='{$idd}',`type`='profilephoto',`image`='upload/imgo.jpg'");
            $db->exec("insert into `gallery` set `user_id`={$id},`website_id`='{$idd}',`type`='profilephoto',`image`='upload/imgo.jpg'");
            $db->exec("insert into `gallery` set `user_id`={$id},`website_id`='{$idd}',`type`='profilephoto',`image`='upload/imgo.jpg'");
            $db->exec("insert into `gallery` set `user_id`={$id},`website_id`='{$idd}',`type`='profilephoto',`image`='upload/imgo.jpg'");
        } else {
            $db->exec("insert into `gallery` set `user_id`={$id},`website_id`='{$idd}',`type`='headshot',`image`='upload/imgo.jpg'");
        }
    }
    writeht($url, $idd);
} else {
    $db->exec("update `my_template` set `page1theme`='{$coverpage}',`page2theme`='{$story}' where `user_id`='{$id}'");
}
header("location:website");
Ejemplo n.º 6
0
$permalink = htmlentities($_POST['permalink'], ENT_QUOTES);
$picture = $_FILES['img']['name'];
$ext1 = end(explode(".", $_FILES["img"]["name"]));
if ($ext1 == "jpg" || $ext1 == "jpeg" || $ext1 == "png" || $ext1 == "gif") {
    $folder = "upload/";
    $filename = $folder . time() . $picture;
    $copied = copy($_FILES['img']['tmp_name'], $filename);
}
$picture1 = $_FILES['thimg']['name'];
$ext2 = end(explode(".", $_FILES["thimg"]["name"]));
if ($ext2 == "jpg" || $ext2 == "jpeg" || $ext2 == "png" || $ext2 == "gif") {
    $folder = "upload/";
    $filename1 = $folder . time() . $picture1;
    $copied1 = copy($_FILES['thimg']['tmp_name'], $filename1);
}
$db->exec("insert into `blog` set `heading`='{$heading}',`shortdesc`='{$shortdesc}',`desc`='{$desc}',`image`='{$filename}',`thumb`='{$filename1}',`permalink`='{$permalink}'");
$bid = $db->lastInsertId();
if ($permalink != '') {
    writeht($bid, $permalink);
}
function writeht($id, $folder)
{
    $fp = fopen('../.htaccess', 'a+');
    if ($fp) {
        fwrite($fp, 'RewriteRule ^' . $folder . '$ blog1.php?id=' . $id . ' [QSA,L]
	       ');
        fclose($fp);
    }
}
$msg = "Blog added successfully.";
header("location:addblog.php?msg={$msg}");
Ejemplo n.º 7
0
<?php

ini_set("display_errors", 1);
include_once "../../function.php";
$category = 1;
$name = "hello test ' (jyoti)";
$qperma = $db->prepare('select `permalink` from `permalink` where `pageid`=?');
$qperma->execute(array($category));
$rperma = $qperma->fetch();
$name = htmlspecialchars_decode($name);
$name = strtolower(str_replace(" ", "_", trim($name)));
$name = str_replace("&#39;", "", $name);
$name = str_replace(")", "", $name);
$name = str_replace("(", "", $name);
$name = str_replace("+", "", $name);
writeht(300, $name, $rperma['permalink']);
function writeht($id, $folder, $cat)
{
    $fp = fopen('../../.htaccess', 'a+');
    if ($fp) {
        fwrite($fp, 'RewriteRule ^' . $cat . '/' . $folder . '$ venuedetails.php?did=' . $id . ' [QSA,L]
               ');
        fclose($fp);
    }
}