Posted by mantrid on 10/22/06 00:23
"peter" <submit@flexiwebhost.com> wrote in message
news:ehe92r$ps7$1@aioe.org...
>
> > That has thrown up lots of notices, most of which are of the type:
> > Notice: Use of undefined constant archivequest - assumed 'archivequest'
in
> > ......
> >
> > seems to be picking up all my variables ie in the above example
> > $archivequest do you know how to clear these type of notices?
>
> had a quick look over your code and the reason for those errors are as
> follows:-
>
> you have lines such as:-
>
> $archivequest=$_SESSION[archivequest];
>
> it should be:-
>
> $archivequest=$_SESSION['archivequest'];
>
> because you do not have the quotes around them it is assuming they are
> constants but as no constant is there it is using it as a string. This
will
> not always be the desired effect. Try and work with the error reporting
> level that I already mentioned and it will cut down on alot of possible
bugs
> in your code.
>
>
That seems to have done it all except these ones
Notice: Undefined index: cancel in
/home/iddsoftw/public_html/questiondbase/questionupdate.php on line 11
Warning: Cannot modify header information - headers already sent by (output
started at /home/iddsoftw/public_html/questiondbase/questionupdate.php:11)
in /home/iddsoftw/public_html/questiondbase/questionupdate.php on line 17
refering to the top of my page (below)
<?php
session_start();
error_reporting(E_ALL); //show all errors
ini_set( "session.bug_compat_warn", "off" );
if(!isset($_SESSION['userid'])){
header("Location: http://www.site.co.uk/forbidden.html");
}
$cancel=$_POST['cancel'];
if(isset($cancel)){
header("Location: http://www.site.co.uk/path/my.php");
}else{
header("Cache-control: private"); //IE 6 Fix
include("../include/idd.php");
?>
<html>
<head>
<link href="../CSS/body.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
$userid=$_SESSION['userid'];
$delquest=$_SESSION['delquest'];
$archivequest=$_SESSION['archivequest'];
$changedquests=$_SESSION['changed'];
$questids=$_SESSION['questids'];
$imagechanged=$_SESSION['imagechanged'];
$delimage=$_SESSION['delimage'];
$msg=$_SESSION['msg'];
$uploadedfile=$_SESSION['uploadedfile'];
$imagepath=$_SESSION['imagepath'];
$questuserid=$_SESSION['questuserid'];
$imagequestindex=$_SESSION['imagequestindex'];
$targetdir = "pupiltester/";
$tempdir= "temp/";
CODE HERE
unset($_SESSION['delquest']);
unset($_SESSION['archivequest']);
unset($_SESSION['changed']);
unset($_SESSION['questids']);
unset($_SESSION['iseditable']);
unset($_SESSION['imagechanged']);
unset($_SESSION['uploadedfile']);
unset($_SESSION['cost']);
unset($_SESSION['question']);
unset($_SESSION['opta']);
unset($_SESSION['optb']);
unset($_SESSION['optc']);
unset($_SESSION['optd']);
unset($_SESSION['opte']);
unset($_SESSION['ans1']);
unset($_SESSION['ans2']);
unset($_SESSION['ans3']);
unset($_SESSION['ans4']);
unset($_SESSION['ans5']);
unset($_SESSION['ans6']);
unset($_SESSION['ans7']);
unset($_SESSION['ans8']);
unset($_SESSION['ans9']);
unset($_SESSION['ans10']);
unset($_SESSION['msg']);
unset($_SESSION['delimage']);
unset($_SESSION['imagepath']);
unset($_SESSION['imagequestindex']);
?>
</body>
</html>
<?php
}
?>
[Back to original message]
|