Jump to content

[SOLVED] php error


Renlok

Recommended Posts

im having a problem with a script with is spose to add an auction to a database, all the script for this is on one page called sell.php and on this page your sposed to be sent though 3 sections, the first being adding the information of your auvction second being previewing it and last being just telling you wether or not it was added.

The problem im having is when you click the submit button on the first section nothing happens it just loads up the same thing, and i dont know why it doesnt send you to the next section.
[code] if ( empty($action) || (($action=='first')&&($$ERR)) )
{
// display form here
include "header.php";

$auc_id =$sessionVars["SELL_auction_id"];

// prepare variables for templates/template

// simple fields
$titleH =  htmlspecialchars($title);
$descriptionH = htmlspecialchars($description);
$pict_urlH = htmlspecialchars($pict_url);

// ------------------------------------- auction type
$T= "<SELECT NAME=\"atype\">\n";
reset($auction_types); while(list($key,$val)=each($auction_types)){
$T.=
" <OPTION VALUE=\"".
$key.
"\" ".
(($key==$atype)?"SELECTED":"")
.">".$val."</OPTION>\n";
}
$T.="</SELECT>\n";
$TPL_auction_type = $T;

// ------------------------------------- duration

//--
$query = "select * from a_durations order by days";
$res_durations = mysql_query($query);
if(!$res_durations)
{
print $ERR_001." - ".mysql_error();
}
$num_durations = mysql_num_rows($res_durations);
$i = 0;
$T= "<SELECT NAME=\"duration\">\n";
while($i < $num_durations){

$days = mysql_result($res_durations,$i,"days");
$duration_descr = mysql_result($res_durations,$i,"description");
$T.= " <OPTION VALUE=\"$days\"";

if($days == $duration)
{
$T .= " SELECTED";
}
$T .= ">$duration_descr</OPTION>";

$i++;
}
$T.="</SELECT>\n";
$TPL_durations_list = $T;

// -------------------------------------- country
$T= "<SELECT NAME=\"country\">\n";
reset($countries); while(list($key,$val)=each($countries)){
$T.=
" <OPTION VALUE=\"".
$key.
"\" ".
(($key==$country)?"SELECTED":"")
.">".$val."</OPTION>\n";
}
$T.="</SELECT>\n";
$TPL_countries_list = $T;

// -------------------------------------- payment

//--
$qurey = "select * from a_payments";
$res_payment = mysql_query($qurey);
if(!$res_payment)
{
print $ERR_001." - ".mysql_error();
exit;
}
$num_payments = mysql_num_rows($res_payment);
$T= "";

$i = 0;
while($i < $num_payments)
{
$payment_descr = mysql_result($res_payment,$i,"description");

$T.="<INPUT TYPE=CHECKBOX NAME=\"payment[]\" VALUE=\"$payment_descr\"";
if($payment_descr == $payment[$i])
{
$T .= " CHECKED";
}

$T .= "> $std_font $payment_descr</FONT><BR>";

$i++;
}
$TPL_payments_list = $T;

// -------------------------------------- category
$T= "<SELECT NAME=\"category\">\n";
$result = mysql_query("SELECT * FROM a_categories_plain");
if($result):
while($row=mysql_fetch_array($result)){
$T.=
" <OPTION VALUE=\"".
$row[cat_id].
"\" ".
(($row[cat_id]==$category)?"SELECTED":"")
.">".$row[cat_name]."</OPTION>\n";
}
endif;
$T.="</SELECT>\n";
$TPL_categories_list = $T;

// -------------------------------------- shipping
if ( intval($shipping)==1 )
$TPL_shipping1_value = "CHECKED";

if ( intval($shipping)==2 )
$TPL_shipping2_value = "CHECKED";

if ( !empty($international) )
$TPL_international_value = "CHECKED";

// -------------------------------------- reserved price
if ( $with_reserve=="yes" )
$TPL_with_reserve_selected = "CHECKED";
else
$TPL_without_reserve_selected = "CHECKED";

// -------------------------------------- photo source
if ( intval($imgtype)==1 )
$TPL_imgtype2_SELECTED = "CHECKED";
else
$TPL_imgtype1_SELECTED = "CHECKED";

$TPL_error_value = $$ERR;

// update current session
if ( isset($sessionVars["SELL_DATA_CORRECT"]) )
unset($sessionVars["SELL_DATA_CORRECT"]);
session_name($SESSION_NAME);
session_register("sessionVars");

//putSessionVars();

// include corresponding templates/template and exit
include "templates/sell_php3.html";
include "footer.php";
exit;
}
[/code]

sell.php = main script

then the templates if you need them are:
sell_php3.html = first page you sould see
sell_preview_php3.html = second page you sould see (previewing what youve entered)
sell_result_php3.html = final page you see just shows a link to your added item

[attachment deleted by admin]
Link to comment
https://forums.phpfreaks.com/topic/32758-solved-php-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.