I just tried it and put an echo statement with $tutorialid right after the command I tried above. It 44 showed up on the screen...
Heres all the code if that might helpmy case...
<?
include("connect.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM tutorialtemp WHERE tutorialid='$tutorialid'";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$demopic=mysql_result($result,$i,"demopic");
echo "
<br><br><br>$demopic<br><br><br><br><br><br>
";
++$i;
}
$usernamer="demopic";
$max_upload="500000"; // maximum file size server will accept
$host="http://www.surefiretutorials.com/tutorials/"; $tmp_upload_path = "/tmp/"; // for linux/apache
$final_location="/home/surefire/www/www/tutorials/$tutorialid/";
echo "$tutorialid";
// --------------------------------------------------
//$run="local" ; // comment this out to accept the above remote server default values
if ($run=="local") {
//this is added for local testing only
// to test this on a local server, modify variables below
$tmp_upload_path = "C:\\TEMP\\"; // for windows (verify in php.ini)
$final_location="w:\\g1c\\tekhelp\\"; // change these to your values
}
if ($submitted){ //----Main Engine----------------
if ( $userfile == "none" ) {
$error_msg = "<p>Your Upload was not accepted.<br> Verify that file size is < $MAX_FILE_SIZE bytes and that the file you specified exists. </p>";
} // end if for usefile none
else {
// remove this if you are copying this script. This was added for demo purposes only to prevent an unlimited number of files being saved
// make the following an upload.inc file require("upload.inc"); // upload the file
//----------------------------------------
//-----Start upload.inc-------------
//----------------------------------------
//$userfile_name is the name of the file when it was on the client
$clients_file_name = $userfile_name;
//$userfile is the full path of the temporary server file. The name is
// random and exists for the duration of the script only
$temp_file_name= basename($userfile);
// extract file extension of uploaded file
$arr_basename=explode(".",$clients_file_name);
$file_type=$arr_basename[1];
if (($file_type=="jpg") || ($file_type=="jpg")){
//allow upload only for txt and gif types
$new_file_name=$usernamer.".".$file_type;
$temp_full_path=$userfile;
$final_full_path=$final_location.$new_file_name;
if (!copy($temp_full_path, $final_full_path)) {
$error_msg = "failed to copy $file...
\n";
} // end if
} // end file type check
else { $error_msg= " Upload Failed - .jpg pictures only. <br> " ; }
//----------------------------------------
//-----End upload.inc-------------
//----------------------------------------
} // end else
} // -------------End Engine -Started on if $submitted--------------------
?>
<!-- -------- FORM ------------------------- -->
<FORM ENCTYPE="multipart/form-data" ACTION="
<? echo "$PHP_SELF"; ?>?authid=<? echo "$authid" ?>
"
method="POST">
<br>
<input type="hidden" name="submitted" value="true" >
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="
<? echo"$max_upload" ; ?>
">
Replace Picture With: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Upload Picture">
</FORM>
<?
if ( ($submitted) && ($error_msg) ) {
echo "<B> $error_msg </B>";
}
elseif ($submitted) {
if ($run==local){$destination=$final_full_path;}
else {$destination=$host.basename($final_full_path);}
?> File upload successful! <br><form action="submitpicture.php?authid=<? echo "$authid" ?>" method=post> <input type=hidden name="ud_picture" value="<img src=tutorials/<? echo "$tutorialid" ?>/<? echo "$new_file_name" ?>>">
<input type="submit" value="Submit for Authorization">
</form><?
}
?>
Your picture will have to be approved before it is posted on the site. After clicking "upload picture you will have the option of submitting it for approval. <br><br> Upon clicking "upload picture" your current picture will be deleted. <br><br><br><br><br><br><br>
Thanks for the response by the way:-)