Click here to Skip to main content
14,937,556 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<?php
session_start();
require_once("dbcontroller.php");
$db_handle = new DBController();
include("db.php");
?>
<!DOCTYPE php>
<php lang="en">



	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title> CRUMSOR ENTERPRISES PVT LTD
			 
										

	<div>
		<!--Header-->
		
			<div class="header layout5">
			<div class="container">
				<div class="topbar layout1 box-has-content">
					
					<ul class="list-socials">
						<li><a href="#">class="fa fa-facebook" href="#"__^</a></li>						<li><a href="#">^__i class="fa fa-google-plus"></a></li>						<li><a href="#">^__i class="fa fa-instagram"></a></li>						<li><a href="#">^__i class="fa fa-pinterest"></a></li>					</ul>
					<ul class="menu-topbar top-links">
						<li><a href="#">Register / Sign in</a></li>						
						<li><a href="https://www.google.co.in/maps/place/Talab+Tillo,+Jammu+180002/@32.722815,74.8348388,15z/data=!4m8!1m2!2m1!1sB+27+Vasant+Vihar+Talab+Tillo+Jammu!3m4!1s0x391e84ff2378ed91:0x19bec1f7d5d92027!8m2!3d32.7225986!4d74.8388672" target="_blank">Store Location</a></li>						<li><a href="about.php">About</a></li>					</ul>
				</div>
			</div><div class="main-header">
				<div class="top-header">
					<div class="container">
						<div class="row">
							<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12  left-content">
								<div class="logo">
									<a href="index.php"></a>
								</div>
							</div>	
							<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12 middle-content">
							
							
								<div class="search-form layout1 box-has-content">
									<div class="search-block">
									
										<div class="search-choice parent-content">
											
																																												<?php

