angular.js view is returning blank page - php

I am new to angular.js. i have wrote controller, services etc to fetch data using data service but my view page is being shown blank. i have checked with every thing but could not resolve the issue, any help would be appreciable.
//My app.js
'use strict';
angular.module('CricdomApp', [
'CricdomApp.services',
'CricdomApp.controllers',
'ui.router'
]).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when("/team", {templateUrl: "partials/list.html", controller: "teamController"}).
otherwise({redirectTo: '/'});
}]);
//Controller
angular.module('CricdomApp.controllers', []).
controller('teamController', function($scope, cricAPIservice) {
$scope.id = $routeParams.id;
$scope.races = [];
$scope.driver = null;
$scope.driversList = [];
cricAPIservice.getDrivers().success(function (response) {
//Digging into the response to get the relevant data
$scope.driversList = response.MRData.StandingsTable.StandingsLists[0].DriverStandings;
});
});
//Services
angular.module('CricdomApp.services', []).
factory('cricAPIservice', function($http) {
var cricAPI = {};
cricAPI.getDrivers = function() {
return $http({
method: 'JSONP',
url: 'http://nobleislam.com/cricdom_backend/public/team/list?callback=JSON_CALLBACK'
});
}
return cricAPI;
});
//List html page.
<section id="main">
<- Back to drivers list
<nav id="secondary" class="main-nav">
<!--<div class="driver-picture">
<div class="avatar">
<img ng-show="driver" src="img/drivers/{{driver.Driver.driverId}}.png" />
<img ng-show="driver" src="img/flags/{{driver.Driver.nationality}}.png" /><br/>
{{driver.Driver.givenName}} {{driver.Driver.familyName}}
</div>
</div>-->
<div class="driver-status">
Country: {{driver.Driver.country}} <br/>
Team: {{driver.Constructors[0].name}}<br/>
<!-- Birth: {{driver.Driver.dateOfBirth}}<br/> -->
<!-- Biography -->
</div>
</nav>
</section>
//Index page
<section id="main">
<- Back to drivers list
<nav id="secondary" class="main-nav">
<div class="driver-status">
Country: {{driver.Driver.country}} <br/>
Team: {{driver.Constructors[0].name}}<br/>
</div>
</nav>
</section>

Your service Code
angular.module('CricdomApp.services', []).
factory('cricAPIservice', function($http) {
var cricAPI = {};
cricAPI.getDrivers = function() {
return $http({
dataType: 'JSONP',
method: 'POST',
url: 'http://nobleislam.com/cricdom_backend/public/team/list?callback=JSON_CALLBACK'
});
}
return cricAPI;
});
You were missing App and Controller reference in your HTML Code
//ng-app="CricdomApp" ng-controller="teamController"
<div id="Container" ng-app="CricdomApp" ng-controller="teamController">
<section id="main">
<- Back to drivers list
<nav id="secondary" class="main-nav">
<!--<div class="driver-picture">
<div class="avatar">
<img ng-show="driver" src="img/drivers/{{driver.Driver.driverId}}.png" />
<img ng-show="driver" src="img/flags/{{driver.Driver.nationality}}.png" /><br/>
{{driver.Driver.givenName}} {{driver.Driver.familyName}}
</div>
</div>-->
<div class="driver-status">
Country: {{driver.Driver.country}} <br/>
Team: {{driver.Constructors[0].name}}<br/>
<!-- Birth: {{driver.Driver.dateOfBirth}}<br/> -->
<!-- Biography -->
</div>
</nav>
</section>
//Index page
<section id="main">
<- Back to drivers list
<nav id="secondary" class="main-nav">
<div class="driver-status">
Country: {{driver.Driver.country}} <br/>
Team: {{driver.Constructors[0].name}}<br/>
</div>
</nav>
</section>
</div>

Related

Why is my Ajax request failing for infinity scroll pagination in laravel?

