Read out a array from a URL

Helllo!

I search for a way to read out a array from a URL and put it into a destination link on the same site.

exp. mysitedotcom/100

Now i will cut the number, in my case the number 100 and put it into a destination link of a banner on my site.

exp. destiantionlinkdotcom/100

I think the first step is to read out the URL but how is next?

<?php $indicesServer = array('REQUEST_URI') ; echo '<table cellpadding="10">' ; foreach ($indicesServer as $arg) { if (isset($_SERVER[$arg])) { echo ''. $_SERVER[$arg] . '' ; } else { ; }
?>

Can you help me?
Iam a newbie in PHP

This is my site for testing:

LINK

To me, some pseudo-code would be:

  1. Get the $_SERVER[‘REQUEST_URI’] - will return “/100” in your example, but might return “/subdir/100?srch=fred” if your site allows it

  2. Search through it for a query start mark “?” and remove it and anything after it. This will remove the query-string in point 1.

  3. Search backwards from the end until you hit a “/”, and remove it and anything before it. This will remove the “/subdir/” in point 1.

Obviously points two and three depend on whether there’s any chance, in your site, that these extra parts will be present. But I’d be doing it as a function, with an eye to whether I can use it for anything in the future, so the more it supports the better.

Have a search around, there’s plenty of articles on how to work with the URL in PHP.

Here are some functions which may be of use:

<?php 
    // formats $val and makes arrays easier to read
    function dd($val=null, $title='')
    {
        echo '<pre>'; 
            echo '<b>' .$title .'</b><br />';
            print_r($val);
        echo '</pre>';    
    }

    $url = 'http://php.net/manual/en/ref.url.php';
    echo '<a href="' .$url .'"> PHP URL Functions</a>';

    dd($_SERVER, '$_SERVER parametes:');
    echo '',
    $url = 'http://'.  $_SERVER['HTTP_HOST'] .'/' .$_SERVER['REQUEST_URI'];
    $aUrl = parse_url($url);
    dd($aUrl, 'URL component breakdown:');

    $aParams = explode( '/', $aUrl['path']   ) ;
    dd($aParams, 'URL Parameters: ');

One point of detail in your code, you don’t need an else clause if there is nothing to do.

Thank for your great help!

After reading tons of postings, i have reached a positive result…

<?php 
$urlPart = explode("/", $_SERVER['REQUEST_URI']);
if(in_array("ref", $urlPart));
$ref = $urlPart[2];
?>

Now i can extract the number from my URL and insert it in my destination link.

<?php 
echo '<a href="http://destinationlink.com/ref/' . $urlPart[2] . ' " target="_blank">';
?>

Is this right?

Now I have a problem with the HTML5 Template and the PHP href function…
The PHP Link destroys my HTML5 Template and the Link (mouse over) will be shown over the slide images.
Do you have an Idea why?

HERE ist the link to the testsite

I honestly think there is a way easier way of doing it.

<?php
$url = $_SERVER['REQUEST_URI'];
$array = array('/ref/' => '');
$url = strtr($url, $array);

print($url);

With this snippet, you take what you know from the URL and you just basically strip that from the string and print out the remaining characters. If the URL doesn’t change file paths, you’ll be ok with this.

From what I can see, you placed your snippet in a wrong place. It looks like you’ve placed it directly right after

 <!DOCTYPE html>

That’s why it is screwing up your HTML markup. You need to place the PHP snippet in the appropriate spot otherwise, you’ll get that result. Also, looking at your HTML source code. It looks like your 2nd link you are attempting to create isn’t closed correctly. I am seeing red lines on both those 2 lines.

From what I can see, you placed your snippet in a wrong place. It looks like you’ve placed it directly right after

No, i have only copied the code to this place for testing.
They don’t make more troubles, but i have erased him, now.

How you can see, that the 2nd link is not closed correctly?

<section class="slider" id="home">
				<div class="container-fluid">
					<div class="row">

					    <div id="carouselHacked" class="carousel slide carousel-fade" data-ride="carousel">
							<div class="header-backup"></div>
					        <!-- Wrapper for slides -->
					        <div class="carousel-inner" role="listbox">
					            <div class="item active">
					            	<img src="img/slide-one.jpg" alt="">
					                <div class="carousel-caption">
				               			<h1>Tax</h1>
				               			<p>good business consulting service</p>
										 <button>learn more</button>
										 <?php 
										 echo '<a href="http://destinationlink.com/ref/' . $urlPart[2] . ' " target="_blank">';
										 ?>
									</div>
					            </div>
					            <div class="item">
					            	<img src="img/slide-two.jpg" alt="">
					                <div class="carousel-caption">
				               			<h1>Financial</h1>
				               			<p>good business consulting service</p>
				               			<button>learn more</button>										
									</div>
					            </div>
					            <div class="item">
					            	<img src="img/slide-three.jpg" alt="">
					                <div class="carousel-caption">
				               			<h1>Consulting</h1>
				               			<p>good business consulting service</p>
				               			<button>learn more</button>
					                </div>
					            </div>
					            <div class="item">
					            	<img src="img/slide-four.jpg" alt="">
					                <div class="carousel-caption">
				               			<h1>Money</h1>
				               			<p>good business consulting service</p>
				               			<button>learn more</button>
					                </div>
					            </div>
					        </div>
					        <!-- Controls -->
					        <a class="left carousel-control" href="#carouselHacked" role="button" data-slide="prev">
					            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
					            <span class="sr-only">Previous</span>
					        </a>
					        <a class="right carousel-control" href="#carouselHacked" role="button" data-slide="next">
					            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
					            <span class="sr-only">Next</span>
					        </a>
					    </div>
					</div>
				</div>
			</section><!-- end of slider section -->

Right here. You aren’t closing the link. You’re just letting it dangle. It needs </a> to close it. Plus, you had placed the same code right after your <!DOCTYPE html> markup which basically caused your page to look screwed up. You need to place it else where.

Right here. You aren’t closing the link. You’re just letting it dangle. It needs to close it. Plus, you had placed the same code right after your markup which basically caused your page to look screwed up. You need to place it else where.

I can’t close the Link with

Parse error: syntax error, unexpected ‘<’ in C:\Inetpub\vhosts\itsr.at\Rolandreisinger.com\ref\index.php on line 85

I can’t understand this…

You placed something there and started to delete stuff. Most likely a nested HTML markup inside PHP. Can we see your full code? I will try to debug it.

<!DOCTYPE html>

<?php 
$urlPart = explode("/", $_SERVER['REQUEST_URI']);
if (in_array("ref", $urlPart));
$ref = $urlPart[2];
?>



<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Testseite</title>
	<link rel="stylesheet" href="css/font-awesome.min.css">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/style.css">
	<link href='http://fonts.googleapis.com/css?family=Open+Sans:600italic,400,800,700,300' rel='stylesheet' type='text/css'>
	<link href='http://fonts.googleapis.com/css?family=BenchNine:300,400,700' rel='stylesheet' type='text/css'>
</head>
<body>
	
	<!-- ====================================================
	header section -->
	


	<header class="top-header">
		<div class="container">
			<div class="row">
				<div class="col-xs-5 header-logo">
					<br>
					<a href="index.php"><img src="img/logo.png" alt="" class="img-responsive logo"></a>
				</div>

				<div class="col-md-7">
					<nav class="navbar navbar-default">
					  <div class="container-fluid nav-bar">
					    <!-- Brand and toggle get grouped for better mobile display -->
					    <div class="navbar-header">
					      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					        <span class="sr-only">Toggle navigation</span>
					        <span class="icon-bar"></span>
					        <span class="icon-bar"></span>
					        <span class="icon-bar"></span>
					      </button>
					    </div>

					    <!-- Collect the nav links, forms, and other content for toggling -->
					    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					      
					      <ul class="nav navbar-nav navbar-right">
					        <li><a class="menu active" href="#home" >Home</a></li>
					        <li><a class="menu" href="#about">about us</a></li>
					        <li><a class="menu" href="#service">our services </a></li>
					        <li><a class="menu" href="#team">our team</a></li>
					        <li><a class="menu" href="#contact"> contact us</a></li>
					      </ul>
					    </div><!-- /navbar-collapse -->
					  </div><!-- / .container-fluid -->
					</nav>
				</div>
			</div>
		</div>
	</header> <!-- end of header area -->

			
			

			<section class="slider" id="home">
				<div class="container-fluid">
					<div class="row">

					    <div id="carouselHacked" class="carousel slide carousel-fade" data-ride="carousel">
							<div class="header-backup"></div>
					        <!-- Wrapper for slides -->
					        <div class="carousel-inner" role="listbox">
					            <div class="item active">
					            	<img src="img/slide-one.jpg" alt="">
					                <div class="carousel-caption">
				               			<h1>Tax</h1>
				               			<p>good business consulting service</p>
										 <button>learn more</button>
										 <?php 
										 echo '<a href="http://destinationlink.com/ref/' . $urlPart[2] . ' " target="_blank" >';
										 
										 ?>
									</div>
					            </div>
					            <div class="item">
					            	<img src="img/slide-two.jpg" alt="">
					                <div class="carousel-caption">
				               			<h1>Financial</h1>
				               			<p>good business consulting service</p>
				               			<button>learn more</button>										
									</div>
					            </div>
					            <div class="item">
					            	<img src="img/slide-three.jpg" alt="">
					                <div class="carousel-caption">
				               			<h1>Consulting</h1>
				               			<p>good business consulting service</p>
				               			<button>learn more</button>
					                </div>
					            </div>
					            <div class="item">
					            	<img src="img/slide-four.jpg" alt="">
					                <div class="carousel-caption">
				               			<h1>Money</h1>
				               			<p>good business consulting service</p>
				               			<button>learn more</button>
					                </div>
					            </div>
					        </div>
					        <!-- Controls -->
					        <a class="left carousel-control" href="#carouselHacked" role="button" data-slide="prev">
					            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
					            <span class="sr-only">Previous</span>
					        </a>
					        <a class="right carousel-control" href="#carouselHacked" role="button" data-slide="next">
					            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
					            <span class="sr-only">Next</span>
					        </a>
					    </div>
					</div>
				</div>
			</section><!-- end of slider section -->


			<!-- about section -->
			<section class="about text-center" id="about">
				<div class="container">
					<div class="row">
						<h2>about us</h2>
						<h4>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled</h4>

						<div class="col-md-4 col-sm-6">
							<div class="single-about-detail clearfix">
								<div class="about-img">
									<img src="img/about1.jpg" alt="">
								</div>

								<div class="about-details">
									<div class="pentagon-text">
										<h1>T</h1>
									</div>

									<h3>Tax Helping</h3>
									<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
								</div>
							</div>
						</div>

						<div class="col-md-4 col-sm-6">
							<div class="single-about-detail">
								<div class="about-img">
									<img class="img-responsive" src="img/about2.jpg" alt="">
								</div>

								<div class="about-details">
									<div class="pentagon-text">
										<h1>B</h1>
									</div>

									<h3>Business Consulting</h3>
									<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
								</div>
							</div>
						</div>


						<div class="col-md-4 col-sm-6">
							<div class="single-about-detail">
								<div class="about-img">
									<img class="img-responsive" src="img/about3.jpg" alt="">
								</div>

								<div class="about-details">
									<div class="pentagon-text">
										<h1>F</h1>
									</div>

									<h3>Financial Consulting</h3>
									<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
								</div>
							</div>
						</div>

					</div>
				</div>
			</section><!-- end of about section -->


			<!-- service section starts here -->

			<section class="service text-center" id="service">
				<div class="container">
					<div class="row">
						<h2>our services</h2>
						<h4>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</h4>

						<div class="col-md-3 col-sm-6">
							<div class="single-service">
								<div class="single-service-img">
									<div class="service-img">
										<img class="img-responsive" src="img/service1.png" alt="">
									</div>
								</div>
								<h3>Consulting</h3>
							</div>
						</div>

						<div class="col-md-3 col-sm-6">
							<div class="single-service">
								<div class="single-service-img">
									<div class="service-img">
										<img class="img-responsive" src="img/service2.png" alt="">
									</div>
								</div>
								<h3>Financial</h3>
							</div>
						</div>

						<div class="col-md-3 col-sm-6">
							<div class="single-service">
								<div class="single-service-img">
									<div class="service-img">
										<img class="img-responsive" src="img/service3.png" alt="">
									</div>
								</div>
								<h3>Tax Help</h3>
							</div>
						</div>

						<div class="col-md-3 col-sm-6">
							<div class="single-service">
								<div class="single-service-img">
									<div class="service-img">
										<img class="img-responsive" src="img/service4.png" alt="">
									</div>
								</div>
								<h3>Money</h3>
							</div>
						</div>
					</div>
				</div>
			</section><!-- end of service section -->


			<!-- team section -->

			<section class="team" id="team">
				<div class="container">
					<div class="row">
						<div class="team-heading text-center">
							<h2>our team</h2>

							<h4>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled</h4>
						</div>

						<div class="col-md-2 single-member col-sm-4">
							<div class="person">
								<img class="img-responsive" src="img/item1.jpg" alt="member-1">
							</div>

							<div class="person-detail">
								<div class="arrow-bottom"></div>
								<h3>Mr. Graham</h3>
								<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
							</div>
						
						</div>

						<div class="col-md-2 single-member col-sm-4">

							<div class="person-detail">
								<div class="arrow-top"></div>
								<h3>Mr. David</h3>
								<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
							</div>
							<div class="person">
								<img class="img-responsive" src="img/item2.jpg" alt="member-2">
							</div>
						</div>
						<div class="col-md-2 single-member col-sm-4">
							<div class="person">
								<img class="img-responsive" src="img/item3.jpg" alt="member-3">
							</div>
							<div class="person-detail">
								<div class="arrow-bottom"></div>
								<h3>Mr. Hovid</h3>
								<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
							</div>
						</div>

						<div class="col-md-2 single-member col-sm-4">
							<div class="person-detail">
								<div class="arrow-top"></div>
								<h3>Mr Jasak</h3>
								<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
							</div>
							<div class="person">
								<img class="img-responsive" src="img/item4.jpg" alt="member-4">
							</div>
						</div>

						<div class="col-md-2 single-member col-sm-4">
							<div class="person">
								<img class="img-responsive" src="img/item5.jpg" alt="member-5">
							</div>

							<div class="person-detail">
								<div class="arrow-bottom"></div>
								<h3>Mr. Joy Ka</h3>
								<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
							</div>
						</div>

						<div class="col-md-2 single-member col-sm-4">

							<div class="person-detail">
								<div class="arrow-top"></div>
								<h3>Mr. Mikari</h3>
								<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
							</div>
							<div class="person">
								<img class="img-responsive" src="img/item6.jpg" alt="member-5">
							</div>

						</div>
					</div>
				</div>
			</section><!-- end of team section -->

			<!-- map section -->
			<section class="api-map" id="contact">
				<div class="container-fluid">
					<div class="row">
						<div class="col-md-12 map" id="map"></div>
					</div>
				</div>
			</section><!-- end of map section -->

			<!-- contact section starts here -->
			<section class="contact">
				<div class="container">
					<div class="row">
							<div class="contact-caption clearfix">
								<div class="contact-heading text-center">
									<h2>contact us</h2>
								</div>

								<div class="col-md-5 contact-info text-left">
									<h3>contact information</h3>
									<div class="info-detail">
										<ul><li><i class="fa fa-calendar"></i><span>Monday - Friday:</span> 9:30 AM to 6:30 PM</li></ul>
										<ul><li><i class="fa fa-map-marker"></i><span>Address:</span> 123 Some Street , California, US, CP 123</li></ul>
										<ul><li><i class="fa fa-phone"></i><span>Phone:</span> (01) 999-1235</li></ul>
										<ul><li><i class="fa fa-fax"></i><span>Fax:</span> (01) 999-1234</li></ul>
										<ul><li><i class="fa fa-envelope"></i><span>Email:</span> info@domain.com</li></ul>
									</div>
								</div>


								<div class="col-md-6 col-md-offset-1 contact-form">
									<h3>leave us a message</h3>

									<form class="form">
										<input class="name" type="text" placeholder="Name">
										<input class="email" type="email" placeholder="Email">
										<input class="phone" type="text" placeholder="Phone No:">
										<textarea class="message" name="message" id="message" cols="30" rows="10" placeholder="Message"></textarea>
										<input class="submit-btn" type="submit" value="SUBMIT">
									</form>
								</div>

							</div>
					</div>
				</div>
			</section><!-- end of contact section -->


			<!-- footer starts here -->
			<footer class="footer clearfix">
				<div class="container">
					<div class="row">
						<div class="col-xs-6 footer-para">
							<p>&copy;freshDesignweb.com All right reserved</p>
						</div>

						<div class="col-xs-6 text-right">
							<a href=""><i class="fa fa-facebook"></i></a>
							<a href=""><i class="fa fa-twitter"></i></a>
							<a href=""><i class="fa fa-skype"></i></a>
						</div>
					</div>
				</div>
			</footer>



	

	<!-- script tags
	============================================================= -->
	<script src="js/jquery-2.1.1.js"></script>
	<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
	<script src="js/gmaps.js"></script>
	<script src="js/smoothscroll.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/custom.js"></script>
	
</body>
</html>

Are you trying to make the button the reference link or the background image from the slider?

The button…

Try this. I have cleaned up your snippet. The whole page has no proper spacing so I reformatted using the tab key. When you copy it, you’ll most likely get a replacement of 4 spaces which is equivalent to the tab key. You were probably receiving the unexpected < error message because you were trying to add or delete something on line 85 which would cause it to give you a fatal error if you are doing it via PHP. I would also like to advise that you don’t really need the if statement because when you use explode, it will create an array automatically. So I have removed your if statement.

<?php 
$urlPart = explode("/", $_SERVER['REQUEST_URI']);
$ref = $urlPart[2];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Testseite</title>
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:600italic,400,800,700,300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=BenchNine:300,400,700' rel='stylesheet' type='text/css'>
</head>
<body>

<!-- ====================================================
header section -->

<header class="top-header">
    <div class="container">
        <div class="row">
            <div class="col-xs-5 header-logo">
                <br>
                <a href="index.php"><img src="img/logo.png" alt="" class="img-responsive logo"></a>
            </div>

            <div class="col-md-7">
                <nav class="navbar navbar-default">
                    <div class="container-fluid nav-bar">
                        <!-- Brand and toggle get grouped for better mobile display -->
                        <div class="navbar-header">
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            </button>
                        </div>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                            <ul class="nav navbar-nav navbar-right">
                                <li><a class="menu active" href="#home" >Home</a></li>
                                <li><a class="menu" href="#about">about us</a></li>
                                <li><a class="menu" href="#service">our services </a></li>
                                <li><a class="menu" href="#team">our team</a></li>
                                <li><a class="menu" href="#contact"> contact us</a></li>
                            </ul>
                        </div><!-- /navbar-collapse -->
                    </div><!-- / .container-fluid -->
                </nav>
            </div>
        </div>
    </div>
</header> <!-- end of header area -->

<section class="slider" id="home">
    <div class="container-fluid">
        <div class="row">
            <div id="carouselHacked" class="carousel slide carousel-fade" data-ride="carousel">
                <div class="header-backup"></div>
                <!-- Wrapper for slides -->
                <div class="carousel-inner" role="listbox">
                    <div class="item active">
                        <img src="img/slide-one.jpg" alt="">
                        <div class="carousel-caption">
                            <h1>Tax</h1>
                            <p>good business consulting service</p>
                            <button onclick="window.open('http://destinationlink.com/ref/<?php print($urlPart[2]); ?>'); return false;">learn more</button>
                        </div>
                    </div>
                    <div class="item">
                        <img src="img/slide-two.jpg" alt="">
                        <div class="carousel-caption">
                            <h1>Financial</h1>
                            <p>good business consulting service</p>
                            <button>learn more</button>
                        </div>
                    </div>
                    <div class="item">
                        <img src="img/slide-three.jpg" alt="">
                        <div class="carousel-caption">
                            <h1>Consulting</h1>
                            <p>good business consulting service</p>
                            <button>learn more</button>
                        </div>
                    </div>
                    <div class="item">
                        <img src="img/slide-four.jpg" alt="">
                        <div class="carousel-caption">
                            <h1>Money</h1>
                            <p>good business consulting service</p>
                            <button>learn more</button>
                        </div>
                    </div>
                </div>
                <!-- Controls -->
                <a class="left carousel-control" href="#carouselHacked" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="right carousel-control" href="#carouselHacked" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>
    </div>
</section><!-- end of slider section -->

<!-- about section -->
<section class="about text-center" id="about">
    <div class="container">
        <div class="row">
            <h2>about us</h2>
            <h4>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled</h4>

            <div class="col-md-4 col-sm-6">
                <div class="single-about-detail clearfix">
                    <div class="about-img">
                        <img src="img/about1.jpg" alt="">
                    </div>

                    <div class="about-details">
                        <div class="pentagon-text">
                            <h1>T</h1>
                        </div>

                        <h3>Tax Helping</h3>
                        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
                    </div>
                </div>
            </div>

            <div class="col-md-4 col-sm-6">
                <div class="single-about-detail">
                    <div class="about-img">
                        <img class="img-responsive" src="img/about2.jpg" alt="">
                    </div>

                    <div class="about-details">
                        <div class="pentagon-text">
                            <h1>B</h1>
                        </div>

                        <h3>Business Consulting</h3>
                        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
                    </div>
                </div>
            </div>

            <div class="col-md-4 col-sm-6">
                <div class="single-about-detail">
                    <div class="about-img">
                        <img class="img-responsive" src="img/about3.jpg" alt="">
                    </div>

                    <div class="about-details">
                        <div class="pentagon-text">
                            <h1>F</h1>
                        </div>

                        <h3>Financial Consulting</h3>
                        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section><!-- end of about section -->

<!-- service section starts here -->

<section class="service text-center" id="service">
    <div class="container">
        <div class="row">
            <h2>our services</h2>
            <h4>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</h4>

            <div class="col-md-3 col-sm-6">
                <div class="single-service">
                    <div class="single-service-img">
                        <div class="service-img">
                            <img class="img-responsive" src="img/service1.png" alt="">
                        </div>
                    </div>
                    <h3>Consulting</h3>
                </div>
            </div>

            <div class="col-md-3 col-sm-6">
                <div class="single-service">
                    <div class="single-service-img">
                        <div class="service-img">
                            <img class="img-responsive" src="img/service2.png" alt="">
                        </div>
                    </div>
                    <h3>Financial</h3>
                </div>
            </div>

            <div class="col-md-3 col-sm-6">
                <div class="single-service">
                    <div class="single-service-img">
                        <div class="service-img">
                            <img class="img-responsive" src="img/service3.png" alt="">
                        </div>
                    </div>
                    <h3>Tax Help</h3>
                </div>
            </div>

            <div class="col-md-3 col-sm-6">
                <div class="single-service">
                    <div class="single-service-img">
                        <div class="service-img">
                            <img class="img-responsive" src="img/service4.png" alt="">
                        </div>
                    </div>
                    <h3>Money</h3>
                </div>
            </div>
        </div>
    </div>
</section><!-- end of service section -->

<!-- team section -->

<section class="team" id="team">
    <div class="container">
        <div class="row">
            <div class="team-heading text-center">
                <h2>our team</h2>
                <h4>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled</h4>
            </div>

            <div class="col-md-2 single-member col-sm-4">
                <div class="person">
                    <img class="img-responsive" src="img/item1.jpg" alt="member-1">
                </div>

                <div class="person-detail">
                    <div class="arrow-bottom"></div>
                    <h3>Mr. Graham</h3>
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
                </div>
            </div>

            <div class="col-md-2 single-member col-sm-4">
                <div class="person-detail">
                    <div class="arrow-top"></div>
                    <h3>Mr. David</h3>
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
                </div>
                <div class="person">
                    <img class="img-responsive" src="img/item2.jpg" alt="member-2">
                </div>
            </div>
            <div class="col-md-2 single-member col-sm-4">
                <div class="person">
                    <img class="img-responsive" src="img/item3.jpg" alt="member-3">
                </div>
                <div class="person-detail">
                    <div class="arrow-bottom"></div>
                    <h3>Mr. Hovid</h3>
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
                </div>
            </div>

            <div class="col-md-2 single-member col-sm-4">
                <div class="person-detail">
                    <div class="arrow-top"></div>
                    <h3>Mr Jasak</h3>
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
                </div>
                <div class="person">
                    <img class="img-responsive" src="img/item4.jpg" alt="member-4">
                </div>
            </div>

            <div class="col-md-2 single-member col-sm-4">
                <div class="person">
                    <img class="img-responsive" src="img/item5.jpg" alt="member-5">
                </div>

                <div class="person-detail">
                    <div class="arrow-bottom"></div>
                    <h3>Mr. Joy Ka</h3>
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
                </div>
            </div>

            <div class="col-md-2 single-member col-sm-4">
                <div class="person-detail">
                    <div class="arrow-top"></div>
                    <h3>Mr. Mikari</h3>
                    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, </p>
                </div>
                <div class="person">
                    <img class="img-responsive" src="img/item6.jpg" alt="member-5">
                </div>
            </div>
        </div>
    </div>
</section><!-- end of team section -->

<!-- map section -->
<section class="api-map" id="contact">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12 map" id="map"></div>
        </div>
    </div>
</section><!-- end of map section -->

<!-- contact section starts here -->
<section class="contact">
    <div class="container">
        <div class="row">
            <div class="contact-caption clearfix">
                <div class="contact-heading text-center">
                    <h2>contact us</h2>
                </div>

                <div class="col-md-5 contact-info text-left">
                    <h3>contact information</h3>
                    <div class="info-detail">
                        <ul><li><i class="fa fa-calendar"></i><span>Monday - Friday:</span> 9:30 AM to 6:30 PM</li></ul>
                        <ul><li><i class="fa fa-map-marker"></i><span>Address:</span> 123 Some Street , California, US, CP 123</li></ul>
                        <ul><li><i class="fa fa-phone"></i><span>Phone:</span> (01) 999-1235</li></ul>
                        <ul><li><i class="fa fa-fax"></i><span>Fax:</span> (01) 999-1234</li></ul>
                        <ul><li><i class="fa fa-envelope"></i><span>Email:</span> info@domain.com</li></ul>
                    </div>
                </div>

                <div class="col-md-6 col-md-offset-1 contact-form">
                    <h3>leave us a message</h3>
                    <form class="form">
                        <input class="name" type="text" placeholder="Name">
                        <input class="email" type="email" placeholder="Email">
                        <input class="phone" type="text" placeholder="Phone No:">
                        <textarea class="message" name="message" id="message" cols="30" rows="10" placeholder="Message"></textarea>
                        <input class="submit-btn" type="submit" value="SUBMIT">
                    </form>
                </div>
            </div>
        </div>
    </div>
</section><!-- end of contact section -->

<!-- footer starts here -->
<footer class="footer clearfix">
    <div class="container">
        <div class="row">
            <div class="col-xs-6 footer-para">
                <p>&copy;freshDesignweb.com All right reserved</p>
            </div>

            <div class="col-xs-6 text-right">
                <a href=""><i class="fa fa-facebook"></i></a>
                <a href=""><i class="fa fa-twitter"></i></a>
                <a href=""><i class="fa fa-skype"></i></a>
            </div>
        </div>
    </div>
</footer>

<!-- script tags
============================================================= -->
<script src="js/jquery-2.1.1.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script src="js/gmaps.js"></script>
<script src="js/smoothscroll.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/custom.js"></script>
</body>
</html>
1 Like

Try this. I have cleaned up your snippet. The whole page has no proper spacing so I reformatted using the tab key. When you copy it, you’ll most likely get a replacement of 4 spaces which is equivalent to the tab key. You were probably receiving the unexpected < error message because you were trying to add or delete something on line 85 which would cause it to give you a fatal error if you are doing it via PHP. I would also like to advise that you don’t really need the if statement because when you use explode, it will create an array automatically. So I have removed your if statement.

Great Job!
It works! Big Thanks from Austria-Europe!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.