-1
I am trying to create a simple MVC system in which I have the following folder structure:
Arquivos de Código-Fonte - Pasta
Servlet - Pasta
UserServlet.class.php
Controller - Pasta
UserController.class.php
Model - Pasta
DAO - Pasta
UserDAO.class.php
VO - Pasta
UserVO.class.php
View - Pasta
userForm.php
index.php
I need to make mine index.php
call the class Servlet
, for that I put the following code:
<?php
header('Location : Servlet/UserServlet.class.php?action=goHome');
?>
But the problem is that nothing happens and I need to call the class Servlet
for in which I will handle which method I will use. If anyone knows a solution, a way for me to be able to make an HTTP request at Servlet
will help me a lot.
Does it give any error ? Note that calling the function
header
cannot be done after it has been written html on the page, otherwise it will not work.– Isac
Are you just declaring the class or also instantiating it in the script itself? because if you said the operation is not executed, I imagine you wait for the script to do something, then there must be the class instance
Servlet
being called there...– Wallace Maxters
You want to call the class to work with it or redirect the page to the class?
– Luiz Augusto Neto