Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2012
    Location
    USA
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Following a Shopping Cart PHP /MYSQL tutorial but got an error. Any ideas?

    Hello All,

    I am following this tutiorial from youtube but have came across an error when putting the code in to DW. I have highlighted this in red. I really can't see why? Can you?

    Code:
    <?php
    
    	session_start();
    	require_once("includes/connect.php");
    	if(isset($_GET['PAGE']))(
    		$pages = array("products","cart");		
                              if(in_array($_GET['page'],$pages)){
    			$page = $_GET['page'];
    		} else {
    			$page = "products";
    		}
    	} else {		$page = "products";
    	}
    ?>
    <html>
    <head>
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/style.css" />
    <title> Shopping Cart</title>
    <body
    <div id="container">
    <div id="main"><?php require($page . ".php"); ?></div>
    <div id="sidebar">WORLD </div>
    
    </div>
    </body>
    </html>

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Whenever you have an error, make sure you post that as well.
    PHP Code:
        if(isset($_GET['PAGE']))( 
    The ( isn't correct here as it has no meaning or ending. That should be {.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •