Jump to content

divinedesigns1

Members
  • Posts

    1,200
  • Joined

  • Last visited

Posts posted by divinedesigns1

  1. 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

  2. If none of the radio buttons is selected, and therefore it is not set, by referencing of 'position' index which is not set and therefore does not exist will throw a error.

     

    Check if set using isset(), before referencing.

    ok thanks

  3. 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?

  4. Why don't you give a fixed name to the cookies? What exactly is your code supposed to do?

     

    A cookie is like a variable, you don't dynamically generate variables, they have specific names from the start.

     

    Try this instead:

    setcookie('pname', $pname, time() + (86400 * 7));

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

  5. It sounds like $pname, $price, $usedprice or $details have characters that are not permitted in cookie names. Make the name of the cookie something recognizable, you probably shouldn't use dynamic values for it.

     

    The "Headers already sent" error was just caused by the first error message

    then ill just leave it as a session, because thats the only issue that is stopping it from working

  6. now im having these errors where the setcookie is,

    Warning
    : Cookie names cannot contain any of the following '=,; \t\r\n\013\014' in
    /home/content/14/8709614/html/ddsnet/functions.php
    on line
    222
    
    
    Warning
    : Cannot modify header information - headers already sent by (output started at /home/content/14/8709614/html/ddsnet/cart.php:39) in
    /home/content/14/8709614/html/ddsnet/functions.php
    

    im looking it up at the moment, but it makes no sense since thats where the setcookies are

     foreach($_SESSION['cart_array'] as $each_item){
                $item = $each_item['id'];
                @$item_price = $each_item['price'];
                // get the item information
                $st_sql = mysqli_query($con, "SELECT * FROM products WHERE id='$item' LIMIT 0, 1") or die('Error: ' . mysqli_error($con));
                while($row = mysqli_fetch_array($st_sql)){
                    $pname = $row['pname'];
                    $price = $row['Proprice'];
                    $usedprice = $row['usedPrice'];
                    $image = $row['id'] . '.' . $row['ext'];
                    $detail = $row['idetail'];
    				$_SESSION['item_name'] = $pname;
                    $_SESSION['item_price'] = $price; 
                    $_SESSION['item_usedprice'] = $usedprice; 
                    $_SESSION['item_detail'] = $detail; 
                    setcookie($pname, $pname, time() + (86400 * 7));
                    setcookie($price, $price, time() + (86400 * 7));
                    setcookie($usedprice, $usedprice, time() + (86400 * 7));
                    setcookie($detail, $detail, time() + (86400 * 7));
                }
    

    im lost on this one, hint tips advice will do

  7. 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

  8. ok I have this code, that I need to have change ones the album is selected in PHP. So pretty much this is the part I need to change

    var tracks = {
    	    "track1":["Fast Lane", "fast_lane"],
    		"track2":["Breathe", "breathe"],
    		"track3":["Stranglehold", "stranglehold"]
    	};
    

    im trying to get those tracks to be automatically be placed in javascript instead of having it being placed there manually, i know i need ajax to do this, can anyone give me a hint on exactly what i need to be doing?

  9. From what i can make out, the problem could be that have not set a default font-family or font size which will result in browsers using there own default font-family and font size, resulting in any element without these specifically set will use the browsers.

    thanks dsone that fixed it, i gotta keep that in mind for the next website

  10. From what i can make out, the problem could be that have not set a default font-family or font size which will result in browsers using there own default font-family and font size, resulting in any element without these specifically set will use the browsers.

    thanks, ill keep this in mind next time i do this

  11. so i finish this website and now I'm double checking it because the client kept saying it wasn't working on his devices, so I check it on all browser and everything was working good, I had to fix the opera font sized.

     

    now on the IE browser *I don't use IE at all* the 768 and below screen sizes for the item details page is all messed up, fonts size is overlapping the price etc.

     

    is there a way to fixed this issue without having to mess with the CSS codes itself?

     

    oh yeah, this is the website www.divinedesigns1.net/ddsnet

     

    tips, hints, etc are always welcome

  12. If the code does not perform as it is expected there is an error in the code. Not all errors produce error messages. Only syntax errors produce messages. Logic errors simply produce unexpected results. The latter is much more difficult to trace and fix.

     

    I don't see anywhere in your code where you check whether a new or used item is selected. You're just passing both prices into the session variable.

    thanks

     

    i see that you have 4 elements in your cart as folow :

    $_SESSION['cart_array'] = array(0 => array("item_id" => $pid, "quantity" => 1, "price" => $price, "uprice" => $uprice));
    

    but later on the code you are only pushing 2 items in the array :

    array_push($_SESSION['cart_array'], array("item_id" => $pid, "quantity" => 1));
    

    hope that was it , Good luck

    alrite ill try that and get back at you, i appreciate the help on this one

  13. We can't answer questions like that without seeing your code. You're 1100 posts in, you should know that by now.

    sorry about that, at the time i didnt had the code with me so i just posted the question instead, the code is there now,

  14. If you make the shopping cart a background image then you can use a combination of line-height, text-align and text-indent to put it into place.

     

    The code would be something like this:

    .cart {
      background: url(/images/shoppingcart.png) no-repeat center;
      background-size: cover;
      width: 54px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      text-indent: 6px;
    }

    You'll have to tweak the values to get it in the right place.

     

    It's not a good idea to have a <div> inside an <a> element.

    this worked perfectly, thanks again

  15. If you make the shopping cart a background image then you can use a combination of line-height, text-align and text-indent to put it into place.

     

    The code would be something like this:

    .cart {
      background: url(/images/shoppingcart.png) no-repeat center;
      background-size: cover;
      width: 54px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      text-indent: 6px;
    }

    You'll have to tweak the values to get it in the right place.

     

    It's not a good idea to have a <div> inside an <a> element.

    alrite, i appreciate it

    Ingolme
  16. This looks like it's out of place due to using absolute positioning. I'm not exactly sure where it's meant to be, but if you want it next to the cart you can make it a span, or you can display it as an inline-block.

    it suppose to be in that green circle of the shopping cart image

  17. I checked the site and it looks functional to me. I can't know which divs are misplaced unless you tell me what it's actually supposed to look like.

     

    I recommend resizing your images because they take forever to load. You're loading images thousands of pixels in length to only display it in an area of a few hundred pixels across.

    alrite, ill create some smaller images, but you see where the shopping cart is located, theres a div which holds the amount of items within the cart

×
×
  • Create New...