I am trying to perform an infinity scroll pagination using window.scroll() method on laravel. Whenever I reach bottom of the page-
loadMoreData(page) is called.
beforeSend:function() successfully executes.
.fail() calls from $.ajax() and alerts "server not responding".
Here are my laravel and ajax codes below from 3 different files - index.blade, data.blade(Views/data), PostController.php
INDEX.BLADE
#extends('layouts.app')
#section('content')
`<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">`
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"integrity="sha2569/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="crossorigin="anonymous"></script>
<div class="container">
<div class="col-md-12" id="post-data">
#include('data')
</div>
<div class="ajax-load text-center" style ="display:none">
<p><img src="/storage/Rand_Img/insta-dataloader.gif">Loading More Post... </p>
</div>
</div>
<script>
$(document).ready(function(){
function loadMoreData(page){
$.ajax({
url:'?page='+ page,
type:'get',
beforeSend:function(){
$(".ajax-load").show();
}
}).done(function(data){
if(data.html == " "){
$('.ajax-load').html("No more data");
}
$('.ajax-load').hide();
$("#post-data").append(data.html);
}).fail(function(jqXHR, ajaxOptions, thrownError){
alert('Server not responding!');
console.log("textStatus: "+textStatus+"\n ajaxOPtions: "+ajaxOptions+"\n jqXHR: "+jqXHR);
});
}
$(window).scroll(function(){
var page = 1;
if($(window).scrollTop() + $(window).height() >= $(document).height() ){
page++;
loadMoreData(page);
}
});
});
</script>
#endsection
Data.BLADE
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
crossorigin="anonymous"></script>
#foreach ($post as $show)
<div class="row">
<div class="col-6 offset-1">
<div class="">
<div class="d-flex align-items-center">
<div class="pr-4">
<img src="{{$show->user->Profile->profileImage() }}"
alt="{{$show->image}}" style="width:70px;" class="rounded-circle">
</div>
<a href="/profile/{{$show->user->id}}/index" style=" font-size:20px;">
{{$show->user->username}}</a>
Follow
</div>
<div class="">
<p style="font-size:20px;" class="p-4">{{$show->caption}}</p>
</div>
</div>
</div>
</div>
<div class="row pb-5 ">
<div class="col-6 offset-3">
<a href="/profile/{{$show->user->id}}/index">
<img src="/storage/{{$show->image}}" alt="{{$show->image}}"class="w-100"></a>
</div>
</div>
#endforeach
PostController.php
$user_id = auth()->user()->following()->pluck('profiles.user_id');
$post = Post::whereIn('user_id', $user_id)->orderBy('created_at','DESC')->Paginate(3);
if(($request->ajax())){
$view = view('data', compact('post'))->render();
return response()->json(['html'=>$view]);
}
return view('Post/index', compact('post'));
This is what I am getting from network tab...
Response:
Can you try to put the full URL into your ajax call method?
I believe that without specifying the full URL like you did url:'?page='+ page, jQuery will use the current browser page URL as base URL. So Something like url:'https://example.com?page='+ page.
EDIT:
Your controller seems to return when the request is Ajax response()->json(['html'=>$view]);. What is the $view object, and why returning it? You should only return the $post variable as JSON, and also retrieve the page number from the request URL parameters (hardcoded at 3 in your script).

Div not showing in a jQuery Ajax Call

