Pure PHP Upload 2 Support Product Page

This topic was archived

Extension fails to do anything

Reported 25 Feb 2005 14:22:17
1
has this problem
25 Feb 2005 14:22:17 Flying Noodle posted:
Hi, I've been using your extension for some time and whilst it used to work fine, possibly before it was updated, it now categorically fails to do anything - no file is copied to the directory I specify (although there is a time lapse that differs on file size, so I assume that the browser does upload the file somewhere. In addition, either no file name will be passed to my SQL database, or (rarely) the filename will be passed with the full path, despite me specifying that only the file name should be passed.

I have attempted to add the behaviour using both Dreamweaver MX and MX 2004, to no avail. The server that we use has PHP 4.3.10 installed on it, and I am defienately using the latest up to date version of the extension.

I have browsed these forums extensively looking for a solution to this problem, but as yet have not found one, apart from the general 'change $_POST to $HTTP_POST_VARS' which I have tried to no avail whatsover.

I also use the PHP Smart Image resizer and I think that both the extensions were excellent when they worked, but now they seem to merely be an expensive way to add useless code to a webpage.

Here is my code for the insert and upload sections of my PHP:

<pre id=code><font face=courier size=2 id=code>
&lt;?php require_once('../Connections/OnlyJoe.php'); ?&gt;
&lt;?php require_once('../ScriptLibrary/incPureUpload.php'); ?&gt;
&lt;?php
// Pure PHP Upload 2.1.2
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu = new pureFileUpload();
$ppu-&gt;path = "../flyers";
$ppu-&gt;extensions = "";
$ppu-&gt;formName = "form1";
$ppu-&gt;storeType = "file";
$ppu-&gt;sizeLimit = "";
$ppu-&gt;nameConflict = "over";
$ppu-&gt;requireUpload = "true";
$ppu-&gt;minWidth = "";
$ppu-&gt;minHeight = "";
$ppu-&gt;maxWidth = "";
$ppu-&gt;maxHeight = "";
$ppu-&gt;saveWidth = "";
$ppu-&gt;saveHeight = "";
$ppu-&gt;timeout = "600";
$ppu-&gt;progressBar = "";
$ppu-&gt;progressWidth = "";
$ppu-&gt;progressHeight = "";
$ppu-&gt;checkVersion("2.1.2";
$ppu-&gt;doUpload();
}
$GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true";
} else {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];
}
} else {
$GP_uploadAction .= "?"."GP_upload=true";
}

if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
}
} else {
$editFormAction .= "?GP_upload=true";
}
}
?&gt;
&lt;?php
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"] == "form1") {
$dateNum=$HTTP_POST_VARS['YYYY'].'-'.$HTTP_POST_VARS['MM'].'-'.$HTTP_POST_VARS['DD'];
$date=$HTTP_POST_VARS['DD'];
if (substr($HTTP_POST_VARS['DD'], 1, 1)==1){$date.='&lt;sup&gt;st&lt;/sup&gt; ';}
elseif (substr($HTTP_POST_VARS['DD'], 1, 1)==2){$date.='&lt;sup&gt;nd&lt;/sup&gt; ';}
elseif (substr($HTTP_POST_VARS['DD'], 1, 1)==3){$date.='&lt;sup&gt;rd&lt;/sup&gt; ';}
elseif (substr($HTTP_POST_VARS['DD'], 1, 1)&gt;=4){$date.='&lt;sup&gt;th&lt;/sup&gt; ';}
if ($HTTP_POST_VARS['MM']==01){$date.='January '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==02){$date.='February '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==03){$date.='March '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==04){$date.='April '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==05){$date.='May '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==06){$date.='June '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==07){$date.='July '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==08){$date.='August '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==09){$date.='September '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==10){$date.='October '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==11){$date.='November '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==12){$date.='December '.$HTTP_POST_VARS['YYYY'];}

