Tag Archives: view

.htaccess php Rewrite view.php?visopslag=(id)

Questions: I have to rewrite www.url.com/opslag/view.php?visopslag=(id) with htaccess to something more beautiful :o) Im creating a forum likely application. This is what i want to be rewrote: My request is: www.url.com/opslag/vis/id How can I do this? I’ve tried lots of different things like: RewriteRule ^/opslag/([^/\.]+)/?$ view.php?vis=$1 [L] My complete .htaccess: RewriteEngine On “#Rewrite view.php?vis=id RewriteRule… Read More »

Encrypt html code in source view

Questions: I am using an video embed code (Similar to youtube’s embed code) and I would like to Encrypt or hash a part of the code (The Video id or filename of the video). It is important to me that a user that views the source code of the page wont be able to view… Read More »

Use carbon on Views laravel

Questions: I want to use the Carbon on Views I’m including it on the top of the views file but it doesnt work, I’m doing it like this. <?php use carbon/carbon;?> @extends(‘main_layout’) @foreach ($myquery as $mytask) <tr> <td > {{($mytask->firstname)}} </td> <td > {{($mytask->lastname)}} </td> <td> {{($mytask->logon)}} </td> @section(‘content’) @stop I just get errors. I… Read More »

Interview Question: Can we have an echo before header?

Questions: I appeared for php test, their I was asked one question for which I could not find the answer. The question is like this. echo “MESSI is injured!!”; header(“Location:somepage.php”); Interviewer want both header and echo to be written on the same page. I wonder how’s it possible.It should give some error like headers already… Read More »

zf2 Creation of simple service and access it through viewhelper

Questions: I am trying to create a simple service in zf2 which I can access using in viewhelper Step1. I have craeted a class in src/Application/Service/Service1.php as follow namespace Application\Service; use Zend\ServiceManager\ServiceLocatorAwareInterface; use Zend\ServiceManager\ServiceLocatorInterface; class Service1 implements ServiceLocatorAwareInterface { public function __construct() { } public function setServiceLocator(ServiceLocatorInterface $serviceLocator) { } public function getServiceLocator() { }… Read More »