Problem with codeigniter registration

Asked

Viewed 237 times

1

I have a course site made with codeigniter and an error is occurring, when I sign up for a specific address, in case, this http://www.cursosnet.com.br/site/cadastrar/8/0/13732 instead of the data being included in the database, returns the following error, for example:


An Error Was Encountered

Error Number: 1054

Unknown column 'redirect' in 'field list'

INSERT INTO `usuarios` (`nome`, `estado`, `cidade`, `pais`, `cep`, `endereco`, `numero`, `bairro`, `telefone`, `como_conheceu`, `email`, `senha`, `redirect`, `data_cadastro_usuario`, `valido`, `hashing`) VALUES ('Cadastro de Testes', 'MG', 'Montes Claros', 'Brasil', '39404000', 'Endereço de teste', '104A', 'Bairro de teste', '3899999999', 'nao sei', '[email protected]', '123456', 'site/curso_matricular/13732', '2015-03-20', 'Sim', 'puowqxalnce8jsh6e5swfcte244rpl3gmixwb65mb1187kj42m1nkwv2pvpizvb5gfh2apllzjr5n3v23mvwb1iny26qyfrlnc30')

But only when it is registered by this address. What may be occurring?

  • Checks if your table has a column, "redirect" and checks that it is written correctly!

2 answers

1

Make sure you really have the column redirect on your table of usuarios. You are probably using a different controller to register when the user is registering from a course.

From what I understand you want to create a kind of redirect after the registration confirmation. If this is really your wish try using a PHP Session to store the redirect location and then use a Helperof URL's of Code Igniter itself as the:

 redirect($_SESSION['redirect_curso'], 'refresh');

For more information see the documentation in this link and to better understand how to redirect link.

0

Probably your PHP script is erroneously adding "redirect" as a select column, and that column does not exist in the table users in the database.

Just you fix that part of the script that error will not happen anymore.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.