I have a page using bootstrap 3 framework that has a button which when pressed collects data from another page (mydata.php) with ajax and echoes it out within <div id="results"> on the page. The code works fine but as soon as I add <div class=\"col-xs-6\"> to mydata.php nothing appears on the page although I can see it within firebug.
If I change $("#results").append(html); to $("#results").text(html); the html echoes onto the page but as text without any formatting. If I remove <div class=\"col-xs-6\"> from mypage.php the data gets displayed on the page as expected. Why is the data from mydata.php not displayed when I add <div class=\"col-xs-6\">?
<div class="container">
<div class="row">
<div class="col-xs-12 col-centered">
<div class="col-xs-8 col-md-3 col-lg-3">
<button type="submit" name="btn" value="search" id="myButton" class="search_button btn btn-small btn-default btn-pull-right">Press</button>
</button>
</div>
</div>
</div>
<div class="row">
<div id="results"><!--data displayed here-->
</div>
</div><!--Row-->
</div><!--Cont-->
jQuery
$(document).ready(function(){
$(function() {
$("#myButton").click(function() {
var btn = $("#myButton").val();
var data = 'btn='+ btn;
// if location is not empty
if(data) {
// ajax call
$.ajax({
type: "POST",
url: "mydata.php",
data: data,
success: function(html){
$("#results").append(html);
}
});
}
return false;
});
});
});
mydata.php looks like this:
<?php
if (isset($_POST['btn'])) {
echo "
<div class=\"col-xs-6\">
<ul>
<li><h4>Data in this Div</h4></li>
</ul>
</div>
<div class=\"col-xs-6\">
<ul>
<li><h4>And Data in this Div</h4></li>
</ul>
</div>";
}
?>
if you do not add jQuery library then include it
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<div class="row">
<div class="col-xs-12 col-centered">
<div class="col-xs-8 col-md-3 col-lg-3">
<button type="submit" name="btn" value="search" id="myButton"
class="search_button btn btn-small btn-default btn-pull-right">Press
</button>
</button>
</div>
</div>
</div>
<div class="row">
<div id="results"><!--data displayed here-->
</div>
</div><!--Row-->
</div><!--Cont-->
<script>
$(document).ready(function () {
$(function () {
$("#myButton").click(function () {
var btn = $("#myButton").val();
var data = 'btn=' + btn;
// if location is not empty
if (data) {
// ajax call
$.ajax({
type: "POST",
url: "http://localhost/edit.php", // your file path
data: data,
success: function (html) {
$("#results").append(html); // if you want to replace results div then change $("#results").html(html);
}
});
}
return false;
});
});
});
</script>
it is working fine my side, i have tested in my local side
this is output:
Removing the ajax part works without problems... Are you sure you are receiving that exact HTML?
$('#result').append("<div class=\"col-xs-6\">"+
"<ul>"+
"<li><h4>Data in this Div</h4></li>"+
"</ul>"+
"</div>"+
""+
"<div class=\"col-xs-6\">"+
""+
"<ul>"+
"<li><h4>And Data in this Div</h4></li>"+
"</ul>"+
"</div>");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="result">
</div>
$('#myButton').on('click',function(){
var form = jQuery("#form");
$.ajax({
url: 'mydata.php',
type: 'POST',
data: form.serialize(),
cache: false,
dataType : 'json',
success: function(data){
if(data==true){
$("#results").append(data);
}
if(data==false){
}
},
error: function(){
}
});
return false;
});

jQuery JSON parse and apend data on different placement

