- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我在 codeigniter 工作,突然收到一个奇怪的错误。以下文件运行良好,但突然停止执行 php 代码。当我去检查错误日志时,这是它的错误。
[09-Jun-2014 14:36:58 America/Denver] PHP Fatal error: Call to undefined function phpob_start() in /*/views/mobile_views/templates/header.php on line 1
看起来它以某种方式组合了前两行。当我试图删除 ob_start() 语句时,它开始为下一行提供错误。
知道突然发生了什么吗?我已经复制并粘贴了整个文件代码如下。
谢谢。
<?php
ob_start();
$user_name = $this->session->userdata('interactin_username');
$name = '';
if (isset($user_name) && $user_name != '') {
$name = $user_name;
} else {
$name = 'Guest';
}
$header_link = "frontend_individual";
if ($this->session->userdata('interactin_user_type') == "3") {
$header_link = "frontend_business";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $title; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<?php if(isset($first_para)&&$first_para!=""){ echo $first_para; } ?>" />
<meta name="author" content="">
<!-- <link href='http://fonts.googleapis.com/css?family=Oswald:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>-->
<!-- <link href='<?php echo base_url(); ?>assets/fonts/googlefonts.css' rel='stylesheet' type='text/css'>-->
<!-- <link href="<?php echo base_url(); ?>assets/css/style-new.css" rel="stylesheet" />-->
<link href="<?php echo base_url(); ?>assets/mobile_css/style.css" rel="stylesheet">
<!--<link href="<?php echo base_url(); ?>assets/css/main.css" rel="stylesheet">-->
<link href="<?php echo base_url(); ?>assets/mobile_css/business.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url(); ?>assets/mobile_css/user.css" rel="stylesheet" media="all" />
<!-- Le styles -->
<link href="<?php echo base_url() ?>assets/mobile_css/bootstrap.css" rel="stylesheet">
<link href="<?php echo base_url() ?>assets/mobile_css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/mobile_css/jquery-ui.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/mobile_css/jquery.mCustomScrollbar.css" />
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="<?php echo base_url() ?>assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php echo base_url() ?>assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo base_url() ?>assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo base_url() ?>assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php echo base_url() ?>assets/ico/apple-touch-icon-57-precomposed.png">
<!-- jQuery -->
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>-->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>-->
<!-- <script src="<?php echo base_url() ?>assets/js/jquery_1.8.2.js"></script>-->
<script src="<?php echo base_url() ?>assets/js/jquery.js"></script>
<script src="<?php echo base_url() ?>assets/js/jquery-ui.js"></script>
<script src="<?php echo base_url() ?>assets/js/site.js"></script>
<script src="<?php echo base_url() ?>assets/js/ajaxfileupload.js"></script>
<!-- <script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>-->
<script src="<?php echo base_url() ?>assets/js/modernizr.js"></script>
<script src="<?php echo base_url() ?>assets/js/ddaccordion.js"></script>
<!-- FlexSlider -->
<link rel="stylesheet" href="<?php echo base_url() ?>assets/mobile_css/flexslider.css" type="text/css" media="screen" />
<script defer src="<?php echo base_url() ?>assets/js/jquery.flexslider.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/edit_resume.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/edit_resume_zulqurnan.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/interest_list_filteration.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/add_event.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/applications_list_filteration.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/front_end_jobs_filtered.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/product.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/search_individual.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/search_company.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/comments.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/placeholders.min.js"></script>
<script type="text/javascript">
/*$(function(){
SyntaxHighlighter.all();
});*/
$(window).load(function(){
$('.flexslider').flexslider({
animation: "slide",
start: function(slider){
$('body').removeClass('loading');
}
});
});
</script>
<script type="text/javascript">
ddaccordion.init({
headerclass: "submenuheader", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["unselected", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["suffix", "<span class='statusicon' />", "<span class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})
$(document).ready(function() {
if($('.submenuheader').hasClass("unselected")) {
$('.unselected').parent().removeClass('open');
}
else {
$('.selected').parent().addClass('open');
}
$(".submenuheader").click(function(){
if($('.submenuheader').hasClass("unselected")) {
$('.unselected').parent().removeClass('open');
}
else {
$('.selected').parent().addClass('open');
}
});
});
</script>
<script src="<?php echo base_url() ?>assets/js/date_time.js"></script>
<style>
.cmenu {margin: 0; padding: 0.3em; list-style-type: none;
background-color: white;}
.cmenu li:hover {}
.cmenu hr {border: 0; border-bottom: 1px solid grey;
margin: 3px 0px 3px 0px; width: 10em;}
.cmenu a {border: 0 !important;}
.cmenu a:hover {text-decoration: underline !important;}
.cmenu .topSep {font-size: 90%; border-top: 1px solid gray;
margin-top: 0.3em; padding-top: 0.3em;}
</style>
<!-- JCrop, FancyBox and Uploadify scripts -->
<link href="<?php echo base_url() ?>assets/uploadify/uploadify.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url() ?>assets/jcrop/css/jquery.Jcrop.css" rel="stylesheet" type="text/css">
<link href="<?php echo base_url() ?>assets/fancybox/jquery.fancybox-1.3.1.css" rel="stylesheet" type="text/css">
<?php
if ($this->uri->segment(2) == 'pricingsss') {
?>
<script type="text/javascript" src="<?php echo base_url() . "assets/pricing_assets/js/jquery.js" ?>"></script>
<script type="text/javascript" src="<?php echo base_url() . "assets/pricing_assets/js/scripts.js" ?>"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link href='http://fonts.googleapis.com/css?family=Signika:600,400,300' rel='stylesheet' type='text/css'>
<link href="<?php echo base_url() . "assets/pricing_assets/style.css" ?>" rel="stylesheet" type="text/css" media="screen">
<link href="<?php echo base_url() . "assets/pricing_assets/style-headers.css" ?>" rel="stylesheet" type="text/css" media="screen">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<link href="style-ie.css" rel="stylesheet" type="text/css" media="screen">
<![endif]-->
<?php
}
?>
<!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>-->
<script type="text/javascript" src="<?php echo base_url() ?>assets/uploadify/swfobject.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/jcrop/js/jquery.Jcrop.min.js"/></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/fancybox/jquery.fancybox-1.3.1.js"/></script>
<script type="text/javascript" src="<?php echo base_url() ?>assets/uploadify/jquery.uploadify.v2.1.4.min.js"/></script>
<script src="<?php echo base_url() . 'assets/js/jquery.lightbox_me.js' ?>" type="text/javascript" charset="utf-8"></script>
<!-- Latest FancyBox scripts-->
<!-- Add mousewheel plugin (this is optional) -->
<!-- <script type="text/javascript" src="<?php echo base_url() ?>assets/fancybox-latest/lib/jquery.mousewheel-3.0.6.pack.js"></script>-->
<!-- Add fancyBox -->
<!-- <link rel="stylesheet" href="<?php echo base_url() ?>assets/fancybox-latest/source/jquery.fancybox.css?v=2.1.3" type="text/css" media="screen" />-->
<!-- <script type="text/javascript" src="<?php echo base_url() ?>assets/fancybox-latest/source/jquery.fancybox.pack.js?v=2.1.3"></script>-->
<!-- Optionally add helpers - button, thumbnail and/or media -->
<!-- <link rel="stylesheet" href="<?php echo base_url() ?>assets/fancybox-latest/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />-->
<!-- <script type="text/javascript" src="<?php echo base_url() ?>assets/fancybox-latest/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>-->
<!-- <script type="text/javascript" src="<?php echo base_url() ?>assets/fancybox-latest/source/helpers/jquery.fancybox-media.js?v=1.0.5"></script>-->
<!-- <link rel="stylesheet" href="<?php echo base_url() ?>assets/fancybox-latest/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />-->
<!-- <script type="text/javascript" src="<?php echo base_url() ?>assets/fancybox-latest/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>-->
<!-- Custom ScrollBar Plugin -->
<script defer src="<?php echo base_url() ?>assets/js/jquery.mousewheel.min.js"></script>
<script defer src="<?php echo base_url() ?>assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
<style type="text/css">
#sign_up
{
display:none;
}
</style>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=711713635546066"; // appId must be valid
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="main">
<div id="pageslide">
</div>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="<?php echo base_url() ?>">
<img src="<?php echo base_url() ?>assets/img/CompanyLogo.png" alt="logo"/>
</a>
<div class="btn-login">
<div class="btn-group">
<a target="_blank" href="<?php echo base_url() . $this->session->userdata('interactin_username'); ?>" class="btn btn-primary">
<?php if (isset($user_name) && $user_name != '') { ?>
<i><img style="width: 14px;height: 14px;line-height: 14px;vertical-align: text-top;background-position: -168px 0px;background-repeat: no-repeat;margin: 0px;padding: 0px;" src="<?php echo base_url() ?>assets/uploads/<?php echo $this->session->userdata('interactin_username') ?>/profile_image/<?php echo $this->session->userdata('interactin_profile_image_thumb') ?>" /></i>
View Your Profile
<?php } else { ?>
Welcome <?php echo $name; ?>
<?php } ?>
</a>
</div>
</div>
<a class="btn btn-navbar" data-toggle="collapse" data-target="#navcollapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="sidebar-icon left btn-navbar" href="#nav" style="margin-top:5px;"><span class="icon-white icon-cog" ></span></a>
<div class="nav-collapse" id="navcollapse">
<ul class="nav">
<!-- <li class="active"><a href="<?php echo base_url() ?>">Home</a></li>-->
<li><a href="<?php echo base_url() . 'jobs'; ?>">Job Search</a></li>
<!-- <li><a href="#">About</a></li>-->
<!-- <li><a href="#">Why us?</a></li>-->
<!-- <li><a href="<?php echo base_url() ?>pages/jobs">Jobs</a></li>-->
<!-- <li><a href="<?php echo base_url() ?>pages/events">Events</a></li>-->
<?php
if ($this->session->userdata('interactin_username') != '') {
?>
<!-- <li><a href="<?php echo base_url() ?>pricing">Pricing</a></li>-->
<li><a href="<?php echo base_url() . $header_link; ?>/dashboard">My Dashboard</a></li>
<li><a href="<?php echo base_url(); ?>pages/logout">Logout</a></li>
<?php
} else {
?>
<li><a href="<?php echo base_url(); ?>login">Login</a></li>
<li><a href="<?php echo base_url() . 'register'; ?>">Signup</a></li>
<!-- <li><a href="<?php echo base_url() . 'search/search_load'; ?>">Job Search</a></li>-->
<?php
}
?>
<!-- <li><a href="<?php echo base_url() ?>pages/contact_interactin">Contact us</a></li>-->
</ul>
<input type="hidden" name="base_url" id="base_url" value="<?php echo base_url(); ?>" />
<input type="hidden" name="path_info" id="path_info" value="<?php
$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
echo $url;
?>" />
<?php //echo $_SERVER['REQUEST_URI']; ?>
<?php //echo base_url(); echo " "; $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];echo $url; ?>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
最佳答案
尝试删除带有 <?php
的行完全(以确保任何特殊字符都消失),然后在 ob_start();
之前添加一个额外的换行符这样你就有了:
<?php
ob_start();
$user_name = $this->session->userdata('interactin_username');
$name = '';
关于php - 调用未定义函数 phpob_start(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24128799/
我在 JavaScript 文件中运行 PHP,例如...... var = '';). 我需要使用 JavaScript 来扫描字符串中的 PHP 定界符(打开和关闭 PHP 的 )。 我已经知道使
我希望能够做这样的事情: php --determine-oldest-supported-php-version test.php 并得到这个输出: 7.2 也就是说,php 二进制检查 test.
我正在开发一个目前不使用任何框架的大型 php 站点。我的大问题是,随着时间的推移慢慢尝试将框架融入应用程序是否可取,例如在创建的新部件和更新的旧部件中? 比如所有的页面都是直接通过url服务的,有几
下面是我的源代码,我想在同一页面顶部的另一个 php 脚本中使用位于底部 php 脚本的变量 $r1。我需要一个简单的解决方案来解决这个问题。我想在代码中存在的更新查询中使用该变量。 $name)
我正在制作一个网站,根据不同的情况进行大量 PHP 重定向。就像这样...... header("Location: somesite.com/redirectedpage.php"); 为了安全起见
我有一个旧网站,我的 php 标签从 因为短标签已经显示出安全问题,并且在未来的版本中将不被支持。 关于php - 如何避免在 php 文件中写入
我有一个用 PHP 编写的配置文件,如下所示, 所以我想用PHP开发一个接口(interface),它可以编辑文件值,如$WEBPATH , $ACCOUNTPATH和 const值(value)观
我试图制作一个登录页面来学习基本的PHP,首先我希望我的独立PHP文件存储HTML文件的输入(带有表单),但是当我按下按钮时(触发POST到PHP脚本) )我一直收到令人不愉快的错误。 我已经搜索了S
我正在寻找一种让 PHP 以一种形式打印任意数组的方法,我可以将该数组作为赋值包含在我的(测试)代码中。 print_r 产生例如: Array ( [0] => qsr-part:1285 [1]
这个问题已经有答案了: 已关闭11 年前。 Possible Duplicate: What is the max key size for an array in PHP? 正如标题所说,我想知道
我正在寻找一种让 PHP 以一种形式打印任意数组的方法,我可以将该数组作为赋值包含在我的(测试)代码中。 print_r 产生例如: Array ( [0] => qsr-part:1285 [1]
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 9 年前。 Improve this ques
我在 MySQL 数据库中有一个表,其中存储餐厅在每个工作日和时段提供的菜单。 表结构如下: i_type i_name i_cost i_day i_start i_
我有两页。 test1.php 和 test2.php。 我想做的就是在 test1.php 上点击提交,并将 test2.php 显示在 div 中。这实际上工作正常,但我需要向 test2.php
我得到了这个代码。我想通过textarea更新mysql。我在textarea中回显我的MySQL,但我不知道如何更新它,我应该把所有东西都放进去吗,因为_GET模式没有给我任何东西,我也尝试_GET
首先,我是 php 的新手,所以我仍在努力学习。我在 Wordpress 上创建了一个表单,我想将值插入一个表(data_test 表,我已经管理了),然后从 data_test 表中获取所有列(id
我有以下函数可以清理用户或网址的输入: function SanitizeString($var) { $var=stripslashes($var); $va
我有一个 html 页面,它使用 php 文件查询数据库,然后让用户登录,否则拒绝访问。我遇到的问题是它只是重定向到 php 文件的 url,并且从不对发生的事情提供反馈。这是我第一次使用 html、
我有一个页面充满了指向 pdf 的链接,我想跟踪哪些链接被单击。我以为我可以做如下的事情,但遇到了问题: query($sql); if($result){
我正在使用 从外部文本文件加载 HTML/PHP 代码 $f = fopen($filename, "r"); while ($line = fgets($f, 4096)) { print $l
我是一名优秀的程序员,十分优秀!