after i enable my custom profile field validation module which is
the .info file is
; $Id$
name = Custom Helper Functions
description = A module to add custom form handling for my site.
package = Helpers
core = 6.x
and the .module file is
// $Id$
function sitehelper_form_alter(&$form, $form_state, $form_id) {
//intercept user_register and user_edit forms and add validation function for edad
if ($form_id == 'user_register' || $form_id == 'user_edit') {
$form['Educational Information']['profile_class']['#element_validate'] = array('sitehelper_profile_edad_validate');
$form['Educational Information']['profile_branch']['#element_validate'] = array('sitehelper2_profile_edad_validate');
$form['Terms And Conditions']['profile_terms']['#element_validate'] = array('sitehelper3_profile_edad_validate');
$form['Educational Information']['profile_location']['#element_validate'] = array('sitehelper4_profile_edad_validate');
}
}
function sitehelper_profile_edad_validate ($element) {
if ($element['#value'] == "<---->") {
form_set_error('profile_edad', t('Please select the appropriate class'));
}
}
function sitehelper2_profile_edad_validate ($element) {
if ($element['#value'] == "<---Choose--->" || $element['#value'] == "<----Medicine--->" || $element['#value'] == "<---Engineering--->" || $element['#value'] == "<---Business--->") {
form_set_error('profile_edad', t('Please select the appropriate department'));
}
}
function sitehelper3_profile_edad_validate ($element) {
if ($element['#value'] == "0") {
form_set_error('profile_edad', t('You need to accept the terms and conditions including the privacy policy before using the services of this site.'));
}
}
function sitehelper4_profile_edad_validate ($element) {
if ($element['#value'] == "<---Choose--->") {
form_set_error('profile_edad', t('Please select the location of your present institution.'));
}
}
it gives me this warning,
------------------------------------------------------------
wwarning: Cannot modify header information - headers already sent by (output started at /home/content/a/s/s/mysite/html/modules/Form validation/sitehelper.module:2) in /home/content/a/s/s/mysite/html/includes/session.inc on line 97.
warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /home/content/a/s/s/mysite/html/includes/session.inc on line 100.
mysite= the name of my site.
----------------------------------------------------------
this happened when i tested my site in godaddy, this warning message comes after i login. And to go to my homepage i need to refresh.
for example, if i login into my site using user name and password it doesnt open, it shows a blank white page, and after i refresh it goes to my home page- then on the main screen i get the above warning.
it was working fine on my localhost. what could be the problem?
Comments
Check if there is any white
Check if there is any white space or empty lines after the closing
?>tag in your module. Or just remove the closing?>tag. (This is what all core modules do).---- Edited to add:
Looking at your error message more closely, this is about sitehelper.module, line 2. Check if there is whitespace outside php tags or any direct output there.
Thank YOu so Much
THANK YOU SO MUCH, THE PROBLEM WAS WITH THE WHITESPACE.
MAN U ARE GOD TO ME:)
never thought such a small thing would cause a big problem.