I have a page and I want to show and refresh different ads on different locations. I'm getting response from PHP File successfully via AJAX but unable to append them to specific placements.
HTML CODE
<script>var ads = [];</script>
<div id="ad-728x90">fhhfgh</div>
<!-- Page Content -->
<div class="container">
<!-- Heading Row -->
<div class="row">
<div class="col-md-8">
<img class="img-responsive img-rounded" src="http://placehold.it/900x350" alt="">
</div>
<!-- /.col-md-8 -->
<div class="col-md-4">
<h1>Business Name or Tagline</h1>
<p>This is a template that is great for small businesses. It doesn't have too much fancy flare to it, but it makes a great use of the standard Bootstrap core components. Feel free to use this template for any project you want!</p>
<a class="btn btn-primary btn-lg" href="#">Call to Action!</a>
</div>
<!-- /.col-md-4 -->
</div>
<!-- /.row -->
<hr>
<!-- Call to Action Well -->
<div class="row">
<div class="col-lg-12">
<div class="well text-center">
This is a well that is a great spot for a business tagline or phone number for easy access!
</div>
<div id="ad-300x250" class="ads"></div>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
Javascript / jQuery code
<script type="text/javascript">ads.push("728x90", "300x250");</script>
<script>
$(document).ready(function()
{
function loadAds()
{
$.post('ads.php', { adID: ads }, function (e) {
if (e.status == 'error')
{
$('.ads').each(function ()
{
$(this).remove();
});
}
else if (e.status == 'ok')
{
var data = e.data;
$.each(data, function (adID)
{
$('#ad-' + adID).find('.ads').html();
});
}
}, 'json');
}
loadAds();
});
</script>
JSON Response:
{"status":"ok","data":{"728x90":"\r\n\t\r\n\t\t\r\n\t\t\t
728x90 ads</p>\r\n\t\t</div>\r\n\t</div>","300x250":"\r\n\t\r\n\t\t\r\n\t\t\t300x250 ads</p>\r\n\t\t</div>\r\n\t</div>"}}
The following should place data in proper id
$.each(data, function (adID, adHtml){
$('#ad-' + adID).html(adHtml);
});
The html shown in question doesn't show any children with class ads in <div id="ad-728x90"> so find('.ads') was removed
Question needs clarification of expected results if this doesn't work

When form send adds \r\n to the code i put inside

Here is the full page code
<?php
if (!isset($_SESSION)) session_start();
if(!isset($_SESSION['admin_vmp']))
header('Location: ./login.php');
include "header.php";
include "../functions.php";
if(isset($_POST['leaderboard1']))
{
$leaderboard1 = $_POST["leaderboard1"];
$leaderboard1=mysql_real_escape_string($leaderboard1);
$leaderboard2 = $_POST["leaderboard2"];
$leaderboard2=mysql_real_escape_string($leaderboard2);
$medrec = $_POST["medrec"];
$medrec=mysql_real_escape_string($medrec);
update_ads($leaderboard1,$leaderboard2,$medrec);
}
?>
<title>Ads - <?php echo(get_title()) ?></title>
<script type='text/javascript'>
$(window).load(function(){
$(document).ready(function () {
$('#selectall').click(function () {
$('.selectedId').prop('checked', this.checked);
});
$('.selectedId').change(function () {
var check = ($('.selectedId').filter(":checked").length == $('.selectedId').length);
$('#selectall').prop("checked", check);
});
});
});
</script>
<?php
include "header_under.php";
?>
<div id="containerHolder">
<div id="container">
<div id="sidebar">
<ul class="sideNav">
<li>Website</li>
<li>Thumbnails</li>
<li>Watermark</li>
<li>Media</li>
<li>Social Media</li>
<li>Ad Management</li>
<li>Admin Settings</li>
<li>Analytics (Stats Tracking)</li>
<li>RSS Settings</li>
<li>Sitemap Settings</li>
<li>Comments Setting</li>
</ul>
<!-- // .sideNav -->
</div>
<!-- // #sidebar -->
<!-- h2 stays for breadcrumbs -->
<h2>Ad Management</h2>
<div id="main">
<br />
<form action="./ads.php" method="post">
<fieldset>
<p><a name="top_leaderboard"><label><b>Top : Large leaderboard (728 x 90)</b></label></a><textarea name="leaderboard1"><?php echo(show_leaderboard1_ad()) ?></textarea></p>
<p><a name="bottom_leaderboard"><label><b>Bottom : Large leaderboard (728 x 90)</b></label></a><textarea name="leaderboard2"><?php echo(show_leaderboard2_ad()) ?></textarea></p>
<p><label><a name="med_rec"><b>Sidebar : Medium Rectangle (300 x 250)</b></label></a><textarea name="medrec"><?php echo(show_rectangle_ad()) ?></textarea></p>
<input type="submit" class="myButton" value="Update Ads">
</fieldset>
</form>
<?php
if(isset($_POST['leaderboard1']))
echo('<div class="alert alert-success">Ads Updated Successfully</div>');
?>
</div>
<!-- // #main -->
<div class="clear"></div>
</div>
<!-- // #container -->
</div>
<!-- // #containerHolder -->
<?php
include "footer.php";
?>
Im using this for google ads, after adding the ad code its saves but automaticly ads \r\n in some places.. Is there posibble way to fix this.
Wat i want to fix.. I want to fix that \r\n not to be putted after saving the code so if i put ads will be clean and same as google gives them.
Thank you very much!
function update_ads($leaderboard1,$leaderboard2,$medrec)
{
$update_query = "UPDATE ads SET leaderboard1='".mysql_real_escape_string($leaderboard1)."',leaderboard2='".mysql_real_escape_string($leaderboard2)."',rectangle='".mysql_real_escape_string($medrec)."'";
mysql_query($update_query);
}
you are running mysql_real_escape_string twice (inside the function and before you parse the values to the function), that's the problem
change
$leaderboard1 = $_POST["leaderboard1"];
$leaderboard1=mysql_real_escape_string($leaderboard1);
$leaderboard2 = $_POST["leaderboard2"];
$leaderboard2=mysql_real_escape_string($leaderboard2);
$medrec = $_POST["medrec"];
$medrec=mysql_real_escape_string($medrec);
update_ads($leaderboard1,$leaderboard2,$medrec);
to
update_ads($_POST["leaderboard1"],$_POST["leaderboard2"],$_POST["medrec"]);

Undefined constant php error message in laravel

I am new in MVC framework. I created an application in Laravel Framework & it was working fine. Now after some modification when I want to view the index page the following error is shown to me-
Message:
Use of undefined constant php - assumed 'php'
Location:
C:\wamp\www\alpha.team.com\laravel\view.php(354) : eval()'d code on
line 32
Here is my view code of index.blade.php
#layout('/layouts/layout')
<link href='http://fonts.googleapis.com/css?family=Neucha' rel='stylesheet' type='text/css'>
<div id="top">
#section('navigation')
<!-- <li class="active"><i class="icon-user"></i> My Profile</li> -->
<li><i class="icon-book"></i> Dashboard</li>
#parent
#endsection
</div>
#section('content')
<!-- For showing error message if any error occours-->
<?php if(Session::get('error')): ?>
<div class="alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Warning!</strong> <?php echo Session::get('error'); ?>
</div>
<?php endif; ?>
<!-- For showing success message.-->
<?php if(Session::get('success')): ?>
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Well done!</strong> <?php echo Session::get('success'); ?>
</div>
<?php endif; ?>
<div class="field-section">
<div class="hero-unit">
<!-- <a id="logo" href="#"><img alt="TechIndyeah" src="/uploads/logo.png" style="vertical-align: top;"></a> -->
<h1 style="display:inline;">Team TechIndyeah</h1>
<ul class="teams" style="text-align:center;">
#foreach($departments as $dept)
<?php// print_r($dept); ?>
<li>
<?php echo $dept->name; ?>
</li>
#endforeach
</ul>
</div>
</div> <!-- field-section div ends here-->
<!-- <div class="container"> -->
<div class="wrapper">
<div class="hero-unit" id="bg-pattern">
<h1 class="home-tag"> Tech-ing India<span><p>The team of enthusiastic tech fanatics</p></span></h1>
<p class="home-ptag">We are a team of enthusiastic tech fanatics and yes we are Apple fanboys too. We have sailed out together on a small boat and we do live in what Seth Godin says, “Small is the next big”. We love technology and we love you. Our team is free, creative and always brimming with ideas.</p>
<div class="row" style="background:none;">
<div class="span8">
<h1 class="home-tag" >About Us</h1>
<p class="home-ptag">TechIndyeah has a team which is highly process oriented and has a sharp client-centric approach. Our mission is to help you to build your footprints in business. We are a team inspired by a vision and driven by technology. We are driven by an offbeat approach when it comes to client servicing and support. We have been serving our clients for a long time and have won accolades galore. We are a team and we believe in making our time resourceful so that our clients get the most out of us. We are a band of developers, designers and marketers who can take your business online and also combat the stiff competition from similar players in your domain. </p>
</div>
<div class="span3">
<object type="image/svg+xml" data="/img/logo.svg">
<img alt="TechIndyeah" src="/img/logo.png" style="vertical-align:top;">
</object>
</div>
</div>
<div class="row">
<div class="span4">
<!-- <a id="logo" href="#"><img alt="TechIndyeah" src="/uploads/logo.png"></a> -->
</div>
<!-- <div class="span6" id="caption">
<h3>Here We Are</h3>
</div> -->
</div>
<div class="row">
<?php $something = $errors->all();
if(!empty($something)): ?>
<div class = "alert alert-error">
<button type="button" class="close" data-dismiss="alert">×</button>
#foreach ($errors->all('<p>:message</p>') as $input_error)
{{ $input_error }}
#endforeach
</div>
<?php endif; ?>
</div>
<!-- For showing all employee name in the front page.. Showcasing them..-->
<div id="hero-unit">
<script type="text/javascript">
//The departments are randomly comming in the page when it is first loaded..
(function($) {
// Get the list items and hide them
var items = $(".teams > li").css({opacity:0});
// Shuffle them
shuffle(items);
// Start the fade-in queue
nextItemFade(items);
// Animation callback to start next fade-in
function nextItemFade(items) {
// Fade in the first element in the collection
items.eq(0).animate({opacity:1}, 400, function() {
// Recurse, but without the first element
nextItemFade(items.slice(1));
});
}
// Shuffles an array
// Based on http://jsfromhell.com/array/shuffle
function shuffle(a) {
var j, // Random position
x, // Last item
i = a.length; // Iterator
// Loop through the array
while(i) {
// Select a random position
j = (Math.random() * i) | 0;
// Get the last item in the array
x = a[--i];
// Swap the last item with the item at the selected position
a[i] = a[j];
a[j] = x;
}
return a;
}
/* Minified version
function shuffle(a) {
for(var j, x, i = a.length; i; j = (Math.random() * i) | 0, x = a[--i], a[i] = a[j], a[j] = x);
return a;
} */
})(jQuery);
$(".nav1 li").each(
function(intIndex) {
var l = Math.floor(Math.random() * $(".nav1").width());
var t = Math.floor(Math.random() * $(".nav1").height());
$(this).css("left", l);
$(this).css("top", t);
$(this).on(
"click",
function() {
alert("l=" + l + " t=" + t);
}
);
}
);
$(".nav1 li").each(
function(intIndex) {
var l = Math.floor(Math.random() * 940);
var t = Math.floor(Math.random() * 500);
$(this).css("left", l);
$(this).css("top", t);
$(this).on(
"click",
function() {
alert("l=" + l + " t=" + t);
}
);
}
);
</script>
<style type="text/css">
.nav1
{
position:relative;
}
.nav1 li
{
padding: 10px;
position:absolute;
}
</style>
</div> <!-- #hero-unit ends here-->
<!-- </div> mucarousel div ends here -->
<div class="member-list">
<!-- <object type="image/svg+xml" data="/img/vector-tree2.svg"> -->
<!-- <img alt="TechIndyeah" src="/img/vector-tree2.png" style="vertical-align:top;"> -->
<!-- </object> -->
#foreach($departments as $dept)
<div id="<?php echo implode('_',explode(' ',$dept->name));?>" class="demo">
<ul class="member">
<?php $users = User::where('department_id','=',$dept->id)->get();
// $users = User::where('department_code','=',$dept->code)->get();
?>
#foreach($users as $user)
<li class="new-element" style="display:inline-block;" rel="tooltip" data-placement="right" data-original-title="<?php echo $user->first_name." ".$user->last_name;?>">
<a href="/home/view/<?php echo $user->username;?>" rel="tooltip" data-placement="right" href="#" data-original-title="<?php echo $user->first_name." ".$user->last_name."</br> ".$user->designation;?>">
<img class="hover-img" src="http://graph.facebook.com/<?php echo $user->facebook_id;?>/picture?type=large">
</a>
</li>
#endforeach
</ul>
Back To Top
</div>
#endforeach
<script type="text/javascript">
$(window).scroll(function(){
if ($(this).scrollTop() > 50) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
</script>
<script type="text/javascript">
//all links which start with a # will have an animated scroll to the target.
$('a[href^="#"]').on('click.smoothscroll',function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
// console.log($target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top - 10
}, 900, 'swing', function () {
window.location.hash = target;
});
});
$('.new-element').children('a').tooltip();
</script>
</div>
<h1 style="text-align:center;font-family: 'Lato light', sans-serif;text-shadow: 2px 1px #848686;">TechIndyeah Software Pvt. Ltd.</h1>
</div>
</div>
#endsection
</div>
I cannot understand. Please help.
I'm not familiar with Laravel, but it seems that an eval() in a file named view.php is rendering a template. So my guess is that someplace in your template (whatever template is being rendered) you have php where you really mean 'php'.
For example:
echo $data[php]; //you have this
echo $data['php']; //but it should be this
//or
if(php == $var){} //you have this
if('php' == $var){} //but it should be this
Can you share some of the code that is in your view.php file?
You're doing something wrong on line 32 of that file, so it would be very helpful if we can see what the code actually is :)

Categories