Jump to content

Adamhumbug

Members
  • Posts

    597
  • Joined

  • Last visited

Everything posted by Adamhumbug

  1. No i am pretty sure it runs after - i think i have pretty much duplicated what i have done to make the first modal. Here is everything for context. <?php if (session_status() == PHP_SESSION_NONE) { session_start(); } if (!isset($_SESSION['user_id'])){ header("location: index.php"); exit; } //name of the pagea $_SESSION['this_page'] = 'new-menu'; include '_includes/dbconn.php'; function getMenuItems($conn){ $output = ''; $stmt = $conn -> query(" SELECT menu_category_name FROM ssm_menu_items INNER JOIN ssm_menu_category on menu_item_category_id = menu_category_id ORDER BY menu_category_display_order "); //create an empty array of all of the menu categories that are in use foreach ($stmt as $item){ $menuItemsInCat[$item['menu_category_name']] = []; } $stmt = $conn -> prepare(" SELECT menu_item_id, menu_item_name, menu_category_name, sum(menu_item_qty) FROM ssm_menu_items mi INNER JOIN ssm_menu_category mcat ON mi.menu_item_category_id = mcat.menu_category_id left join ssm_menu_order USING (menu_item_id) GROUP BY menu_item_id "); $stmt -> execute(); $stmt -> bind_result($miid, $miname, $mcatname, $miqty); while ($row = $stmt -> fetch()) { //put items into the blank array created above under their correct category $menuItemsInCat[$mcatname][$miid] = [$miname, $miqty]; } //foreach thing in $menuItemInCat array there is $menucat array associated with $menuit(ems) array //we want the menu cat foreach ($menuItemsInCat as $menucat => $menuit) { $output .= "<tbody>"; $output .= "<tr class='bg-secondary text-white text-center'><th>$menucat</th>"; $output .= "<th>Qty On Order</th><th>Manage</th></tr>"; //foreach thing in menu items array there is an array of ids and an array of items foreach ($menuit as $itemId => $itemName) { $output .= "<tr><td>$itemName[0]</td>"; $output .= "<td>$itemName[1]</td>"; $output .= "<td><div class='modaltrigger btn btn-primary' data-id='$itemId' data-toggle='modal'>Manage</div></td></tr>"; } $output .= "</tbody>"; } return $output; } //handle ajax if(isset($_POST['ajax'])){ switch ($_POST['ajax']) { case 'one': exit(popManageMenuModal($conn, $_POST['id'])); break; case 'two': exit(popConfDelModal($conn, $_POST['id'])); break; } } function popConfDelModal($conn, $miid){ $out = ""; $out .= "<div>This is some info</div>"; return $out; } function popManageMenuModal($conn, $miid){ $stmt = $conn -> prepare(' SELECT menu_item_name, menu_item_is_vegan, menu_item_is_vegetarian, menu_item_is_gf, menu_item_is_nf, menu_item_is_df, menu_item_category_id FROM ssm_menu_items INNER JOIN ssm_menu_category on menu_item_category_id = menu_category_id WHERE menu_item_id = ? '); $stmt -> bind_param('i', $miid); $stmt -> execute(); $stmt -> bind_result($miname, $miisvegan, $miisveg, $miisgf, $miisnf, $miisdf, $mcatid); $stmt -> fetch(); $output = ""; $output .= "<form><div class='modal-body'><div class='form-group'><label >Menu Item Name</label><textarea name='menuItemName' class='form-control'>$miname</textarea></div>"; $output .= "<div class='form-inline'><input name='miid' type='hidden' value='$miid'>"; $a = array('Vegan'=>$miisvegan, 'Vegetarian' => $miisveg, 'Gluten Free' => $miisgf, 'Nut Free' => $miisnf, 'Dairy Free' => $miisdf); foreach ($a as $type => $value) { if($value == '0'){ $polarity = 'btn-danger'; } if($value == '1'){ $polarity = 'btn-success'; } $output .= "<div class='m-1 col drButton btn {$polarity}' data-value='$value'>$type</div><input id='$type' type='hidden' value='$value' name='$type'>"; } $output .= "</div>"; $stmt -> close(); $cat = $conn -> prepare('SELECT menu_category_id, menu_category_name FROM ssm_menu_category'); $cat -> execute(); $cat -> bind_result($menucatid, $mcatname); $output .= "<select name='menucategory' class='form-control mt-3'>"; $selected =''; while($cat -> fetch()){ if($mcatid==$menucatid){ $selected = 'selected'; }else{ $selected = ''; } $output.= "<option {$selected} value='$menucatid'>$mcatname</option>"; } $output .= "</select>"; $output .= "<div class='modal-footer'><a data-toggle='modal' href='#delConfModal' data-id='$miid' class='delButton btn btn-danger'>Delete Menu Item</a> <button formmethod='post' type='submit' class='btn btn-primary'>Save Changes</button> </div>"; $output .= "</form>"; return $output; } // handle post request if ($_SERVER['REQUEST_METHOD']=='POST') { $miid = $_POST['miid']; $miname = $_POST['menuItemName']; $vegan = $_POST['Vegan']; $vegi = $_POST['Vegetarian']; $gluten = $_POST['Gluten_Free']; $nut = $_POST['Nut_Free']; $dairy = $_POST['Dairy_Free']; $cat = $_POST['menucategory']; $stmt = $conn -> prepare(" UPDATE ssm_menu_items SET menu_item_name = ?, menu_item_is_vegan = ?, menu_item_is_vegetarian = ?, menu_item_is_gf = ?, menu_item_is_nf = ?, menu_item_is_df = ?, menu_item_category_id = ? WHERE menu_item_id = ? "); $stmt -> bind_param('siiiiiii', $miname, $vegan, $vegi, $gluten, $nut, $dairy, $cat, $miid); $stmt -> execute(); } function messageBar(){ global $miname; if($miname !=''){ $out = "<div id='messageBar' class='alert alert-success text-center'>{$miname} has been updated</div>"; return $out; } } ?> <?php include '_includes/head.php'; ?> <div class="container-fluid"> <div class="row"> <?php include '_includes/header.php'; ?> </div> <div class="row" > <div class="col-sm-2 p-0 bg-dark text-light"> <?php include '_includes/nav.php'; ?> </div> <div class="col-sm-10" style="height: calc(100vh - 80px);overflow:scroll;"> <div class="mt-3"> <?= messageBar() ?> <table class="table table-striped table-hover table-bordered text-center align-middle"> <?= getMenuItems($conn) ?> </table> </div> <div class="col-sm-12"><?php include '_includes/footer.php'; ?></div> </div> </div> </div> <!-- modal --> <div class="modal fade" id="manageMenuItemModal"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Manage Menu Item</h4> <button type="button" class="close" data-dismiss='modal'>&times;</button> </div> <div id="menuItemInfo" class="container"> <!-- modal information will go here --> </div> </div> </div> </div> <!-- modal --> <div class="modal fade" id="delConfModal"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Delete Menu Item</h4> <button type="button" class="close" data-dismiss='modal'>&times;</button> </div> <div id="delConfInfo" class="container"> <!-- modal information will go here --> </div> </div> </div> </div> <script> //set sidebar active indicator //XX = name of parent if in dropdown eg "sheet" if(document.getElementById('menu')){ document.getElementById('menu').classList.add('show') } //nav button ID if(document.getElementById('newMenu')){ document.getElementById('newMenu').classList.add('blOrange') } $('.modalTrigger').click(function () { var menuItemId = $(this).data("id") $.ajax({ type: 'post', data: {ajax : 'one', id: menuItemId}, success: function(response){ $('#menuItemInfo').html(response) } }) $('#manageMenuItemModal').modal({ show: true }) }) $('.delButton').click(function () { var menuItemId = $(this).data("id") console.log('one') $.ajax({ type: 'post', data: {ajax : 'two', id: menuItemId}, success: function(response){ console.log('i ran') $('#delConfInfo').html(response) } }) $('#delConfModal').modal({ show: true }) }) //dietary requirement buttons polarity $(document).on('click','.drButton', function(){ var polarity = $(this).attr("data-value") var id = $(this).text() var hi = document.getElementById(id) if(polarity == '0'){ $(this).addClass("btn-success") $(this).removeClass("btn-danger") $(this).attr("data-value", "1") if(hi){ hi.value = '1' } return false } if (polarity == '1'){ $(this).addClass("btn-danger") $(this).removeClass("btn-success") $(this).attr("data-value", "0") if(hi){ hi.value = '0' } return false } }); $('#messageBar').delay(2000).fadeOut(1000); $(document).ready(function () { $(document).on('show.bs.modal', '.modal', function (event) { var zIndex = 1040 + (10 * $('.modal:visible').length); $(this).css('z-index', zIndex); setTimeout(function() { $('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack'); }, 0); }); }); </script>
  2. <a data-toggle='modal' href='#delConfModal' data-id='$miid' class='delButton btn btn-danger'>Delete Menu Item</a> This is the button that calls the second ajax, it is an A tag so i can stack the modals
  3. ok, so i have created $out by putting $out =""; on the line above. The del button is coming from the modal that was created by the first function. I have put a console log into both ajax calls and can confirm that the second is not running.
  4. I am trying to work with this but the second modal is not getting the data from the second ajax call. if(isset($_POST['ajax'])){ switch ($_POST['ajax']) { case 'one': exit(popManageMenuModal($conn, $_POST['id'])); break; case 'two': exit(popConfDelModal($conn, $_POST['id'])); break; } } function popConfDelModal($conn, $miid){ $out.= "<div>This is some info</div>"; return $out; } function popManageMenuModal($conn, $miid){ The second function that i have cut off at the bottom is actually the one that runs first and works just fine. It is the popConfDelModal that doesnt output anything. This is the ajax $('.modalTrigger').click(function () { var menuItemId = $(this).data("id") $.ajax({ type: 'post', data: {ajax : 'one', id: menuItemId}, success: function(response){ $('#menuItemInfo').html(response) } }) $('#manageMenuItemModal').modal({ show: true }) }) $('.delButton').click(function () { var menuItemId = $(this).data("id") $.ajax({ type: 'post', data: {ajax : 'two', id: menuItemId}, success: function(response){ $('#delConfInfo').html(response) } }) $('#delConfModal').modal({ show: true }) }); and here is the html for the modals that you probably dont need to see. <div class="modal fade" id="manageMenuItemModal"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Manage Menu Item</h4> <button type="button" class="close" data-dismiss='modal'>&times;</button> </div> <div id="menuItemInfo" class="container"> <!-- modal information will go here --> </div> </div> </div> </div> <!-- modal --> <div class="modal fade" id="delConfModal"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Delete Menu Item</h4> <button type="button" class="close" data-dismiss='modal'>&times;</button> </div> <div id="delConfInfo" class="container"> <!-- modal information will go here --> </div> </div> </div> </div> Your help is always appreciated.
  5. This is what i thought would be the best option, just wanted to check.
  6. Hi All, Not sure if this is a silly question so here we go. I have some divs that have data attributes (data-value). When i submit and post the form, can i use these values as part of the submission and put their data-value into the db? Thanks as always in advance.
  7. This sorted me out $a = array('Vegan'=>$miisvegan, 'Vegitarian' => $miisveg, 'Gluten Free' => $miisgf, 'Nut Free' => $miisnf, 'Dairy Free' => $miisdf); foreach ($a as $type => $value) { if($value == '0'){ $polarity = 'btn-danger'; } if($value == '1'){ $polarity = 'btn-success'; } $output .= "<div class='m-1 col drButton btn {$polarity}' data-value='$value'>$type</div>"; }
  8. Hi All, I have a page where people can enter the name of food, like you would order in a restaurant (would appear on the menu). They can set if the food is gluten free, nut free, vegan etc. I am wanting to use buttons that can be clicked going red if they are not gluten free or not vegetarian and green if they are vegan or vegetarian. I have working code that does this but i dont feel like i am being efficient with how i am writing it as it is turning into a lot of repeated code. I would appreciate some help pointing me in the right direction. function popManageMenuModal($conn, $miid){ $stmt = $conn -> prepare(' SELECT menu_item_name, menu_item_is_vegan, menu_item_is_vegitarian, menu_item_is_gf, menu_item_is_nf, menu_item_is_df FROM ssm_menu_items WHERE menu_item_id = ? '); $stmt -> bind_param('i', $miid); $stmt -> execute(); $stmt -> bind_result($miname, $miisvegan, $miisveg, $miisgf, $miisnf, $miisdf); $stmt -> fetch(); if($miisvegan == '1'){ $vegansel = 'btn-success'; $vegan = 'Vegan'; $veganop = 'Is'; }else{ $vegansel = 'btn-danger'; $vegan = 'Vegan'; $veganop = 'Not'; } if($miisveg == '1'){ $vegsel = 'btn-success'; $vegi = 'Vegi'; $vegop = 'Is'; }else{ $vegsel = 'btn-danger'; $vegi = 'Vegi'; $vegop = 'Not'; } $output = ""; $output .= "<form><div class='form-group'><label>Menu Item Name</label><textarea class='form-control'>$miname</textarea></div>"; $output .= "<div class='form-inline'>"; $output .= "<div class='drButton btn $vegansel' data-value='$miisvegan'>{$veganop} {$vegan}</div>"; $output .= "<div class='drButton btn $vegsel' data-value='$miisveg'>{$vegop} {$vegi}</div>"; $output .= "<div>$miisvegan, $miisveg, $miisgf, $miisnf, $miisdf</div>"; $output .= "</form>"; return $output; } $(document).on('click','.drButton', function(){ var polarity = $(this).data("value") if(polarity == '0'){ $(this).addClass("btn-success") $(this).removeClass("btn-danger") $(this).data("value", '1') return } if (polarity == '1'){ $(this).addClass("btn-danger") $(this).removeClass("btn-success") $(this).data("value", '0') return } });
  9. Second question, what is the "TEXT" for?
  10. Ahh ok. So when you click the button that is going to run ajax, you use the "ajax" : "something" to tell it which php function to then run?
  11. Hi All, As i am going through my project i am creating more and more files. Is it possible to have one file that contains all of my ajax functions for example. If so, when giving the ajax the file path, how do i also tell it where in the file to look. I know thats not how it works but i thought it was the best way to explain what i mean. @Barand - This is kind of a follow up to your last response but i thought it warranted a new post.
  12. A perfectly simple answer - thanks so much
  13. Hi All, I have a function that i want to pass a variable into so that i can do some SQL on it. The information that i want to pass into it is a data-id on a button that is used to trigger the function. The button that will be clicked is this <div class='modaltrigger btn btn-primary' data-id='$itemId' data-toggle='modal'>Manage</div> This button is being created by another function. I would like to know either how i pass the variable from one function to another or how i pass it from the data-id to the function in php. Thanks in advance.
  14. Turns out it wasnt as complicated as i thought function getMenuItems($conn){ $output = ''; $stmt = $conn -> query(" SELECT menu_category_name FROM ssm_menu_items INNER JOIN ssm_menu_category on menu_item_category_id = menu_category_id ORDER BY menu_category_display_order "); //create an empty array of all of the menu categories that are in use foreach ($stmt as $item){ $menuItemsInCat[$item['menu_category_name']] = []; } $stmt = $conn -> prepare(" SELECT menu_item_id, menu_item_name, menu_category_name, sum(menu_item_qty) FROM ssm_menu_items mi INNER JOIN ssm_menu_category mcat ON mi.menu_item_category_id = mcat.menu_category_id left join ssm_menu_order USING (menu_item_id) GROUP BY menu_item_id "); $stmt -> execute(); $stmt -> bind_result($miid, $miname, $mcatname, $miqty); while ($row = $stmt -> fetch()) { //put items into the blank array created above under their correct category $menuItemsInCat[$mcatname][$miid] = [$miname, $miqty]; } //foreach thing in $menuItemInCat array there is $menucat array associated with $menuit(ems) array //we want the menu cat foreach ($menuItemsInCat as $menucat => $menuit) { $output .= "<tbody>"; $output .= "<tr class='bg-secondary text-white text-center'><th>$menucat</th>"; $output .= "<th>Qty On Order</th><th>Manage</th></tr>"; //foreach thing in menu items array there is an array of ids and an array of items foreach ($menuit as $itemId => $itemName) { $output .= "<tr><td>$itemName[0]</td>"; $output .= "<td>$itemName[1]</td>"; $output .= "<td><div class='btn btn-primary'>Manage</div></td></tr>"; } $output .= "</tbody>"; } return $output; } Look at me solving my own problems
  15. Hi All, I have a function that creates an array using a few sql quereys. I then use the array to output to html. I am wanting to add more data to the array to populate another column in the created table. I am unsure how to add $miqty to the array and then output it in the Qty On Order column. I feel like i need to add the [] to $menuItemsInCat[$mcatname][$miid] = $miname; section but i am not sure where in there it should be. <?php if (session_status() == PHP_SESSION_NONE) { session_start(); } if (!isset($_SESSION['user_id'])){ header("location: index.php"); exit; } //name of the pagea $_SESSION['this_page'] = 'new-menu'; function getMenuItems($conn){ $output = ''; $stmt = $conn -> query(" SELECT menu_category_name FROM ssm_menu_items INNER JOIN ssm_menu_category on menu_item_category_id = menu_category_id ORDER BY menu_category_display_order "); //create an empty array of all of the menu categories that are in use foreach ($stmt as $item){ $menuItemsInCat[$item['menu_category_name']] = []; } $stmt = $conn -> prepare(" SELECT menu_item_id, menu_item_name, menu_category_name, sum(menu_item_qty) FROM ssm_menu_items mi INNER JOIN ssm_menu_category mcat ON mi.menu_item_category_id = mcat.menu_category_id left join ssm_menu_order USING (menu_item_id) GROUP BY menu_item_id "); $stmt -> execute(); $stmt -> bind_result($miid, $miname, $mcatname, $miqty); while ($row = $stmt -> fetch()) { //put items into the blank array created above under their correct category $menuItemsInCat[$mcatname][$miid] = $miname; } echo "<pre>"; print_r($menuItemsInCat); echo "</pre>"; //foreach thing in $menuItemInCat array there is $menucat array associated with $menuit(ems) array //we want the menu cat foreach ($menuItemsInCat as $menucat => $menuit) { $output .= "<tbody>"; $output .= "<tr class='bg-secondary text-white text-center'><th>$menucat</th>"; $output .= "<th>Qty On Order</th><th>Manage</th></tr>"; //foreach thing in menu items array there is an array of ids and an array of items foreach ($menuit as $itemId => $itemName) { $output .= "<tr><td>$itemName</td>"; $output .= "<td></td>"; $output .= "<td><div class='btn btn-primary'>Manage</div></td></tr>"; } $output .= "</tbody>"; } return $output; } ?> <?php include '_includes/head.php'; ?> <div class="container-fluid"> <div class="row"> <?php include '_includes/header.php'; ?> </div> <div class="row" > <div class="col-sm-2 p-0 bg-dark text-light"> <?php include '_includes/nav.php'; ?> </div> <div class="col-sm-10" style="height: calc(100vh - 80px);overflow:scroll;"> <div class="mt-3"> <table class="table table-striped table-hover table-bordered text-center align-middle"> <?= getMenuItems($conn) ?> </table> </div> <div class="col-sm-12"><?php include '_includes/footer.php'; ?></div> </div> </div> </div> <script> //set sidebar active indicator //XX = name of parent if in dropdown eg "sheet" if(document.getElementById('menu')){ document.getElementById('menu').classList.add('show') } //nav button ID if(document.getElementById('newMenu')){ document.getElementById('newMenu').classList.add('blOrange') } </script> As always your help is very appreciated.
  16. Makes very good sense, i will look into this.
  17. You are of course correct. Currently it does not allow for this but the next step will be to allow the connection of existing items to a new menu.
  18. Now that'll do it Thanks again
  19. haha just for fun: Warning: main(): Couldn't fetch mysqli_stmt in /homepages/29/d742272110/htdocs/actions/submit-new-menu-action.php on line 82 Fatal error: Uncaught mysqli_sql_exception: Column 'menu_item_id' cannot be null in /homepages/29/d742272110/htdocs/actions/submit-new-menu-action.php:83 Stack trace: #0 /homepages/29/d742272110/htdocs/actions/submit-new-menu-action.php(83): mysqli_stmt->execute() #1 {main} thrown in /homepages/29/d742272110/htdocs/actions/submit-new-menu-action.php on line 83 //L69 $ins_i = $conn->prepare(' INSERT INTO ssm_menu_items (menu_item_name) VALUES (?); '); $ins_c = $conn->prepare(' INSERT INTO ssm_menu_connection (menu_id, menu_item_id) VALUES (?,?) '); $ins_i->bind_param('s',$nmItem); $ins_c->bind_param('ii', $menuInsId, $menuItmInsId); foreach ($_POST['newMenuItem'] as $nmItem) { $ins_i->execute(); //L82 $menuItmInsId = $stmt->insert_id; //L83 $ins_c->execute(); } }
  20. I like this a lot. I didnt know this was possible -> every day is a school day. Thanks again.
  21. I think this just about does it. if ($_SERVER['REQUEST_METHOD']=="POST") { ///////////////////// //menu name insert // ///////////////////// $mname = $_POST['newMenuName']; $stmt=$conn->prepare(' INSERT IGNORE INTO ssm_menu (menu_name) VALUES (?); '); $stmt->bind_param('s',$mname); $stmt->execute(); $menuInsId = $stmt->insert_id; echo $menuInsId; $stmt->close(); ///////////////////// //menu item insert // ///////////////////// $menuItemInsertIds = array(); $mitname = $_POST['newMenuItem']; $stmt=$conn->prepare(' INSERT IGNORE INTO ssm_menu_items (menu_item_name) VALUES (?); '); foreach ($_POST['newMenuItem'] as $k => $nmItem) { $mitname = $nmItem; $stmt->bind_param('s',$mitname); $stmt->execute(); $menuItmInsId = $stmt->insert_id; array_push($menuItemInsertIds, $menuItmInsId); } $stmt->close(); /////////////////////////// //menu connection insert // /////////////////////////// $stmt=$conn->prepare(' INSERT IGNORE INTO ssm_menu_connection (menu_id, menu_item_id) VALUES (?,?) '); foreach ($menuItemInsertIds as $k => $miiids) { $stmt->bind_param('ii',$menuInsId, $miiids); $stmt->execute(); $connectionInserId = $stmt->insert_id; echo $connectionInserId; } $stmt->close(); }
  22. I am glad that is the case with the real_escape_string - thanks for pointing that out to me. I have created the array but i now need to loop through it in the final query
  23. Hi, I am creating a new menu (food) in my system. This consists of a menu, menu_items and menu_connection table. I can insert the menu name just fine and return its id just fine. When inserting the menu items, i need to get each of the menu_item_ids to use in the query that inputs the menu_connection. This is what i have so far: if ($_SERVER['REQUEST_METHOD']=="POST") { ///////////////////// //menu name insert // ///////////////////// $mname = mysqli_real_escape_string($conn, $_POST['newMenuName']); $stmt=$conn->prepare(' INSERT IGNORE INTO ssm_menu (menu_name) VALUES (?); '); $stmt->bind_param('s',$mname); $stmt->execute(); $menuInsId = $stmt->insert_id; echo $menuInsId; $stmt->close(); ///////////////////// //menu item insert // ///////////////////// $mitname = $_POST['newMenuItem']; $stmt=$conn->prepare(' INSERT IGNORE INTO ssm_menu_items (menu_item_name) VALUES (?); '); foreach ($_POST['newMenuItem'] as $k => $nmItem) { $mitname = mysqli_real_escape_string($conn, $nmItem); $stmt->bind_param('s',$mitname); $stmt->execute(); $menuItmInsId = $stmt->insert_id; echo $menuItmInsId; } $stmt->close(); /////////////////////////// //menu connection insert // /////////////////////////// $stmt=$conn->prepare(' INSERT IGNORE INTO ssm_menu_connection (menu_id, menu_item_id) VALUES (?,?) '); foreach ($_POST['newMenuItem'] as $k => $nmItem) { $stmt->bind_param('ii',$menuInsId, $menuItmInsId); $stmt->execute(); $connectionInserId = $stmt->insert_id; echo $connectionInserId; } $stmt->close(); } Currently it is inserting each of the items in the connection table with the same id - i understand why but i dont know how to collect up all of the ids to use later
  24. Ok so i have got to the bottom of this. I had a mistake in the name of the file that was being called so it was infact not calling the page i thought it was. Turns out that 1&1 show ads on your domain if you hit a page that doesnt exist - i dont really like that at all but hey ho. Thanks all
  25. Hi All, I just created a new action in php on my site. The action doesnt work yet which is fine but when i try and run it i get the following in inspector/console. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style type="text/css"> html, body, #partner, iframe { height:100%; width:100%; margin:0; padding:0; border:0; outline:0; font-size:100%; vertical-align:baseline; background:transparent; } body { overflow:hidden; } </style> <meta content="NOW" name="expires"> <meta content="index, follow, all" name="GOOGLEBOT"> <meta content="index, follow, all" name="robots"> <!-- Following Meta-Tag fixes scaling-issues on mobile devices --> <meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport"> </head> <body> <div id="partner"></div> <script type="text/javascript"> document.write( '<script type="text/javascript" language="JavaScript"' + 'src="//sedoparking.com/frmpark/' + window.location.host + '/' + 'IONOSParkingUK' + '/park.js">' + '<\/script>' ); </script> </body> </html> Blocked loading mixed active content “http://pagead2.googlesyndication.com/apps/domainpark/show_afd_ads.js” park.js:14:13 Loading failed for the <script> with source “http://pagead2.googlesyndication.com/apps/domainpark/show_afd_ads.js”. add-new-menu-action.php:38:1 All i have on the add-new-menu-action.php file is <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); if (session_status() == PHP_SESSION_NONE) { session_start(); } if (!isset($_SESSION['user_id'])){ header("location: index.php"); exit; } // mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // include '../_includes/dbconn.php'; echo "POST is: <pre>" . print_r($_POST,true) . "</pre>"; Is this something i should be worried about. (i am already worried about it) I do not have ads on my site nor is that my intention for the future.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.