Jump to content

divinedesigns1

Members
  • Content count

    1,190
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by divinedesigns1

  1. generating menus problems

    so i been messing around with php to find a way to generate menus using php *im bored, so yeah better do something* anyway i decided to do it this way function menu() { include "config.php"; $mainMenu = mysqli_query($con, "SELECT * FROM `main-menu`") or die('Error: ' . mysqli_error($con)); if($mainMenu){ ?> <ul> <?php while($mainRow = mysqli_fetch_assoc($mainMenu)){ $menuId = $mainRow['id']; $commonName = $mainRow['actualName']; $menuName = $mainRow['name']; $menuTags = '<li><a href="' . $menuName . '">' . $commonName; echo $menuTags; } // check if there's any submenus $subMenu = mysqli_query($con, "SELECT * FROM `sub-menu` WHERE `sub-id`=$menuId") or die('Error: ' . mysqli_error($con)); if($subMenu){ while($subRow = mysqli_fetch_assoc($subMenu)){ $subId = $subRow['sub-id']; $subName = $subRow['sub-name']; $subConame = $subRow['actualNames']; $subMain = $subRow['main-menu-id']; $actualMenu = '<ul>'; $actualMenu .= '<li><a href="' . $subName . '">' . $subConame . '</li>'; $actualMenu .= '</ul></li>'; echo $actualMenu; } } } ?> </ul> <?php } ?> i was wonder if there is another way of doing this, because im only getting one of the sub menu instead of both of them so currently the menu looks like this Home Services Service 1 it suppose to look like this instead Home Services Service 1 Service 2 any idea of what im doing wrong? as always your response is appreciated greatly
  2. generating menus problems

    this sound way better than what i just did, now i just have to adjust my database to make this work, thank a lot dsonesuk
  3. how to detect which page im on

    thanks
  4. how to detect which page im on

    hey so i had this topic up here before but cant find it. does anyone know how i can go about detecting the webpage im on using php?
  5. how to use css bg on wordpress

    hey guys, is there a way to style my background image in css to be used on a wordpress website? i try to do this but the background isnt being shown at all once i upload both folder and file if anyone can help with this, it would be greatly appreciated
  6. how to use css bg on wordpress

    i figure it out by the way, thanks tho
  7. how to use css bg on wordpress

    oooooo k
  8. Fake W3Schools imitation website

    thanks to your advice i just fixed one of my issues, i appreciate it
  9. Weird issues - need help on this one

    ok, so i created a website for a friend and he send me a email stating that theres errors on the website, so i check it out today and there were errors, so i went and pick up my kid came back log into his websites and there's no errors. is it possible for websites to give random errors and fixed itself?
  10. Weird issues - need help on this one

    i didnt get the chance to read the errors, i had to go get my niece but once i got back in and log on the errors was magically fixed. Have that ever happen to you?
  11. Weird issues - need help on this one

    its php error which is weird, because everything was working for a week after i fixed the first set of errors on may 5th
  12. adding a used item into a cart

    hey, ok im trying to add the used price of an item within the cart that holds the original price. so i created a duplicated of the original price script so i can add the used price if (isset($_POST['pid'])) { $pid = $_POST['pid']; $wasFound = false; $i = 0; // If the cart session variable is not set or cart array is empty if (!isset($_SESSION["cart_array"]) || count($_SESSION["cart_array"]) < 1) { // RUN IF THE CART IS EMPTY OR NOT SET $_SESSION["cart_array"] = array(0 => array("item_id" => $pid, "quantity" => 1)); setcookie('id', $pid, time() + (86400 * 7)); setcookie('quantity', '1', time() + (86400 * 7)); } else { // RUN IF THE CART HAS AT LEAST ONE ITEM IN IT foreach ($_SESSION["cart_array"] as $each_item) { $i++; while (list($key, $value) = each($each_item)) { if ($key == "item_id" && $value == $pid) { // That item is in cart already so let's adjust its quantity using array_splice() array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $pid, "quantity" => $each_item['quantity'] + 1))); setcookie('id', $pid, time() + (86400 * 7)); setcookie('quantity', $each_item['quantity'], time() + (86400 * 7)); $wasFound = true; } // close if condition } // close while loop } // close foreach loop if ($wasFound == false) { array_push($_SESSION["cart_array"], array("item_id" => $pid, "quantity" => 1)); setcookie('id', $pid, time() + (86400 * 7)); setcookie('quantity', $each_item['quantity'], time() + (86400 * 7)); } } header("location: confirm.php"); exit(); } and this is the script for the used price if(isset($_POST['uid'])){ $use = $_POST['uid']; $use_product = $_POST['used']; $i = 0; $wasFound = false; if(!isset($_SESSION['cart_array']) || count($_SESSION['cart_array']) < 1){ $_SESSION['cart_array'] = array(0 => array("item_id" => $use, "quantity" => 1, "price" => $use_product)); header("location: confirm.php"); }else{ foreach($_SESSION['cart_array'] as $each_item){ $i++; while(list($key, $value) = each($each_item)){ if($key == "item_id" && $value == $use){ // that item is in the cart already adject quantity array_splice($_SESSION["cart_array"], $i-1, 1, array(array("item_id" => $use, "quantity" => $each_item["quantity"] + 1, "price" => $use_product))); $wasFound = true; header("location: confirm.php"); } } } // if no item is in the cart if($wasFound == false){ array_push($_SESSION['cart_array'], array("item_id" => $use, "quantity" => 1)); header("location: confirm.php"); } } } I probably dont need both of these script right? and how can i excuted these prices so both can be added to the cart and not just add the same price so pretty much original price is 20 and the used price is 10 but i keep on getting the total of 40 instead of 30 help please, no scripts please
  13. an 500 internal server error

    ok, so i have to launch this website but cant do so, due to this 500 internal server error, i contacted the person that is hosting the website and he seem to not have any idea on how to fixed this problem. I am using html5 document to created this website, it is consist of php, css, css3, js, etc. can anyone give some advice on how to fixed this problem? website is displayed below www.mailmyjamz.com
  14. an 500 internal server error

    thank you
  15. an 500 internal server error

    ok so i checked the error log and this is what it keep on saying .htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration how would i go about fixing this?
  16. beginner errors issue for me

    ok so i started off with a radio button well two radio buttons to be exact, and i keep on having this issue but i check to make sure i didnt misspelled anything and so on but i still getting this same problem, also when i click on the one of the radio buttons it works heres the error Notice: Undefined index: position in D:\wamp\www\Website\admin\testing.php on line 65 and this is the code for the above issue if(isset($_POST['submit'])){ // define the variables $Title = $_POST['title']; $Detail = $_POST['description']; $Position = $_POST['position']; echo $Position; // define the error too $errors = array(); // now sanitized please $Title = strip_tags(trim($Title)); $Detail = strip_tags(trim($Detail)); $Title = preg_match("/^[a-zA-Z0-9]*$/", $Title); $Detail = preg_match("/^[a-zA-Z0-9]*$/", $Detail); // now lets see if its empty if(empty($Title) && empty($Detail) && empty($Position)){ $errors[] = 'All Fields Are Required'; } foreach($errors as $error){ echo $error; } } echo '<form action="testing.php" method="POST" enctype="multipart/form-data"> <input type="text" name="title" value=""> <textarea name="description" col="8" row="24"></textarea> <input type="radio" name="position" value="a">Main Position <input type="radio" name="position" value="b">Second Position <input type="submit" name="submit" value="Save"> </form>'; any tip or advice on this one?
  17. beginner errors issue for me

    ok thanks
  18. PHP 7 Is Available

    whats spaceship operator? that part throw me off completely
  19. give me ya feedback on this site

    give me your honest feedback on this website www.divinedesigns1.net/ddsnet if the above url doesnt work, let me know so i can get it back online, it should be working tho, as of 2/16/2016 8:33pm i would like only your honest opinion
  20. give me ya feedback on this site

    ok the link has been updated
  21. give me ya feedback on this site

    looking at the wrong site homie
  22. Responsive Failure

    this keep on coming up as a virus everytime i click on it
  23. want to make it last longer with cookies

    how can i make this code work with cookie? I would like it to last longer with the cookies, the session only last for a short period of time if (!isset($_SESSION["cart_array"]) || count($_SESSION["cart_array"]) < 1) { // RUN IF THE CART IS EMPTY OR NOT SET $_SESSION["cart_array"] = array(0 => array("item_id" => $pid, "quantity" => 1)); setcookie("id", $_SESSION["cart_array"], strtotime( '+1 day' ), "/", "", "", TRUE); setcookie("quantity", "1", strtotime( '+1 day minute' ), "/", "", "", TRUE); } any tips, hints or advice are acceptable as always. HELP PLEASE
  24. want to make it last longer with cookies

    you know i did that first lol then i change it to variables, ill try that and see what happens
×