Pure PHP Upload 2 Support Product Page

This topic was archived

File name not uploading

Reported 13 Mar 2003 21:49:22
1
has this problem
13 Mar 2003 21:49:22 Jeff Parsons posted:
I am trying PHP Upload. Uploads files no problem. However, it doesnt post the name of the file into the database.

I am using a mysql database with a longtext field. The file upload is part of a more general registration process. All other fields post except the file name. If I set the database field to not accept null data, I get an error saying it cant take null data (indicating nothing is getting sent to the database).

Edited by - kdeveron on 13 Mar 2003 21:54:56

Replies

Replied 14 Mar 2003 09:26:03
14 Mar 2003 09:26:03 Martha Graham replied:
Did you take a look at the tutorial under the help button in the UI?

Martha Graham
Replied 14 Mar 2003 14:54:02
14 Mar 2003 14:54:02 Jeff Parsons replied:
Yes I did. I confirmed the insert record settings. Everything looks great, and works, except it refuses to post the file name to the database.

The URL is www.familybeacon.org/memberregistration.php

Here's a copy of the php code at the top of the page. There are some non-php upload elemenets related to my login system as well.

<?php
// Buzz inet PLS02 - Login and Set Level
// Start Session Support
session_start();
?>
<?php require_once('Connections/conn_familybeacon.php'); ?>
<?php
// Buzz inet PHPLS06 - User Details
session_start();

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "" ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "" ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "" ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}