$insertSQL = sprintf("INSERT INTO GigsTable (ID, DateNum, `Date`, Location, Support,
Directions, Flyers, Extra1, Extra2, Extra3) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['ID'], "int",
GetSQLValueString($dateNum, "date",
GetSQLValueString($date, "text",
GetSQLValueString($HTTP_POST_VARS['Location'], "text",
GetSQLValueString($HTTP_POST_VARS['Support'], "text",
GetSQLValueString($HTTP_POST_VARS['Directions'], "text",
GetSQLValueString($HTTP_POST_VARS['Flyer'], "text",
GetSQLValueString($HTTP_POST_VARS['Extra1'], "text",
GetSQLValueString($HTTP_POST_VARS['Extra2'], "text",
GetSQLValueString($HTTP_POST_VARS['Extra3'], "text");

mysql_select_db($database_OnlyJoe, $OnlyJoe);
$Result1 = mysql_query($insertSQL, $OnlyJoe) or die(mysql_error());

$insertGoTo = "index.php?y=y";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?&gt;
</font id=code></pre id=code>

And here is the form code:
<pre id=code><font face=courier size=2 id=code>
&lt;form action="&lt;?php echo $editFormAction; ?&gt;"
method="post" enctype="multipart/form-data" name="form1"
onSubmit="checkFileUpload(this,'',true,'','','','','','','');return document.MM_returnValue"&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Date:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="DD" size="3" maxlength="2" /&gt;
/
&lt;input name="MM" size="3" maxlength="2" /&gt;
/
&lt;input name="YYYY" size="5" maxlength="4" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Location:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Location" size="32" maxlength="100"/&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Support:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Support" size="32" maxlength="100"/&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Directions:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;textarea name="Directions" cols="32" rows="5"&gt;&lt;/textarea&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Doors:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Extra1" cols="32" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Price:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Extra2" cols="32" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Flyer:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Flyer" type="file"
onChange="checkOneFileUpload(this,'',true,'','','','','','','')" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt; &lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input type="submit" value="Update!"&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;input type="hidden" name="ID"&gt;
&lt;input name="Extra3" type="hidden" id="Extra3"&gt;
&lt;input type="hidden" name="MM_insert" value="form1"&gt;
&lt;/form&gt;
</font id=code></pre id=code>

I hope that you can resolve the problems with this extension, because it has potential and when it works it is excellent.

-Noodle

Edited by - FlyingNoodle on 17 Mar 2005 17:31:19

Replies

Replied 17 Mar 2005 17:26:07
17 Mar 2005 17:26:07 Flying Noodle replied:
It has been 3 weeks since I posted this topic and I have yet to recieve even an acknowledgment, let alone a solution.

Is this how you treat your paying customers?
Replied 22 Mar 2005 20:56:17
22 Mar 2005 20:56:17 Chris Charlton replied:
I notice your extension code is v2.1.2, please update to v2.1.3.1 from the extension product page. Then re-apply your PurePHP Upload <i>Server Behaviors</i> and upload all files neccessary (ScriptLibrary folder files, and your page + progress bar files if needed).

~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 29 Mar 2005 15:41:03
29 Mar 2005 15:41:03 Flying Noodle replied:
<font color=red>I've updated the extension, but it still doesn't work on the majority of my pages. I am able to make work perfectly, but it seems that this only works if the file field is the only thing on the page.

Here is my code for the working page, which is given an individual database entry and will change the file (note there are some variables such as 'task' which define where the files and entries go. As far as I know these have no bearing on the code:
</font id=red>

<pre id=code><font face=courier size=2 id=code>&lt;?php require_once('../ScriptLibrary/incPureUpload.php'); ?&gt;
&lt;?php
$task=$_POST['task'];
$uploaded=0;
// Pure PHP Upload 2.1.3
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu = new pureFileUpload();
if ($task==1||$task==2){
$ppu-&gt;path = "../media";
} elseif ($task==4){
$ppu-&gt;path = "../flyers";
} else {
$ppu-&gt;path = "../images";
}
$ppu-&gt;extensions = "";
$ppu-&gt;formName = "form1";
$ppu-&gt;storeType = "file";
$ppu-&gt;sizeLimit = "";
$ppu-&gt;nameConflict = "over";
$ppu-&gt;requireUpload = "true";
$ppu-&gt;minWidth = "";
$ppu-&gt;minHeight = "";
$ppu-&gt;maxWidth = "";
$ppu-&gt;maxHeight = "";
$ppu-&gt;saveWidth = "";
$ppu-&gt;saveHeight = "";
$ppu-&gt;timeout = "600";
$ppu-&gt;progressBar = "";
$ppu-&gt;progressWidth = "";
$ppu-&gt;progressHeight = "";
$ppu-&gt;checkVersion("2.1.3";
$ppu-&gt;doUpload();
}
$GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true";
} else {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];
}
} else {
$GP_uploadAction .= "?"."GP_upload=true";
}

if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
}
} else {
$editFormAction .= "?GP_upload=true";
}
}
?&gt;
&lt;?php require_once('../Connections/OnlyJoe.php'); ?&gt;
&lt;?php
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 = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["changeme"])) && ($_POST["changeme"] == "1") {
if ($task==1){
if ($_POST['vid']=='Lo'){
$insertSQL = sprintf("UPDATE mediaTable SET Lo=%s WHERE ID=%s",
GetSQLValueString($HTTP_POST_VARS['Image'], "text",
GetSQLValueString($_POST['ID'], "int");}
elseif ($_POST['vid']=='Hi'){
$insertSQL = sprintf("UPDATE mediaTable SET Hi=%s WHERE ID=%s",
GetSQLValueString($HTTP_POST_VARS['Image'], "text",
GetSQLValueString($_POST['ID'], "int"); }

}
elseif ($task==2){
$insertSQL = sprintf("UPDATE mediaTable SET MP3=%s WHERE ID=%s",
GetSQLValueString($HTTP_POST_VARS['Image'], "text",
GetSQLValueString($_POST['ID'], "int");
}
elseif ($task==3){
$insertSQL = sprintf("UPDATE photoTable SET Photo=%s WHERE ID=%s",
GetSQLValueString($HTTP_POST_VARS['Image'], "text",
GetSQLValueString($_POST['ID'], "int");
}
elseif ($task==4){
$insertSQL = sprintf("UPDATE GigsTable SET Flyers=%s WHERE ID=%s",
GetSQLValueString($HTTP_POST_VARS['Image'], "text",
GetSQLValueString($_POST['ID'], "int");
}
elseif ($task==5){
$insertSQL = sprintf("UPDATE bandTable SET Photo=%s WHERE ID=%s",
GetSQLValueString($HTTP_POST_VARS['Image'], "text",
GetSQLValueString($_POST['ID'], "int");
}
elseif ($task==6){
$insertSQL = sprintf("UPDATE productTable SET Pic=%s WHERE ID=%s",
GetSQLValueString($HTTP_POST_VARS['Image'], "text",
GetSQLValueString($_POST['ID'], "int");
}


mysql_select_db($database_OnlyJoe, $OnlyJoe);
$Result1 = mysql_query($insertSQL, $OnlyJoe) or die(mysql_error());

$uploaded=1;
}
?&gt;
</font id=code></pre id=code>


<font color=red>Form code:</font id=red>
<pre id=code><font face=courier size=2 id=code>&lt;div &lt;?php if ($uploaded==1){echo 'style="display:none;'; } ?&gt; class="bluebox"
style="text-align:center;"&gt;
&lt;form action="&lt;?php echo $GP_uploadAction; ?&gt;" method="post"
enctype="multipart/form-data" name="form1"
onSubmit="checkFileUpload(this,'',true,'','','','','','','');return document.MM_returnValue"&gt;
&lt;input name="Image" type="file"
id="Image" onChange="checkOneFileUpload(this,'',true,'','','','','','','')"&gt;&lt;br&gt;
&lt;input type="hidden" name="changeme" value="1"&gt;
&lt;input type="hidden" name="task" value="&lt;?php echo $_GET['task']; ?&gt;"&gt;
&lt;input type="hidden" name="ID" value="&lt;?php echo $_GET['id']; ?&gt;"&gt;
&lt;input type="hidden" name="vid" value="&lt;?php echo $_GET['vid']; ?&gt;"&gt;
&lt;input type="submit" name="Submit" value="Submit"&gt;
&lt;/form&gt;
&lt;/div&gt;

&lt;div class="bluebox" style="text-align:center;&lt;?php if ($uploaded==0){echo 'display:none;'; } ?&gt;"&gt;
The file has been changed. You can now close this window.
&lt;/div&gt;
</font id=code></pre id=code>


<font color=red>And here is the code from a non-working page, which should upload the contents of the file field to '../flyers' as well as placing the file name into a database:

PHP code:</font id=red>
<pre id=code><font face=courier size=2 id=code>&lt;?php require_once('../ScriptLibrary/incPureUpload.php'); ?&gt;
&lt;?php
// Pure PHP Upload 2.1.3
if (isset($HTTP_GET_VARS['GP_upload'])) {
$ppu = new pureFileUpload();
$ppu-&gt;path = "../flyers";
$ppu-&gt;extensions = "";
$ppu-&gt;formName = "form1";
$ppu-&gt;storeType = "file";
$ppu-&gt;sizeLimit = "";
$ppu-&gt;nameConflict = "over";
$ppu-&gt;requireUpload = "false";
$ppu-&gt;minWidth = "";
$ppu-&gt;minHeight = "";
$ppu-&gt;maxWidth = "";
$ppu-&gt;maxHeight = "";
$ppu-&gt;saveWidth = "";
$ppu-&gt;saveHeight = "";
$ppu-&gt;timeout = "600";
$ppu-&gt;progressBar = "";
$ppu-&gt;progressWidth = "";
$ppu-&gt;progressHeight = "";
$ppu-&gt;checkVersion("2.1.3";
$ppu-&gt;doUpload();
}
$GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true";
} else {
$GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING'];
}
} else {
$GP_uploadAction .= "?"."GP_upload=true";
}

if (isset($editFormAction)) {
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
}
} else {
$editFormAction .= "?GP_upload=true";
}
}
?&gt;
&lt;?php require_once('../Connections/OnlyJoe.php'); ?&gt;
&lt;?php
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"] == "form1") {
$dateNum=$HTTP_POST_VARS['YYYY'].'-'.$HTTP_POST_VARS['MM'].'-'.$HTTP_POST_VARS['DD'];
$date=$HTTP_POST_VARS['DD'];
if (substr($HTTP_POST_VARS['DD'], 1, 1)==1){$date.='&lt;sup&gt;st&lt;/sup&gt; ';}
elseif (substr($HTTP_POST_VARS['DD'], 1, 1)==2){$date.='&lt;sup&gt;nd&lt;/sup&gt; ';}
elseif (substr($HTTP_POST_VARS['DD'], 1, 1)==3){$date.='&lt;sup&gt;rd&lt;/sup&gt; ';}
elseif (substr($HTTP_POST_VARS['DD'], 1, 1)&gt;=4){$date.='&lt;sup&gt;th&lt;/sup&gt; ';}
if ($HTTP_POST_VARS['MM']==01){$date.='January '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==02){$date.='February '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==03){$date.='March '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==04){$date.='April '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==05){$date.='May '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==06){$date.='June '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==07){$date.='July '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==08){$date.='August '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==09){$date.='September '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==10){$date.='October '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==11){$date.='November '.$HTTP_POST_VARS['YYYY'];}
elseif ($HTTP_POST_VARS['MM']==12){$date.='December '.$HTTP_POST_VARS['YYYY'];}

$insertSQL = sprintf("INSERT INTO GigsTable (ID, DateNum, `Date`, Location, Support, Directions,
Flyers, Extra1, Extra2, Extra3) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['ID'], "int",
GetSQLValueString($dateNum, "date",
GetSQLValueString($date, "text",
GetSQLValueString($HTTP_POST_VARS['Location'], "text",
GetSQLValueString($HTTP_POST_VARS['Support'], "text",
GetSQLValueString($HTTP_POST_VARS['Directions'], "text",
GetSQLValueString($HTTP_POST_VARS['Flyer'], "text",
GetSQLValueString($HTTP_POST_VARS['Extra1'], "text",
GetSQLValueString($HTTP_POST_VARS['Extra2'], "text",
GetSQLValueString($HTTP_POST_VARS['Extra3'], "text");

mysql_select_db($database_OnlyJoe, $OnlyJoe);
$Result1 = mysql_query($insertSQL, $OnlyJoe) or die(mysql_error());

$insertGoTo = "index.php?y=y";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?&gt;</font id=code></pre id=code>

<font color=red>form code:</font id=red>
<pre id=code><font face=courier size=2 id=code>&lt;div class="bluebox"&gt;
&lt;form action="&lt;?php echo $editFormAction; ?&gt;" method="post"
enctype="multipart/form-data" name="form1"
onSubmit="checkFileUpload(this,'',false,'','','','','','','');return document.MM_returnValue"&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Date:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="DD" size="3" maxlength="2" /&gt;
/
&lt;input name="MM" size="3" maxlength="2" /&gt;
/
&lt;input name="YYYY" size="5" maxlength="4" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Location:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Location" size="32" maxlength="100"/&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Support:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Support" size="32" maxlength="100"/&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Directions:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;textarea name="Directions" cols="32" rows="5"&gt;&lt;/textarea&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Doors:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Extra1" cols="32" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Price:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Extra2" cols="32" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt;Flyer:&lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input name="Flyer" type="file" onChange="checkOneFileUpload(this,'',false,'','','','','','','')" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="row"&gt;
&lt;div class="labels"&gt; &lt;/div&gt;
&lt;div class="boxes"&gt;
&lt;input type="submit" value="Add gig"&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;input type="hidden" name="ID"&gt;
&lt;input name="Extra3" type="hidden" value="0" id="Extra3"&gt;
&lt;input type="hidden" name="MM_insert" value="form1"&gt;
&lt;/form&gt;
&lt;/div&gt;
</font id=code></pre id=code>
<font color=red>
I've compared them and as far as I can see the only difference between the two is that the non working script contains HTTP and _VARS around its $_POST and _SERVER bits. I have tried the script with the $HTTP_SERVER_VARS replaced with $_SERVER but to no avail.

Any ideas?

Thankyou

-Oliver Cross</font id=red>

Edited by - FlyingNoodle on 29 Mar 2005 15:50:31
Replied 07 Apr 2005 17:12:11
07 Apr 2005 17:12:11 Flying Noodle replied:
Anybody?
Replied 13 Jul 2005 04:36:17
13 Jul 2005 04:36:17 jacob aliasbdi replied:
I have the same issue. Maybe it would help if I mentioned the server type. My server is a windows server with the latest PHP installed. Therefore there is nothing to set with permissions because the windows server does not use them. Yet them name of the uploaded file is not even being updated to the MySQL record.

Reply to this topic