Problem inserting an array into another array |
[eluser]markanderson993[/eluser]
I am creating a registration script to work with Codeigniter, however I cannot seem to be able to insert an array into another array. How can I insert the $errors array into the $data array being passed along to the html page? Code: <?php // home.php (Class) ** Note: the global command will be used in the next step of developing this application ** Code: <?php
[eluser]Aea[/eluser]
Code: $data['errors'] = $errors But do note that you aren't treating $errors like an array but rather as a string, your code should look like... Code: if ( (empty($_POST['email'])) || (empty($_POST['conf_email'])) )
[eluser]markanderson993[/eluser]
Wow! Aea i've been pulling my hair out for past 3 hours trying to make this work! Thank you so much
[eluser]markanderson993[/eluser]
Alright the script is nearing completion however, when the script is executed I get a headers already sent error Here is my code: What am I doing wrong to deserve such a painfully annoying error??! Also, there are various session classes that can make your redux auth even more secure. After reading the posts on http://ellislab.com/forums/viewthread/72...20/#408551 I tried to use the code provided under some of the links such as DB2. Where am I supposed to install these scripts and how do i configure them to work with codeigniter? Code: <?php // home.php (Class) Code: <?php if(isset($errors)): ?>
[eluser]Aea[/eluser]
If you're using the output class you shouldn't be echo/printing anything within your code.
[eluser]markanderson993[/eluser]
Where am I using the output class? Can I change it to allow me to echo/print anything after my code?
[eluser]Aea[/eluser]
Err sorry, low on Caffeine at the moment Usually that error crops up if you're utilizing the output class, see: http://ellislab.com/codeigniter/user-gui...utput.html
[eluser]markanderson993[/eluser]
I'm still having a heck of time finding where I'm using the output class :/ I checked Google for this error and didn't find any results so this error must be unique to the code written above. Can anyone point out where I am making an error and post the code to fix it? Also, my question about installing a more secure session class is still on the table. If anyone knows a helpful tutorial on how to use a DB2 class instead of the original session class in CodeIgniter, please post.
[eluser]charlie spider[/eluser]
you've got an echo in your controller: echo 'Congratulations you have been successfully registered!'; which is being executed prior to any view being loaded. load your success message into a variable that is echo'd from your register_view page, or create a registration_success_view page and display your success message there.
[eluser]markanderson993[/eluser]
Thanks for the reply. Alright so I changed my code at the bottom. Problem is, I'm still getting the error. Code: <?php // home.php (Class) |
Welcome Guest, Not a member yet? Register Sign In |