php,routing,routes,laravel,laravel-4View the original page-Collection of common programming errors

UnKnown Error


  • Rachel
    php syntax try-catch 2014-3-6 12:03:57
    I am getting unexpected T_TRY, expecting T_FUNCTION error message and am not sure as too why am getting that, can’t we use try and catch block inside class like this:class Processor {protected $dao;protected $fin;try{public function __construct($file){//Open File for parsing.$this->fin = fopen($file,’w+’) or die(‘Cannot open file’);// Initialize the Repository DAO.$this->dao = new Dao(‘some name’);}public function initiateInserts(){while (($data=fgetcsv($this->fin,5000,”;”))!==FALSE){$i

  • Alkesh
    php html mysql 2014-3-6 12:01:14
    I modified my code and this error doesn’t seem to go no matter what<?php $con = mysql_connect(“localhost”,”root”,””); if (!$con){die(‘Could not connect: ‘ . mysql_error());}mysql_select_db(‘feedback’, $con); isset($_REQUEST[‘submit’]); $sql=”INSERT INTO feedback ( 1Staff, 1subject, 1Rate1, 1Rate2, 1Rate3, 1Rate4, 1Rate5, 2Staff, 2subject, 2Rate1, 2Rate2, 2Rate3, 2Rate4, 2Rate5, 3Staff, 3subject, 3Rate1, 3Rate2, 3Rate3, 3Rate4, 3Rate5, 4Staff, 4subject, 4Rate1, 4Rate2, 4Rate3, 4Rate4, 4Rate5,

  • Andy
    php 2014-3-6 11:58:16
    I’ve got Parse error: syntax error, unexpected T_STRINGand I think it might be somewhere in this line (it’s postdata that i’m using with curl)Is this line causing this error? How do i fix it?

  • Nikola
    php wordpress 2014-3-6 11:52:57
    Please getting following Error while using me wordpress theme on my server can anyone please help out with the reason why this happening.Parse error: syntax error, unexpected T_FUNCTION in /wp-content/themes/BookYourTravel/includes/theme_filters.php on line 1These are code which is mention in that file<?php/** * Remove password email text if option for users to set their own password is enabled in Theme settings. */function remove_password_email_text ( $text ) { $let_users_set_pass = of_get

  • halfer
    php 2014-3-6 11:50:46
    I got this error in the following code:syntax error, unexpected ‘}’ in C:\wamp\www\php\register.php on line 74Please help me fix it.I have this code (error_reporting(E_ALL ^ E_NOTICE);) before the beginning of the script.<html> <head><title>Register | TaproWex</title> </head> <body><?phpif ($_POST[‘register’]){$getuser = $_POST[‘user’];$getemail = $_POST[’email’];$getpass = $_POST[‘pass’];$getretypepass = $_POST[‘retypepass’];if ($getuser){if ($getemail){if

  • nouney
    php syntax-error 2014-3-6 11:49:14
    I dont see what is no good can somebody help me.I hope to hear from you so that i can fix this isseu.this is line 25 use Revolution as Rev;//INTERFACESrequire_once A . I . ‘interface.core.php’;require_once A . I . ‘interface.engine.php’;require_once A . I . ‘interface.users.php’;require_once A . I . ‘interface.template.php’;//TPLrequire_once A . T . I . ‘interface.forms.php’;//HTMLrequire_once A . T . I . ‘interface.html.php’;

  • Kelsey
    php arrays 2014-3-6 11:40:51
    I am getting an error on line 31 on my foreach construct and I don’t know why. I am trying to get the page to check to see if form data is received and if so, it should copy the incoming values to an associative array. If no form data was received, it will display the empty form. A validate function should receive the associative array of data and check to see if all the fields have values. If there are any errors, it will re-display the form with error messages indicating which fields have erro

  • joakim
    php syntax 2014-3-6 11:39:46
    I’m trying to fetch a single row.$con = mysqli_connect(“mydb”, “joakim”, “password”, “db”);$sql = “SELECT *, DATE_FORMAT(dato, ‘%e. %b kl %H:%i’) AS fdato FROM bidrag WHERE bidrag_id = $bidrag_id”;$query = mysqli_query($con, $sql);$row = mysqli_fetch_assoc($query)return $row; <— This lineHowever this makes this error message:Parse error: syntax error, unexpected T_RETURN in /iu/cube/u0/s181322/www/prosjekt/klasser/Bidrag.php on line 51

  • Alex E
    php wordpress 2014-3-6 11:21:17
    This error appears up when activating a modified theme in WordPress:Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\wp-content\themes\manifest_v1.1\functions.php on line 59The functions.php file has been modified to allow “subject” lines to be chosen when posting a comment.Here is the code:<?php $cats=array( 1=>’Category 1′, 2=>’Category 2′, 3=>’Category 3′ );function showCats($cats){?> <select name=”commentCats”> <?php foreach($cats as $key=>$cat)

  • Nanne
    php syntax parse-error 2014-3-6 11:20:43
    HI getting an error Parse error: syntax error, unexpected $end in /home/crafru/public_html/test/damienform.php on line 124<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta content=”en-gb” http-equiv=”Content-Language” /> <meta content=”text/html; charset=utf-8″ http-equiv=”Content-Type” /> <title>Untitled 1</title> <style type=”text/css

  • Anthon
    networking solaris routing load-balancing 2014-3-6 3:57:07
    I’m attempting to use Solaris 11’s ILB to create a loadbalancer across two backend DNS servers. Here’s my requirements:Two external IPs: .XXX.YYY, .XXX.ZZZ – these are the DNS IP’s that our clients hit Two ILB boxes in a HA configuration over those two external IPs Two backend DNS serversI’d like to have the two ILB boxes (ilb1 and ilb2) each load balance across the two DNS servers (ns1 and ns2) on two different incoming IPs. I’d like ilb1 to be primary on .XXX.YYY and secondary on .XXX.ZZZ, a

  • Dominick
    linux networking routing 2014-3-6 0:07:31
    How does Linux determine which network interface to use, when both are connected to the same network?Note that this isn’t a question on routing. I’m familiar with how that works. This is if, say, I have my laptop connected to my wireless router through both my ethernet card and my wireless card, or if I have two ethernet cards both connected to the same router.I can say from experience that in my case, my laptop seems to favor the ethernet card (eth0) over the wireless (eth1–I know that’s not a

  • Nathan Taylor
    asp.net-mvc routing 2014-3-5 13:36:54
    I have a pair of routes that both point to the same action and depending on the supplied route data I would like one route to be chosen over the other. Trouble is, the routing engine seems to be automatically appending route values that I am explicitly telling it not to.routes.MapRoute(“Products_Search_Paged”,”products/search/page{pageNbr}”,new { controller = “Products”, action = “Search” },new { pageNbr = @”\d+” },new[] { “Web.Components.Controllers” } );routes.MapRoute(“Products_Search”,”produ

  • Jeremy Friesner
    routing multicast mld 2014-3-4 13:31:54
    First, a little background: My understanding is that the purpose of IGMP (and its IPv6 cousin, MLD) is to avoid wasted bandwidth by ensuring that multicast packets only get transmitted to destinations that are actually interested in those packets. This logic is a refinement of an older/simpler switch behavior, which was to broadcast incoming multicast packets to all other ports no matter what, and leave it up to the connected devices to drop multicast packets that they weren’t interested in.I

  • curiousguy
    network denial-of-service ip-spoofing routing 2014-3-3 22:33:47
    Is the source IPv4 address lost when a person uses “loose source and record route” and the destination address is put before the end of the list of addresses through which routing should occur?It wasn’t quite clear to me from RFC791 whether the first value on the list should be the source address, or whether the first value on the list should be the first hop.AdditionallySince the routing is “loose”, could it not hypothetically allow an attacker to include neither their own address, nor the addr

  • Celeritas
    sniffer routing wireless ethernet 2014-3-3 22:25:55
    In a large network if there is an Ethernet port in the wall, is it possible to tell if a switch or wireless adapter is plugged into it? (I’m talking about the cheap home routers – with the built in switch). In other words would packets appear different than those coming from a single computer?

  • Kitet
    routing 2014-3-3 21:17:17
    I recently talked with my ISP about many things, basically related to my (little) company security, this guy is a networking guru to me, but he did a strange thing that worries me. Basically I have a web development machine located in my LAN, that has no port forwarding (is not reachable from internet), but he could access a web server on it from outside of router’s WAN interface somehow and wouldn’t tell me how he did it. He just says it’s normal for him, being my provider, to be able to port s

  • Femaref
    ruby-on-rails-3 routing 2014-3-3 6:19:01
    I have the following routingsPosTracker::Application.routes.draw doget “home/index”resources :posresources :apismatch ‘update_data’ => ‘home#update’, :as => :update, :via => :getroot :to => “home#index”endNow, when using the link_to helper method:link_to “text”, pos_path(starbase)I get the following route /pos.13 instead of /pos/13. Obviously, this won’t produce valid output. How can I fix this?Edit: Relevant controller:class PosController < ApplicationController# GET /pos# GET /p

  • JYelton
    avr routing pinout 2014-3-2 20:20:01
    In the following pinout diagram for an ATTINY26 microcontroller, a 20-pin IC:The VCC/AVCC and GND pins aren’t aligned. Surely it would be easier for PCB design to connect these by going straight across rather than having to cross (requiring vias, a second layer, or complex routing).Why would these pins be switched as so?

  • bromanko
    asp.net-mvc routing httpcontext 2014-2-16 3:46:39
    I’d like to be able to generate URLs from a RouteCollection without having access to the HttpContext. Looking at the way RouteCollection is implemented, all methods require access to a RequestContext in order to get the virtual path. I’ve worked around this by mocking the HttpContext but this adds an awkward dependency on RhinoMocks and is not a reasonable solution. Do I have other options for generating Urls outside of context?

  • chris
    php codeigniter routes 2014-3-4 21:47:33
    So, I don’t know how many times I have done similar with code igniter in the past across a handful of sites. However, just getting myself a fresh copy, and starting a rebuild on a new site Im already running into a twisted little issue that I can’t figure out, I don’t know what I am missing in this equation.. So this is my Routes currently:$route[‘default_controller’] = “home”; $route[‘404_override’] = ‘home/unknown’;$route[‘post/(:any)/(:any)’] = ‘post/$1/$2’; //$route[‘post/(:any)’] = ‘post/$1

  • Kuniharu Aramaki
    ruby-on-rails ruby-on-rails-3 routes 2014-3-4 3:12:53
    I have a trouble when I set up some links to groups/:id(groups#show). I would like users to move to groups/:id when there is the existing group on my system and wrote the code below.<% if @existing_groups_isbns.include? i.get(‘ItemAttributes/ISBN’) %><%= link_to ‘???????’, group_path(@existing_groups_ids.each{|id| id}) %>In the first place, I created a group. At that time, it worked.The link was “groups/2”. But the link becomes “groups/2/3” both for the old one and new one when I cre

  • tommyd456
    ruby-on-rails routes ruby-on-rails-4 2014-3-2 5:09:10
    Editing my Rails 4 app routes.rb file and I’m getting unexpected behaviour (unexpected form my point of view anyway).I’m trying to create a link that updates a booking record. I have created an action in my BookingsController called WITHDRAW ready to handle the update process. I would like the link to pass the booking id and my code for the link is this:<%= link_to “Withdraw this booking”, bookings_withdraw_path(@booking), :confirm => “Are you sure you want to withdraw this booking?”, :met

  • glortho
    ruby-on-rails routing routes host sweeper 2014-2-7 1:26:12
    I have a sweeper that reheats cache by opening urls in forked processes. It’s easy enough to hard-code the host for those urls, but I want it to change dynamically, based on environment.I know I can set global/environmental variables for this, but I’d really like to use named routes. Is there any way to do this?(I should clarify that I’ve tried just putting the named routes in there but they don’t resolve at runtime.)

  • olivier
    ruby-on-rails-3 routing routes 2014-2-6 2:54:22
    I have a set of pages with public attribute. I want the routes file handle dynamic routes but only for public pages.I currently have the following, but there is no restriction, all pages are visible. What I’d like is go to page only if page is public else raise 404.Page.public.each do |page|get “/:slug”, controller: ‘pages’, action: ‘show’ if page.public? end

  • flurdy
    playframework routes playframework-2.0 static-files 2014-2-2 8:53:14
    I’m trying to make a route to a specific static file but everything I’m trying ends with an error.I’ve made 3 different attempts:1.GET /file staticFile:/public/html/file.htmlThe error I get:Compilation error string matching regex `\z’ expected but `:’ found2.GET /file controllers.Assets.at(path=”/public/html”, “file.html”)The error I get:Compilation error Identifier expected3.GET /file controllers.Assets.at(path=”/public/html”, file=”file.html”)The error I get: (and this is the weirdest)Co

  • ThinkingStiff

  • j4y
    ruby-on-rails grails mvc routes grails-2.0 2014-1-29 8:55:08
    Is there an equivalent to the Rails command/feature “rake routes” for Grails?I have many routes in my current application and would like to get a better understanding of them to solve a few issues.

  • mikej
    ruby-on-rails routes named-routing 2014-1-25 22:07:11
    is it possible to have the controller value in a rails named route as a parameter, which I can pass at runtime to direct the call to the proper controller?e.g. map.ride ‘ride’ ,:controller => {some-way-of-specifying-a-parameter}, :action => ‘ride’then at runtime, I want to pass the controller name to which this call should be going. My actions are doing different things depending to which controller the call gets sent. thanks

  • veilsoen
    junit mocking routes integration apache-camel 2014-1-25 20:51:07
    Let’s say I have my routes created in separate RouteBuilder class. It looks like:grab message from JMS queue do some transformation, validation etc depending on validation results forward to specific JMS queue and save something in DB I’d like to unit test this route with no JMS broker and no DB. I know I can mock my Processor implementations but that’s not enough. I don’t want to change this route (let’s suppose I got that class in jar file). As far as I know from Camel in Action (sec. 6.2.6),

  • duality_
    laravel laravel-4 2014-3-6 9:13:29
    When I run php artisan list in my production environment (Debian Linux, private server), I get the following error:Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /home/user/app/artisan on line 46Parse error: syntax error, unexpected T_STRING in /home/user/app/artisan on line 46Why is that and how can I fix this?

  • coryj
    javascript json laravel blueimp jquery-file-upload 2014-3-5 17:48:14
    I set up this multiple file upload plugin (https://github.com/blueimp/jQuery-File-Upload) on my local machine (mac osx default server). Everything is working perfectly, when I upload an image I get back this response[{ “name”:”subaru-wrx-poster-i3(1).jpg”, “size”:142583,”type”:”image\/jpeg”, “url”:”http:\/\/shipwatchpointe.dev\/bundles\/jupload\/uploads\/files\/52\/subaru-wrx-poster-i3%20%281%29.jpg”, “thumbnail_url”:”http:\/\/shipwatchpointe.dev\/bundles\/jupload\/uploads\/thumbnails\/52\

  • Dylan Pierce
    php laravel laravel-4 2014-3-3 11:39:03
    I’m using the wkhtml2pdf package with Laravel 4.http://packalyst.com/packages/package/nitmedia/wkhtml2pdfI have it installed and configured correctly for my machine (ubuntu server 12.04 running on a amd64 processor). My test action looks like this:<?php class PDFController extends BaseController { public function handleConvert() {return PDF::html(‘Test.view’); }} ?>The error I receive when running this action is this: http://puu.sh/6hreq.pngI have debugging turned on in the package, but I’m n

  • Chris Till
    php laravel syntax-error 2014-3-3 2:45:20
    I have a laravel 4 web app using a third party package. It worked fine on my localhost but i’ve uploaded it to appfog and it’s throwing the following error in the thirdparty plugin:syntax error, unexpected ‘{‘, expecting T_STRING or T_VARIABLE or ‘$’Somewhere on this line: Mail::{$mailMethod}(Config::get(‘saasframe::email.view’), (array)$subscription, function($message) use ($user)You can view the full error details here:chris-till-staging-app.eu01.aws.af.cm

  • gturri
    php laravel 2014-3-3 2:29:01
    I’m trying to run an if statement inside of an array. The array is used to update a database table row. However I have a couple of questions regarding this.1)I get the error syntax error, unexpected ‘=>’ when doing something similar to the below:[‘column1’ => ‘some data’,($var === true ? ‘column2’ => ‘another column’, : ”) ]So if this can work using the =>, my other question is:2)If $var === false, then won’t this fail too because it will be trying to insert ” into the array? Not too

  • r4.
    php parsing laravel 2014-3-2 16:09:26
    Php complains thatPHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘)’ in /home/edler2/www/blog/application/config/database.php on line 74It seems plain wrong, and now I’m stuck…/config/database.php looks like this.70 ‘mysql’ => array( 71 ‘driver’ => ‘mysql’, 72 ‘host’ => ‘localhost’, 73 ‘database’ => ‘blogtest’ 74 ‘username’ => ‘root’, 75 ‘password’ => ‘xxxxx’, 76 ‘charset’ => ‘utf8’, 77 ‘prefix’

  • samayres1992
    php laravel laravel-4 2014-3-2 14:45:54
    I’m getting an error on the following on:$user->email = Input::get(’email’);I’m really unsure what is wrong with the code, it seems perfectly fine. I looked up t variable errors, simply involve missing a bracket or semi colon. But as far as I’m aware it seems fine. If anyone could help me out, that would be great. If there is any other code, could you list it as a comment and i’ll happily add it. Thanks!public function doRegister() {$rules = array(‘name’ => ‘required|min:3’, // na

  • michaelcurry
    php nginx laravel php-fpm 2014-3-2 3:43:49
    Never had this happen before, but here we go:Any Ideas ?Running php-fpm 5.3 ubuntu 12.04Looks as if the comment is NOT working …

  • majimboo
    php laravel 2014-2-12 10:56:05
    It seems like Profiler is not with Laravel 4 anymore. What is the best way to know how long all the queries on the function took to execute? I wanted to compare 2 different codes of the same function and see which approach is faster. Eloquent VS Query Builder.

  • user1746582
    jquery file-upload directory laravel 2014-2-11 20:56:41
    I am using the Jquery file upload plugin, in particular this one: http://bundles.laravel.com/bundle/jUploadI wish to be able to set the upload_dir differently for different web pages. Is this possible? If so, how can I set upload_dir based on different web page requirements?It is currently set in settings.php though these values are shared across the plugin (which am sure is the purpose).upload_dir = ‘/users/folder1/files.txt’; //web page 1 upload_dir = ‘/users/folder2/files.txt’; //web page 2an

  • duality_
    laravel laravel-4 2014-3-6 9:13:29
    When I run php artisan list in my production environment (Debian Linux, private server), I get the following error:Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /home/user/app/artisan on line 46Parse error: syntax error, unexpected T_STRING in /home/user/app/artisan on line 46Why is that and how can I fix this?

  • Dylan Pierce
    php laravel laravel-4 2014-3-3 11:39:03
    I’m using the wkhtml2pdf package with Laravel 4.http://packalyst.com/packages/package/nitmedia/wkhtml2pdfI have it installed and configured correctly for my machine (ubuntu server 12.04 running on a amd64 processor). My test action looks like this:<?php class PDFController extends BaseController { public function handleConvert() {return PDF::html(‘Test.view’); }} ?>The error I receive when running this action is this: http://puu.sh/6hreq.pngI have debugging turned on in the package, but I’m n

  • samayres1992
    php laravel laravel-4 2014-3-2 14:45:54
    I’m getting an error on the following on:$user->email = Input::get(’email’);I’m really unsure what is wrong with the code, it seems perfectly fine. I looked up t variable errors, simply involve missing a bracket or semi colon. But as far as I’m aware it seems fine. If anyone could help me out, that would be great. If there is any other code, could you list it as a comment and i’ll happily add it. Thanks!public function doRegister() {$rules = array(‘name’ => ‘required|min:3’, // na

  • Antonio Carlos Ribeiro
    php laravel laravel-4 2014-2-11 12:23:44
    I have a problem I have a class which calls another class and its methods via objects. I’m creating and duplicationing the same code to create the object in every method. Is there a way to create the object in once place and have all the class methods use that same instance?

  • Antonio Carlos Ribeiro
    git laravel laravel-4 composer-php 2014-2-7 1:28:17
    I’m working on a Laravel 4 project. When I try to update my packages with Composer, it gets to doctrine/collections but then throws this error:[Runtime Exception] Failed to execute git status –porcelain –untracked-files=noerror: bad index file sha1 signature fatal: index file corruptException trace: http://pastebin.com/Js3nKrhyI tried removing the index in doctrine/collections but then I it tells me the format is incorrect in refs/remotes/origin/master.Any idea how to solve this issue? Thank

  • Mike Holler
    laravel laravel-4 2014-2-4 7:48:53
    Can anybody explain session drivers to me? A search on “laravel session drivers” revealed nothing about the different types. I ask because the following tutorial suggested using an array driver for a REST API, but I don’t know why. Tutorial: https://speakerdeck.com/akuzemchak/simple-api-development-with-laravel?slide=62Here’s the relevant section from app/config/session.php/* |————————————————————————– | Default Session Driver |——————-

  • Manuel Pedrera
    php laravel-4 eloquent 2014-1-31 21:48:37
    Having one Eloquent model, is it possible to get all its relationships and their type at runtime? I’ve tried taking a look at ReflectionClass, but I couldn’t find anything useful for this scenario.For example, if we have the classic Post model, is there a way to extract relationships like this?- belongsTo: User – belongsToMany: Tag

  • Antonio Carlos Ribeiro
    laravel laravel-4 2014-1-28 12:41:33
    Can I enable more than one driver for storage. For example could I enable native driver which is already enabled and also have cookies enabled. I’m creating a package that I want to give that option.

  • bitinn
    php dependency-injection laravel laravel-4 2014-1-15 15:29:21
    On first thought, this may seem unnecessary, as we have defined providers in config/app.php to autoload any ServiceProvider, but it turns out there is a scenario where they will NOT be autoloaded:When we run a job from Laravel Queue – it would seem my ServiceProvider in config are ignore completely, so DI failed with target … is not instantiable.Register my service providers at runtime in the job does work. e.g. App::register(‘MyServiceProvider’);Is there a reason that Laravel did not autoload

  • MMacdonald
    php laravel laravel-4 2014-1-14 16:01:11
    In Laravel 3 I could set the database ‘fetch’ config at runtime (to get the results as an array rather than an object):Config::set(‘database.fetch’, PDO::FETCH_ASSOC);In Laravel 4, the result is still being returned as an object.What am I doing wrong?[Edit – extra details]I decided to test if the config was being set, and also to try identical code segments in Laravel 3 and Laravel 4 side-by-side.//first fetch as object Config::set(‘database.fetch’, PDO::FETCH_CLASS); //Laravel 3 and 4 returns 8