Server IP : 51.89.169.208 / Your IP : 216.73.216.9 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/members/ |
Upload File : |
<?php $path = $_SERVER['DOCUMENT_ROOT']; include_once $path.'/connect_db.php'; include 'accesscontrol.php'; include_once('plural.php'); // css for menu $styleManage = 'color:#ff6131;background-color:#fff;border-top:1px solid #c9c9c9;font-weight:bold;'; $adid=$_GET['adid']; // check if advert beleongs to members if(advert_check($adid,$memberid)===false){header('Location: index.html');exit();} $example_list=array('e.g. Restaurant','e.g. Indian Food','e.g. Curry House'); $example_false=array('eg','eg','eg'); $add_que_sql = $connect->query("SELECT * FROM ads WHERE memberid ='{$memberid}' AND adid ='{$adid}'"); $add_row = $add_que_sql->fetch_assoc(); if(isset($_POST['submit'])){ //-- singular if($_POST['category']){ $categories=addslashes($_POST['category']); $categories=array_filter($categories); }else{ $categories=''; } $types=$_POST['type']; // compiling category singular if($categories!=''){ $category=' || '; foreach($categories as $key=>$cat){ if (strpos($cat,'e.g') !== false) { }else{ if($cat==$example_list[$key]){ $category.=''; }else if(str_word_count($cat)>5){ $errors[]='Please enter less than 5 words.'; }else if(strpos($cat,' '.$add_row['town_name']) !== false){ $errors[]='Please do not use your town name in your tags.'; } $category.= $cat.' || '; $category_plural.= $cat.' '; } } } // to see if any red flags appear, [categories that has not been selected from drop down] if (in_array("false", $types)) { $errors[]='Please ensure that you have selected a category from the drop down list.'; } $category = ""; foreach($types as $key => $cat){ $cat = addslashes(trim($cat)); $category .= $cat; if($key != (count($types) - 1)){ $category .= " || "; } } if(empty($errors)){ $category_plural = singplural($category_plural); $connect->query("UPDATE ads SET category='{$category}',category_plural='{$category_plural}',seo_title='' WHERE `adid` = '{$adid}' AND `memberid` = '{$memberid}'"); $success=TRUE; ?><script>location.href='postbusiness5.html?adid=<?=$adid?>'</script><? }else{ foreach($errors as $efound){ $error_car.='- '.$efound.'<br>'; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <title>YellowLeaf - Homepage</title> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="/header-footer/global.css"> <link rel="stylesheet" href="submit-advert.css"> <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> <style> .error { color: #ff0000f7;} </style> </head> <?php include_once $path.'/header-footer/header.html'; ?> <section> <div class="container"> <div class="advert-wrapper"> <div class="advert-menu"> <div class="advert-menu-wrapper"> <a href="#">Manage Advert</a> <a href="postbusiness1.html" class="active">Submit Advert</a> <a href="#">My Account</a> <a href="/support">Help & Support</a> <a href="#">Logout</a> </div> </div> <div class="advert-main"> <div class="advert-main-title">Submit Advert</div> <div class="submit-advert-tab"> <span >1</span> <span>2</span> <span>3</span> <span class="active">4</span> <span>5</span> <span>6</span> </div> <form class="submit-advert-form" action="" method="POST" enctype="multipart/form-data"> <?=$postbusiness_error?> <?php $get=$connect->query("SELECT * FROM `main_cats` ORDER BY `main_cats` ASC LIMIT 100"); while ($row = $get->fetch_assoc()) { $category[] = $row; } ?> <div class="submit-advert-form-group"> <label for="name">Categories & Tags:</label> <p class="submit-advert-label-description <?=$errorcompanyname?>">Please enter a minimum of 3 categories or tags that is related to your business.</p> <select class="form-control" name="type[]"> <option value="" selected="">Please category</option> <?php foreach($category as $row) { foreach($row AS $key => $val){ $$key = stripslashes(strip_tags($val)); } $display = preg_replace('/(' . $value . ')/i', '<b class="ls_hghlight">\1</b>', $main_cats); $sel = $bcategory == $main_cats_id ? 'selected' : ''; $cats.='<option '.$sel.' value="'.$main_cats_id.'">'.$display.'</option>'; } echo $cats; ?> </select> <br> <select class="form-control" name="type[]"> <option value="" selected="">Please category</option> <?php foreach($category as $row) { foreach($row AS $key => $val){ $$key = stripslashes(strip_tags($val)); } $display = preg_replace('/(' . $value . ')/i', '<b class="ls_hghlight">\1</b>', $main_cats); $sel = $bcategory == $main_cats_id ? 'selected' : ''; $cats.='<option '.$sel.' value="'.$main_cats_id.'">'.$display.'</option>'; } echo $cats; ?> </select> <br> <select class="form-control" name="type[]"> <option value="" selected="">Please category</option> <?php foreach($category as $row) { foreach($row AS $key => $val){ $$key = stripslashes(strip_tags($val)); } $display = preg_replace('/(' . $value . ')/i', '<b class="ls_hghlight">\1</b>', $main_cats); $sel = $bcategory == $main_cats_id ? 'selected' : ''; $cats.='<option '.$sel.' value="'.$main_cats_id.'">'.$display.'</option>'; } echo $cats; ?> </select> </div> <button type="submit" name="submit" class="btn btn-yellow">Next</button> </form> </div> </div> </div> </section> <?php include_once $path.'/header-footer/footer.html'; ?> <script> var country = '<?=$countys?>'; var town = '<?=$town?>'; get_town_drop(country,town); function get_town_drop(value,town){ var xmlhttp = false; var xmlhttp = (window.XMLHttpRequest) ? xmlhttp=new XMLHttpRequest() : xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById("town").innerHTML = xmlhttp.responseText; return true; } } xmlhttp.open("GET","ajax/get_town.ajax.php?value="+value+'&town='+town,true); xmlhttp.send(); } </script>