Item page PHP

Just use angularjs and setup all routing,
then just pass $routeParams to a controller,
in the controller get the id,
from there inject your service,
query the service,
get the items,
profit?
 
@cbrunsdonza - I Stand to be corrected (I'm not a pro at this)
But most hosting providers servers are set not allow you to use header to redirect to another page when the page has already returned HTML code.
If you try it normally gives you
PHP:
Warning: Cannot modify header information - headers already sent by Bla bla bla

It works on WAMP though.

Maybe its an attempt to save recources

This is true for Apache and not just limited to hosting providers. This is why its important to remember to execute your header code before any screen / html output else you get the error message as mention in your post.

It has to do with how the whole html page is deliver to the user, the first part is the headers, the second part is the html code and this is why you cannot set headers afterwards.
 
Come here and collect your slap !!!!

That is the worst code in the world. You never ever do a redirect header call without an exit/die afterwards else you will still execute the remaining PHP code. I've seen "professional" development companies do this on form submissions and cannot understand why their code still executes.


Code:
if(!isset($_GET['id']))
{ 
  header("location: index.php"); 
[B]  die(); // or use exit;
[/B]}
Oi Vey!

I do use it. I was typing from my phone and missed it -_-
 
Top
Sign up to the MyBroadband newsletter
X