if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "userregistration") {
$insertSQL = sprintf("INSERT INTO members (username, password, firstname, lastname, email, hobbies, photo, joindate, birthdate, sex, instantmessengertype, instantmessengername, website, familyid) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['rusername'], "text",
GetSQLValueString($HTTP_POST_VARS['rpassword'], "text",
GetSQLValueString($HTTP_POST_VARS['firstname'], "text",
GetSQLValueString($HTTP_POST_VARS['lastname'], "text",
GetSQLValueString($HTTP_POST_VARS['email'], "text",
GetSQLValueString($HTTP_POST_VARS['hobbies'], "text",
GetSQLValueString($HTTP_POST_VARS['photo2'], "text",
GetSQLValueString($HTTP_POST_VARS['joindate'], "date",
GetSQLValueString($HTTP_POST_VARS['birthdate'], "date",
GetSQLValueString($HTTP_POST_VARS['Sex'], "text",
GetSQLValueString($HTTP_POST_VARS['imtype'], "text",
GetSQLValueString($HTTP_POST_VARS['imname'], "text",
GetSQLValueString($HTTP_POST_VARS['website'], "text",
GetSQLValueString($HTTP_POST_VARS['familyid'], "int");

mysql_select_db($database_conn_familybeacon, $conn_familybeacon);
$Result1 = mysql_query($insertSQL, $conn_familybeacon) or die(mysql_error());

$insertGoTo = "index.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

$varSearch_rsUserDetails = "1";
if (isset($HTTP_SESSION_VARS['fbuser'])) {
$varSearch_rsUserDetails = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['fbuser'] : addslashes($HTTP_SESSION_VARS['fbuser']);
}
mysql_select_db($database_conn_familybeacon, $conn_familybeacon);
$query_rsUserDetails = sprintf("SELECT * FROM members WHERE username = '%s'", $varSearch_rsUserDetails);
$rsUserDetails = mysql_query($query_rsUserDetails, $conn_familybeacon) or die(mysql_error());
$row_rsUserDetails = mysql_fetch_assoc($rsUserDetails);
$totalRows_rsUserDetails = mysql_num_rows($rsUserDetails);

mysql_select_db($database_conn_familybeacon, $conn_familybeacon);
$query_rs_family = "SELECT * FROM family ORDER BY familyname ASC";
$rs_family = mysql_query($query_rs_family, $conn_familybeacon) or die(mysql_error());
$row_rs_family = mysql_fetch_assoc($rs_family);
$totalRows_rs_family = mysql_num_rows($rs_family);

// Buzz inet PHPLS02 - Login & Set Level
$myUsername_rsLogin = "0";
if (isset($HTTP_POST_VARS['username'])) {
$myUsername_rsLogin = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['username'] : addslashes($HTTP_POST_VARS['username']);
}
$myPassword_rsLogin = "0";
if (isset($HTTP_POST_VARS['password'])) {
$myPassword_rsLogin = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['password'] : addslashes($HTTP_POST_VARS['password']);
}
mysql_select_db($database_conn_familybeacon, $conn_familybeacon);
// Verify Login is correct
$query_rsLogin = sprintf("SELECT username, password, accessid FROM members WHERE username= '%s' AND password = '%s'", $myUsername_rsLogin,$myPassword_rsLogin);
$rsLogin = mysql_query($query_rsLogin, $conn_familybeacon) or die(mysql_error());
$row_rsLogin = mysql_fetch_assoc($rsLogin);
$totalRows_rsLogin = mysql_num_rows($rsLogin);

// Buzz inet PLS02 - Login and Set Level - Main
if($HTTP_POST_VARS['action']=="login"{
if($totalRows_rsLogin==0){
$errorMessage = "Bad";
mysql_free_result($rsLogin);
} else {
mysql_free_result($rsLogin);
session_register("fbuser";
$HTTP_SESSION_VARS['fbuser'] = $HTTP_POST_VARS['username'];
session_register("fblevel";
$HTTP_SESSION_VARS['fblevel'] = $row_rsLogin['accessid'];
header("Location: index.php";
}
}
?>
<?php require_once('ScriptLibrary/incPureUpload.php'); ?>
<?php
// Pure PHP Upload 2.0.0
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu_thepath = "images/members";
$ppu_extensions = "GIF,JPG,JPEG,BMP,PNG";
$ppu_formName = "userregistration";
$ppu_redirectURL = "";
$ppu_storeType = "path";
$ppu_sizeLimit = "100";
$ppu_nameConflict = "over";
$ppu_requireUpload = "false";
$ppu_minWidth = "100";
$ppu_minHeight = "100";
$ppu_maxWidth = "300";
$ppu_maxHeight = "300";
$ppu_saveWidth = "";
$ppu_saveHeight = "";
$ppu_timeout = "600";
$ppu_progressBar = "fileCopyProgress.htm";
$ppu_progressWidth = "300";
$ppu_progressHeight = "100";
ppu_checkVersion(2.0);
ppu_upload($ppu_thepath,$ppu_extensions,$ppu_redirectURL,$ppu_storeType,$ppu_sizeLimit,$ppu_nameConflict,$ppu_minWidth,$ppu_minHeight,$ppu_maxWidth,$ppu_maxHeight,$ppu_saveWidth,$ppu_saveHeight,$ppu_timeout);
}
$GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$GP_uploadAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'] . "GP_upload=true";
} else {
$GP_uploadAction .= "?" . "GP_upload=true";
}
?>
<?php
if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
} else {
$editFormAction .= "?GP_upload=true";
}
}
?>
Replied 14 Mar 2003 22:44:18
14 Mar 2003 22:44:18 George Petrov replied:
hmm somehow all the upload code got inserted after your insert record code.

To fix it now - you should move all the upload code starting with:
<?php require_once('ScriptLibrary/incPureUpload.php'); ?>

till the end of the php code - to the top of your page.

Greetings,
george





--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFreaks.nl
--------------------------------------------------
Replied 15 Mar 2003 00:23:52
15 Mar 2003 00:23:52 Jeff Parsons replied:
Thanks for the quick response. I tried what you recommended, to no avail. Did I move all of the required text? The Photo field in the database is a text field set to allow null values. Here is the full code for the page:

<?php require_once('ScriptLibrary/incPureUpload.php'); ?>
<?php
// Pure PHP Upload 2.0.0
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu_thepath = "images/members";
$ppu_extensions = "GIF,JPG,JPEG,BMP,PNG";
$ppu_formName = "userregistration";
$ppu_redirectURL = "";
$ppu_storeType = "file";
$ppu_sizeLimit = "300";
$ppu_nameConflict = "over";
$ppu_requireUpload = "false";
$ppu_minWidth = "";
$ppu_minHeight = "";
$ppu_maxWidth = "";
$ppu_maxHeight = "";
$ppu_saveWidth = "";
$ppu_saveHeight = "";
$ppu_timeout = "600";
$ppu_progressBar = "";
$ppu_progressWidth = "";
$ppu_progressHeight = "";
ppu_checkVersion(2.0);
ppu_upload($ppu_thepath,$ppu_extensions,$ppu_redirectURL,$ppu_storeType,$ppu_sizeLimit,$ppu_nameConflict,$ppu_minWidth,$ppu_minHeight,$ppu_maxWidth,$ppu_maxHeight,$ppu_saveWidth,$ppu_saveHeight,$ppu_timeout);
}
$GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$GP_uploadAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'] . "GP_upload=true";
} else {
$GP_uploadAction .= "?" . "GP_upload=true";
}
?>
<?php
if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
} else {
$editFormAction .= "?GP_upload=true";
}
}
?>
<?php
// Buzz inet PLS02 - Login and Set Level
// Start Session Support
session_start();
?>
<?php require_once('Connections/conn_familybeacon.php'); ?>
<?php
// Buzz inet PHPLS06 - User Details
session_start();

function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "" ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "" ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "" ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "" ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}

if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "userregistration") {
$insertSQL = sprintf("INSERT INTO members (username, password, firstname, lastname, email, hobbies, photo, joindate, birthdate, sex, instantmessengertype, instantmessengername, website, familyid) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['rusername'], "text",
GetSQLValueString($HTTP_POST_VARS['rpassword'], "text",
GetSQLValueString($HTTP_POST_VARS['firstname'], "text",
GetSQLValueString($HTTP_POST_VARS['lastname'], "text",
GetSQLValueString($HTTP_POST_VARS['email'], "text",
GetSQLValueString($HTTP_POST_VARS['hobbies'], "text",
GetSQLValueString($HTTP_POST_VARS['photo2'], "text",
GetSQLValueString($HTTP_POST_VARS['joindate'], "date",
GetSQLValueString($HTTP_POST_VARS['birthdate'], "date",
GetSQLValueString($HTTP_POST_VARS['Sex'], "text",
GetSQLValueString($HTTP_POST_VARS['imtype'], "text",
GetSQLValueString($HTTP_POST_VARS['imname'], "text",
GetSQLValueString($HTTP_POST_VARS['website'], "text",
GetSQLValueString($HTTP_POST_VARS['familyid'], "int");

mysql_select_db($database_conn_familybeacon, $conn_familybeacon);
$Result1 = mysql_query($insertSQL, $conn_familybeacon) or die(mysql_error());

$insertGoTo = "index.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

$varSearch_rsUserDetails = "1";
if (isset($HTTP_SESSION_VARS['fbuser'])) {
$varSearch_rsUserDetails = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['fbuser'] : addslashes($HTTP_SESSION_VARS['fbuser']);
}
mysql_select_db($database_conn_familybeacon, $conn_familybeacon);
$query_rsUserDetails = sprintf("SELECT * FROM members WHERE username = '%s'", $varSearch_rsUserDetails);
$rsUserDetails = mysql_query($query_rsUserDetails, $conn_familybeacon) or die(mysql_error());
$row_rsUserDetails = mysql_fetch_assoc($rsUserDetails);
$totalRows_rsUserDetails = mysql_num_rows($rsUserDetails);

mysql_select_db($database_conn_familybeacon, $conn_familybeacon);
$query_rs_family = "SELECT * FROM family WHERE id <> 1 ORDER BY familyname ASC";
$rs_family = mysql_query($query_rs_family, $conn_familybeacon) or die(mysql_error());
$row_rs_family = mysql_fetch_assoc($rs_family);
$totalRows_rs_family = mysql_num_rows($rs_family);

// Buzz inet PHPLS02 - Login & Set Level
$myUsername_rsLogin = "0";
if (isset($HTTP_POST_VARS['username'])) {
$myUsername_rsLogin = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['username'] : addslashes($HTTP_POST_VARS['username']);
}
$myPassword_rsLogin = "0";
if (isset($HTTP_POST_VARS['password'])) {
$myPassword_rsLogin = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['password'] : addslashes($HTTP_POST_VARS['password']);
}
mysql_select_db($database_conn_familybeacon, $conn_familybeacon);
// Verify Login is correct
$query_rsLogin = sprintf("SELECT username, password, accessid FROM members WHERE username= '%s' AND password = '%s'", $myUsername_rsLogin,$myPassword_rsLogin);
$rsLogin = mysql_query($query_rsLogin, $conn_familybeacon) or die(mysql_error());
$row_rsLogin = mysql_fetch_assoc($rsLogin);
$totalRows_rsLogin = mysql_num_rows($rsLogin);

// Buzz inet PLS02 - Login and Set Level - Main
if($HTTP_POST_VARS['action']=="login"{
if($totalRows_rsLogin==0){
$errorMessage = "Bad";
mysql_free_result($rsLogin);
} else {
mysql_free_result($rsLogin);
session_register("fbuser";
$HTTP_SESSION_VARS['fbuser'] = $HTTP_POST_VARS['username'];
session_register("fblevel";
$HTTP_SESSION_VARS['fblevel'] = $row_rsLogin['accessid'];
header("Location: index.php";
}
}
?>


<html><!-- InstanceBegin template="/Templates/one.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="head" -->
<title>Home</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}

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 YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
for (var i=1; i<args.length;i=i+4){
if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,"");
myV=myObj.value;
if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
if (myReq&&myObj.value.length==0){addErr=true}
if ((myV.length>0)&&(args[i+2]==1)){ //fromto
var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
} else if ((myV.length>0)&&(args[i+2]==2)){
var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$";if(!rx.test(myV))addErr=true;
} else if ((myV.length>0)&&(args[i+2]==3)){ // date
var myMa=args[i+1].split("#"; var myAt=myV.match(myMa[0]);
if(myAt){
var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
var myDate=new Date(myY,myM,myD);
if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
}else{addErr=true}
} else if ((myV.length>0)&&(args[i+2]==4)){ // time
var myMa=args[i+1].split("#"; var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
} else if (myV.length>0&&args[i+2]==5){ // check this 2
var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,"");
if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,""];
if(!myObj1.checked){addErr=true}
} else if (myV.length>0&&args[i+2]==6){ // the same
var myObj1 = MM_findObj(args[i+1]);
if(myV!=myObj1.value){addErr=true}
}
} else
if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
if (args[i+2]==2){
var myDot=false;
for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
if(!myDot){myErr+='* ' +args[i+3]+'\n'}
}
} else if (myObj.type=='checkbox'){
if(args[i+2]==1&&myObj.checked==false){addErr=true}
if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
} else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
}else if (myObj.type=='textarea'){
if(myV.length<args[i+1]){addErr=true}
}
if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
}
if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
document.MM_returnValue = (myErr=='');
}

function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
document.MM_returnValue = true;
for (var i = 0; i<form.elements.length; i++) {
field = form.elements[i];
if (field.type.toUpperCase() != 'FILE') continue;
checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }

function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
document.MM_returnValue = true;
if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|".replace(/\s/gi,"" + "$","i";
if (field.value == '') {
if (requireUpload) {alert('File is required!');document.MM_returnValue = false;field.focus();return;}
} else {
if(extensions != '' && !re.test(field.value)) {
alert('This file type is not allowed for uploading.\nOnly the following file extensions are allowed: ' + extensions + '.\nPlease select another file and try again.');
document.MM_returnValue = false;field.focus();return;
}
document.PU_uploadForm = field.form;
re = new RegExp(".(gif|jpg|png|bmp|jpeg)$","i";
if(re.test(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != '' || saveHeight != '')) {
checkImageDimensions(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }
}

function showImageDimensions(fieldImg) { //v2.09
var isNS6 = (!document.all && document.getElementById ? true : false);
var img = (fieldImg && !isNS6 ? fieldImg : this);
if (img.width > 0 && img.height > 0) {
if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
alert('Uploaded Image is too small!\nShould be at least ' + img.minWidth + ' x ' + img.minHeight); return;}
if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
alert('Uploaded Image is too big!\nShould be max ' + img.maxWidth + ' x ' + img.maxHeight); return;}
if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
alert('Uploaded Image File Size is too big!\nShould be max ' + (img.sizeLimit/1024) + ' KBytes'); return;}
if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
document.MM_returnValue = true;
} }

function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
if (!document.layers) {
var isNS6 = (!document.all && document.getElementById ? true : false);
document.MM_returnValue = false; var imgURL = 'file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
} else showImageDimensions(field.gp_img);}
}
//-->
</script>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="endowed.css" type="text/css">
<SCRIPT language="JavaScript">
<!--

function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}

function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue = true;
}
//-->
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <div align="center"> <img src="images/title.png" width="400" height="55"></div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><img src="images/tts_buttons7a.gif" width="717" height="30" usemap="#Map" border="0"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10"><img src="images/clear_dot.gif" width="10" height="1"></td>
<td width="100%" bgcolor="5d829d">
<div align="center"><a class="top" href="PHPbb2/index.php">FORUMS</a>
<img src="images/bullet7a.gif" width="15" height="15" border="0"> <a class="top" href="registration.php">REGISTER</a>
<img src="images/bullet7a.gif" width="15" height="15" border="0"> <a class="top" href="#"></a>
<a class="top" href="#">TBA</a></div>
</td>
<td width="10"><img src="images/clear_dot.gif" width="10" height="1"></td>
</tr>
<tr>
<td colspan="3"><img src="images/clear_dot.gif" width="1" height="4"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10" valign="bottom" rowspan="3"><img src="images/clear_dot.gif" width="10" height="8"></td>
<td valign="top" width="146" align="center">
<?php if ($totalRows_rsUserDetails == 0) { // Show if recordset empty ?>
<table width="146" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5"><img src="images/box_left7a_r1_c1.gif" width="146" height="11"></td>
</tr>
<tr>
<td bgcolor="5d829d" width="2"><img src="images/clear_dot.gif" width="2" height="1"></td>
<td width="5" bgcolor="dae7ef"><img src="images/clear_dot.gif" width="5" height="8"></td>
<td bgcolor="dae7ef" valign="top">
<h1 align="center">Login <?php echo "$errorMessage"; ?> </h1>
<form action="<?php echo "$PHP_SELF"; ?>" method="post" name="login" id="login">
<table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="120" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="40%" align="right"><div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>User
Name</strong></font></div>
</td>
</tr>
<tr>
<td align="right"><div align="left">
<input name="username" type="text" id="username2" onFocus="MM_displayStatusMsg('Please enter your User Name');return document.MM_returnValue" size="10" maxlength="10">
</div>
</td>
</tr>
<tr>
<td align="right">
<div align="left"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Password</strong></font></div>
</td>
</tr>
<tr>
<td><input name="password" type="password" id="password2" onFocus="MM_displayStatusMsg('Please enter your Password');return document.MM_returnValue" size="10" maxlength="10">
</td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Log In"></td>
</tr>
<tr>
<td><input name="action" type="hidden" id="action2" value="login"></td>
</tr>
<tr>
<td><font size="-2"><strong><a href="registration.php">Register</a></strong></font> </td>
</tr>
<tr>
<td width="40%"><font size="-2"><strong><a href="memberpassword.php">Forgot
Password</a></strong></font></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<h1 align="center"><img src="images/hline_columnA.gif" width="115" height="1"></h1>
<p class="small"> <img src="images/clear_dot.gif" width="132" height="1"></p>
</td>
<td width="5" bgcolor="dae7ef"><img src="images/clear_dot.gif" width="5" height="1"></td>
<td bgcolor="5d829d" width="2"><img src="images/clear_dot.gif" width="2" height="1"></td>
</tr>
<tr>
<td colspan="5"><img src="images/box_left7a_r3_c1.gif" width="146" height="11"></td>
</tr>
</table>
<?php } // Show if recordset empty ?> <p>
<center>
</center>
<?php if ($totalRows_rsUserDetails > 0) { // Show if recordset not empty ?>
<table width="146" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5"><img src="images/box_left7a_r1_c1.gif" width="146" height="11"></td>
</tr>
<tr>
<td bgcolor="5d829d" width="2"><img src="images/clear_dot.gif" width="2" height="1"></td>
<td width="5" bgcolor="dae7ef"><img src="images/clear_dot.gif" width="5" height="8"></td>
<td align="center" valign="top" bgcolor="dae7ef">
<h1 align="center">Welcome</h1> <p align="center"><strong><?php echo $row_rsUserDetails['firstname']; ?></strong></p> <p align="center"><a href="logout.php">Logout</a></p> <p align="center"><img src="images/hline_columnA.gif" width="115" height="1"></p> <table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><div align="center"><font size="-1"><strong><a href="membereditprofile.php">Edit
Profile</a></strong></font></div>
</td>
</tr>
</table> <div align="center"><img src="images/clear_dot.gif" width="132" height="8"></div>
</td>
<td width="5" bgcolor="dae7ef"><img src="images/clear_dot.gif" width="5" height="1"></td>
<td bgcolor="5d829d" width="2"><img src="images/clear_dot.gif" width="2" height="1"></td>
</tr>
<tr>
<td colspan="5"><img src="images/box_left7a_r3_c1.gif" width="146" height="11"></td>
</tr>
</table>
<?php } // Show if recordset not empty ?> <p><img src="images/clear_dot.gif" width="15" height="8"><img src="images/clear_dot.gif" width="15" height="1"></td>
<td valign="bottom" width="15" rowspan="3"><img src="images/clear_dot.gif" width="15" height="1"></td>
<td valign="top" rowspan="2" width="100%"> <div align="right">
<div align="right">
<p><span style="font-size:8pt">
<script language="JavaScript1.2">
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months<img src=../images/dmxzone/forum/icon_smile_8ball.gif border=0 align=middle>="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year &lt; 2000)
year = year + 1900;
document.write("&lt;right&gt;" + lmonth + " ";
document.write(date + ", " + year + "&lt;/right&gt;";
&lt;/script&gt;
&lt;/span&gt; &lt;/div&gt;
&lt;!-- InstanceBeginEditable name="body" --&gt;
&lt;form action="&lt;?php echo $editFormAction; ?&gt;" method="post" enctype="multipart/form-data" name="userregistration" id="userregistration" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,300,'','','','','','');return document.MM_returnValue"&gt;
&lt;div align="center"&gt;
&lt;table width="97%" border="0"&gt;
&lt;tr&gt;
&lt;td width="21%"&gt;&lt;div align="right"&gt;&lt;strong&gt;Username&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="27%"&gt; &lt;input name="rusername" type="text" id="rusername" /&gt;
&lt;/td&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Family&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;select name="familyid" id="familyid"&gt;
&lt;option value="1"&gt;None&lt;/option&gt;
&lt;?php
do {
?&gt;
&lt;option value="&lt;?php echo $row_rs_family['id']?&gt;"&gt;&lt;?php echo $row_rs_family['familyname']?&gt;&lt;/option&gt;
&lt;?php
} while ($row_rs_family = mysql_fetch_assoc($rs_family));
$rows = mysql_num_rows($rs_family);
if($rows &gt; 0) {
mysql_data_seek($rs_family, 0);
$row_rs_family = mysql_fetch_assoc($rs_family);
}
?&gt;
&lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;input name="rpassword" type="text" id="rpassword" /&gt; &lt;/td&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt; Image&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;input name="photo2" type="file" id="photo22" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,300,'','','','','','')"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Confirm Password&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;input name="confirmpassword" type="text" id="confirmpassword"&gt;
&lt;/td&gt;
&lt;td width="19%"&gt;&nbsp;&lt;/td&gt;
&lt;td width="33%"&gt;&lt;vlvalidator name=""&gt; &nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;First Name&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;input name="firstname" type="text" id="firstname" /&gt; &lt;/td&gt;
&lt;td width="19%"&gt;&lt;div align="right"&gt;&lt;strong&gt;Join Date&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="33%"&gt; &lt;input name="joindate" type="text" id="joindate" onClick="MM_popupMsg('Please use the month/day/year format of mm/dd/yyyy for both the join date and your birth date.')" size="12" maxlength="12" /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Last Name&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;input name="lastname" type="text" id="lastname" /&gt; &lt;/td&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Birthdate&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;input name="birthdate" type="text" id="birthdate" size="12" maxlength="12" /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Email Address&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;input name="email" type="text" id="email" size="20" maxlength="40" /&gt;
&lt;/td&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Sex&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;label&gt;
&lt;input type="radio" name="Sex" value="Male"&gt;
Male&lt;/label&gt; &lt;label&gt;
&lt;input type="radio" name="Sex" value="Female"&gt;
Female&lt;/label&gt; &lt;label&gt; &lt;/label&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&lt;label&gt; &lt;/label&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Messenger&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;select name="imtype" id="imtype"&gt;
&lt;option value="Microsoft IM"&gt;Microsoft IM&lt;/option&gt;
&lt;option value="Yahoo IM"&gt;Yahoo IM&lt;/option&gt;
&lt;option value="ICQ"&gt;ICQ&lt;/option&gt;
&lt;option value="AOL"&gt;AOL&lt;/option&gt;
&lt;/select&gt; &lt;/td&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Hobbies&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td rowspan="4"&gt;&lt;textarea name="hobbies" cols="20" rows="6" id="textarea"&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Messenger Name&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;input name="imname" type="text" id="imname" size="20" maxlength="40" /&gt;
&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;Personal Website&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt; &lt;input name="website" type="text" id="website2" size="20" maxlength="40" /&gt;
&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;&lt;div align="right"&gt;
&lt;input name="Submit2" type="submit" value="Submit" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&nbsp; &lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p align="left"&gt;
&lt;input type="hidden" name="MM_insert" value="form1"&gt;
&lt;/p&gt;
&lt;input type="hidden" name="MM_insert" value="userregistration"&gt;
&lt;/form&gt;
&lt;h3 align="left"&gt;&lt;/h3&gt;
&lt;p align="center"&gt;&nbsp;&lt;/p&gt;
&lt;p align="center"&gt;&nbsp;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="images/hline.gif" width="300" height="7"&gt;&lt;/p&gt;
&lt;h3 align="left"&gt;&lt;/h3&gt;
&lt;!-- InstanceEndEditable --&gt;
&lt;p align="center"&gt;&nbsp;&lt;/p&gt; &lt;/div&gt;
&lt;/td&gt;
&lt;td valign="bottom" width="15" rowspan="3"&gt;&lt;img src="images/clear_dot.gif" width="15" height="1"&gt;&lt;/td&gt;
&lt;td valign="bottom" bgcolor="#F1F7FA" width="5" rowspan="3"&gt;&lt;img src="images/clear_dot.gif" width="5" height="8"&gt;&lt;/td&gt;
&lt;td valign="top" bgcolor="#F1F7FA" width="130" rowspan="3"&gt;
&lt;h2 align="center"&gt;&lt;img src="images/clear_dot.gif" width="130" height="1"&gt;&lt;br&gt;
&lt;/h2&gt;

&lt;h2 align="center"&gt;&nbsp;&lt;/h2&gt;
&lt;p class="small"&gt;&nbsp;&lt;/p&gt;
&lt;p align="center"&gt;&nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="bottom" bgcolor="#F1F7FA" width="5" rowspan="3"&gt;&lt;img src="images/clear_dot.gif" width="5" height="8"&gt;&lt;/td&gt;
&lt;td valign="bottom" width="10" rowspan="3"&gt;&lt;img src="images/clear_dot.gif" width="10" height="1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="bottom"&gt;
&lt;p align="center" class="small"&gt;&lt;span style="font-weight:bold; color:#5d829d"&gt;Jeff
Parsons &lt;/span&gt;&lt;br&gt;
1639 Dover&lt;br&gt;
Iowa City, IA 52240&lt;/p&gt;
&lt;p align="center" class="small"&gt;(319) 339-91443&lt;br&gt;
&lt;/p&gt;
&lt;p align="center" class="small"&gt;&nbsp;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="bottom"&gt;
&lt;p align="center" class="small"&gt;&lt;a href="mailto:% "&gt;&lt;img src="images/email_button7a.gif" width="104" height="30" border="0"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td valign="bottom"&gt;
&lt;div align="center"&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;&lt;img src="images/clear_dot.gif" width="1" height="4"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="10"&gt;&lt;img src="images/clear_dot.gif" width="10" height="1"&gt;&lt;/td&gt;
&lt;td width="100%" bgcolor="5d829d"&gt;&nbsp;&lt;/td&gt;
&lt;td width="10"&gt;&lt;img src="images/clear_dot.gif" width="10" height="1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;&lt;img src="images/clear_dot.gif" width="1" height="10"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;map name="Map"&gt;
&lt;area shape="rect" coords="3,4,101,25" href="index.php" alt="Home" title="Home"&gt;
&lt;area shape="rect" coords="107,4,203,25" href="addresses.php" alt="Addresses" title="Customize"&gt;
&lt;area shape="rect" coords="207,4,305,25" href="photos,php" alt="Photos" title="Instructions"&gt;
&lt;area shape="rect" coords="310,4,407,25" href="letters.php" alt="Letters" title="Contact"&gt;
&lt;area shape="rect" coords="411,4,509,25" href="tree.php" alt="Family Tree" title="Category 5"&gt;
&lt;area shape="rect" coords="513,4,611,25" href="links.php" alt="Links" title="Category 6"&gt;
&lt;area shape="rect" coords="614,4,715,25" href="about.php" alt="About Us" title="Category 7"&gt;
&lt;/map&gt;
&lt;/body&gt;
&lt;!-- InstanceEnd --&gt;&lt;/html&gt;
&lt;?php
mysql_free_result($rsUserDetails);

mysql_free_result($rs_family);
?&gt;
Replied 15 Mar 2003 01:05:32
15 Mar 2003 01:05:32 Jeff Parsons replied:
Fixed it!

This piece of coded needed to be at the end of the PhP code

&lt;?php
if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
} else {
$editFormAction .= "?GP_upload=true";
}
}
?&gt;
Replied 17 Mar 2003 17:54:32
17 Mar 2003 17:54:32 George Petrov replied:
Indeed! Good to hear!

Anyway it had to be inserted properly at the first place - so we will still have a look.

Greetings,
george

--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFreaks.nl
--------------------------------------------------

Reply to this topic