Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error Message


glamourfish

Recommended Posts

Posted

Hi people...been struggling with an error message for about 2 weeks now & can't get it sorted!!!

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/g/1/s/g1skatesupply/html/catalog/prizedraw.php:1) in /home/content/g/1/s/g1skatesupply/html/catalog/includes/functions/sessions.php on line 97

 

Seems liek some info is being requested twice from some place & can't figure it out. Anybody willing to take a look at my code for me?

 

I think it has somehting to do with my Java Script for a form validation....

if at first you do succeed...try not to look surprised!

Posted

It means the catalog/prizedraw.php file has an extra space at the beginning or end (usually). Try opening the file, move the cursor to the very end, use the backspace key to backup to the last >, save and upload.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

Thnaks...I've tried that so many times but there doesn't seem to be the extra lines...but as soon as I delete the javascripts it works....But I need them!!! here's the code......if you don't mind looking!!!

 

<script language='JavaScript' type='text/JavaScript'>

<!--

function MM_findObj(n, d) { //v4.01

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);

if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

function MM_validateForm() { //v4.0

var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args);

if (val) { nm=val.name; if ((val=val.value)!="") {

if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';

} else if (test!='R') { num = parseFloat(val);

if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

min=test.substring(8,p); max=test.substring(p+1);

if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }

} if (errors) alert('The following error(s) occurred:\n'+errors);

document.MM_returnValue = (errors == '');

}

//-->

</script>

 

<?php

/*

$Id: prizedraw.php,v 1.22 2003/06/05 23:26:23 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

 

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRIZEDRAW);

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRIZEDRAW));

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top" class="box1"><table border="0" width="100%" cellspacing="0" cellpadding="8">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

</tr>

</table></td>

</tr>

 

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><?php echo TEXT_INFORMATION; ?></td>

</tr>

<tr><td>

 

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="box5">

<tr>

<td>

 

<table width="200" height="310" border="0" cellpadding="0" cellspacing="0">

<tr>

 

<td align="center" valign="top"><img src="images/prizespons.gif" width="150" border="0"></td>

</tr>

</table>

 

 

</td>

<td align="center" valign="top">

 

<form action="thanks.php" " method="post" name="subscribe">

 

<table width="100%" height="310" border="0" cellpadding="4" cellspacing="0">

<tr>

<td width="173" valign="top"></td>

</tr>

<tr>

<td align="center" valign="top"> <table width="245" border="0" cellpadding="2" cellspacing="0">

<tr>

<td colspan="3"><input name="name" type="text" class="form" id="name" value="enter name" size="40"></td>

</tr>

<tr>

<td colspan="3"><input name="email" type="text" class="form" id="email" value="email address" size="40"></td>

</tr>

<tr>

<td colspan="3"> <input name="age" type="text" class="form" id="age" value="age" size="7" maxlength="2"></td>

</tr>

<tr>

<td colspan="3"><input name="brand" type="text" class="form" id="brand" value="favourite brand, e.g: Rukos" size="40"></td>

</tr>

<tr>

<td colspan="3"><input name="shoesize" type="text" class="form" id="shoesize" value="shoe size - UK" size="18"></td>

</tr>

<tr>

<td colspan="3"><input name="address1" type="text" class="form" id="address1" value="Address Line 1" size="40"></td>

</tr>

<tr>

<td colspan="3"><input name="address2" type="text" class="form" id="address2" value="Address Line 2" size="40"></td>

</tr>

<tr>

<td colspan="3"><input name="county" type="text" class="form" id="county" value="County" size="40"></td>

</tr>

<tr>

<td colspan="3"><input name="city" type="text" class="form" id="city" value="City + Post Code if Required" size="40"></td>

</tr>

<tr>

<td colspan="3"><input name="telephone" type="text" class="form" id="telephone" value="Telephone Number (Optional)" size="40"></td>

</tr>

<tr>

<td width="20%"><input name="submit" type="submit" class="submit" id="submit1" onClick="MM_validateForm('name','','R','email','','RisEmail','age','','RisNum','brand','','R','shoesize','','RisNum','address1','','R','city','','R');return document.MM_returnValue" value="send"></td>

<td width="19%"><input name="clear" type="reset" class="submit" id="clear" value="reset"></td>

<td> </td>

</tr>

</table></td>

</tr>

</table>

</form>

 

</td>

<td><table width="100%" height="310" border="0" cellpadding="1" cellspacing="0">

 

<tr>

 

<td width="200" align="center" valign="top"> <img src="images/ENTERNOW.gif" width="200" height="125"> </div>

</td>

</tr>

</table></td>

</tr>

</table>

 

 

</td></tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2">

<tr class="infoBoxContents">

<td></td>

</tr>

</table></td>

</tr>

</table></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

if at first you do succeed...try not to look surprised!

Posted

Thanks Jack...done that too!!! Even copied & pasted the code to create a new file, but nothing works. As soon as I remove the javascript for the form validation it works.....but I really need the form validation.

any other suggestions?? :-"

if at first you do succeed...try not to look surprised!

Posted

place the javascript between the <head> </head> tags as the error messaage is being given as line 1 which may actually be due to the blank line between the javascript and the first <?php tag so move the javascript to be between the head tags and hve the code so as to have <?php as the very first bit of code

 

<?php
/*
$Id: prizedraw.php,v 1.22 2003/06/05 23:26:23 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright ? 2003 osCommerce

Released under the GNU General Public License
*/



require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRIZEDRAW);

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRIZEDRAW));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language='JavaScript' type='text/JavaScript'>
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

YOU ABSOLUTE LEGEND!!!!!

 

thanks so much!!! thought i had tried everything!!! :blush: (except that obviously!)

 

really appreciate the help...nearly gave up on it!!!

 

THANKS AGAIN!!

if at first you do succeed...try not to look surprised!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...