Forum Moderators: coopster

Message Too Old, No Replies

code works in firefox not in ie

page errors in ie but fine in firefox

         

weddingm

11:20 pm on Jul 30, 2009 (gmt 0)

10+ Year Member



I cannot figure out why the below code works in firefox but not in ie. please help

header("Cache-Control:no-cache");
$sample1=$_COOKIE['sample1'];
$sample2=$_COOKIE[sample2];
$from = getenv("HTTP_REFERER");
require(sample.inc.php');
$i = 0;
$result = @mysql_query("SELECT * FROM table WHERE Username = \"$sample1\" and Password = \"$sample2\"");
while( $row = @mysql_fetch_array($result) ) {
++$i;
}
if($i < 1)
{ echo ("You must first become a member."); exit();}

I always get the message in ie but not in firefox.

eelixduppy

1:27 am on Jul 31, 2009 (gmt 0)



What kind of errors are you getting that you mentioned in your subtitle? Can you post them here please.

Btw, if you do not want the page to cache, your headers should look something like this:


header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

weddingm

2:47 am on Jul 31, 2009 (gmt 0)

10+ Year Member



Sorry for the waste of time. I figures it out that I was not logging in/out properly.

eelixduppy

3:02 am on Jul 31, 2009 (gmt 0)



Cool, glad you sorted everything out. But take my advice on the no-cache headers. You want them to look like mine.

weddingm

3:17 am on Jul 31, 2009 (gmt 0)

10+ Year Member



ok, thanks

weddingm

8:16 pm on Aug 1, 2009 (gmt 0)

10+ Year Member



Ok, now I have the same problem with a different web page. Can anyone help with correcting this code?

$num=$_POST["num"]; 
$go_up=0;
$checkednum=0;
$inputs="";
while($go_up<$num){
$go_up++;
$check_field_name="check".$go_up;
if(isset($_POST[$check_field_name])){
$value=$_POST[$check_field_name];
$checkednum++;
//display names:
$ex=explode("_toexplode_",$value);
$businessname=$ex[0];
$names.='<br>* '.$businessname;

$inputs.='<input type=hidden name='."$check_field_name".' value="'."$value".'" >';
}

}
if ($checkednum==0 )
{$msg="<h3 align='center'>You must select a vendor to email in order to access this web page.2</h3>";
echo $msg;
exit();}