include("db.php");
$a="select *from category";
$b=mysql_query($a);

 	
while($c=mysql_fetch_array($b))
{
	
	global $c;
	?>
													<?php echo $c["category-name"] ?>
													<?php
}
												?>
													
												
										</div>	<div class="search-inner">
											
										</div>
										  class="fa fa-search"> 
										
										
										
									</div>
								</div>
							</div>							
							<div class="col-lg-4 col-md-4 col-sm-7 col-xs-12 right-content">
								<ul class="header-control">
									<li class="hotline">										<div class="icon">
											^__i class="fa fa-life-ring">
										</div>
										<div class="content">
											<span class="text">Call us now</span>
												<span class="number">(+91) 880 300 6761</span>
										</div>
									</li>									<li class="box-minicart">									<?php 
										
										
  if(!empty($_SESSION['sess_id'])){
	  $result = mysql_query("select sum(quantity) AS value_sum from  tbl_addbasket where session_id='$_SESSION[sess_id]'"); 
$row = mysql_fetch_array($result); 
$quanty = $row['value_sum'];
	}
 ?>
											<div class="minicart ">
												<div class="cart-block  box-has-content">
													<a href="mycart.php" class="cart-icon">class="fa fa-shopping-basket"><span class="count"><?php if(!empty($quanty)){ ?>
													<?=$quanty ?>
													 <? }
														else { ?>
														 0
														  <? } ?></span></a>
													<span class="total-price">Cart </span>
												</div>
											
											</div>
									
									</li>								</ul>
							</div>
						</div>
					</div>
				</div>
			
					<div class="this-sticky">
						<div class="container">
							<div class="header-nav-wapper main-menu-wapper">
								<div class="row">
									<div class="col-lg-3 col-md-4 col-sm-12">
										<div class="vertical-wapper parent-content">
											<div class="block-title show-content">
												<span class="icon-bar">
													<span></span>
													<span></span>
													<span></span>
												</span>
												<span class="text">Categories</span>
											</div>
											<div class="vertical-content hidden-content always-open">
												<ul class="vertical-menu ovic-clone-mobile-menu">	
														<?php

													include("db.php");
													$a="select *from category";
													$b=mysql_query($a);
													while($c=mysql_fetch_array($b))
													{
	
													global $c;
												?>
															<li class="menu-item-has-children has-megamenu">														<a href="product.php?product=<?php echo $c[0] ?>" class="ovic-menu-item-title"><span class="icon"></span><?php echo $c["category-name"] ?></a>
														<a href="product.php?product=<?php echo $c[0] ?>" class="toggle-sub-menu"></a>
														<div class="sub-menu sub-menu1 " style="width: 450px">
															<div class="row">
																<div class="widget-custom-menu">
																	<h5 class="title widgettitle"><?php echo $c[1] ?></h5>
																	<ul>
																		<?php
														$a1="select *from `subcategory` where `category-id`='$c[0]'";
                          								$b1=mysql_query($a1);
														while($c1=mysql_fetch_array($b1))
														{
															
														?>
																		<li><a href="products.php?product=<?php echo $c1[1] ?>"><?php echo $c1["subcategory-name"] ?></a></li>																		
																		<?php
														}

														?>
																	</ul>
																</div>
																
															
																</div>
													
														</div>
													</li>											
													
													<?php
														}

                                                         ?>
												</ul>
												
											</div>
										</div>
									</div>
									<div class="col-lg-9 col-md-8 col-sm-12">
										<div class="header-nav container-vertical-wapper ">
											<div class="header-nav-inner">
												<div class="box-header-nav">
													<div class=" container-wapper">
									                    <a href="#" class="header-top-menu-mobile"><span class="fa fa-cog"></span></a>
															<a class="menu-bar mobile-navigation " href="#">
									                        <span class="icon">
									                            <span></span>
									                            <span></span>
									                            <span></span>
									                        </span>
									                     
									                    </a>
														<ul id="menu-main-menu" class="main-menu clone-main-menu ovic-clone-mobile-menu box-has-content"> 		
														
														
															<li class="menu-item">																<a href="index.php" class="kt-item-title ovic-menu-item-title">HOME</a>
															</li>														<li class="menu-item">																<a href="about.php" class="kt-item-title ovic-menu-item-title">About Us</a>
															</li>															
															
															<?php

													include("db.php");
													$a="select *from category limit 0,4";
													$b=mysql_query($a);
													while($c=mysql_fetch_array($b))
													{
	
													global $c;
												?>
															<li class="menu-item menu-item-has-children">																<a href="product.php?product=<?php echo $c[0] ?>" class="kt-item-title ovic-menu-item-title"><?php echo $c["category-name"] ?></a>
																<ul class="sub-menu">
																				<?php
														$a1="select *from `subcategory` where `category-id`='$c[0]'";
                          								$b1=mysql_query($a1);
														while($c1=mysql_fetch_array($b1))
														{
															
														?>
																<li>																		<a href="products.php?product=<?php echo $c1[1] ?>"><?php echo $c1["subcategory-name"] ?></a>
																		
																	</li>																	
																	<?php
														}

                                                         ?>
																</ul>	
															</li>														
														
														<?php
														}

                                                         ?><li class="menu-item"><a href="contact.php">Contact US</a></li>														</ul>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>


What I have tried:

Parse error: syntax error, unexpected $end in C:\wamp\www\april projects\cursor\header.php on line 279
Posted
Updated 10-May-18 3:47am
v2
Comments
[no name] 9-May-18 1:46am
   
This code has no mention of $end and is less than 279 lines long. Can you post header.php?

There are some problems with the code, like a php doctype in the middle of the HTML part, but that may or not may not be related.
W Balboos, GHB 10-May-18 9:41am
   
No problem with php before the DOCTYPE.

In fact, a session must be started ABSOLUTELY as the first statement following the <?php or it will throw an error (headers already sent).

1 solution

Your code is a wreck.

For example, you have:
while($c=mysql_fetch_array($b))
{
	
	global $c;
	?>
													<?php echo $c["category-name"] ?>
													<?php
}
												?>


which, to start with, contains three sets of php tags when one is what should be there, surrounding all of it.

Is this even your code? If so, and you're a beginner, start by doing beginner coding.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900