Renlok Posted January 3, 2007 Share Posted January 3, 2007 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 scriptthen the templates if you need them are:sell_php3.html = first page you sould seesell_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 More sharing options...
trq Posted January 3, 2007 Share Posted January 3, 2007 Yoiu might want to narrow your problem down a bit. I can't see anyone sifting through hundreds of lines of code, especially with such a vague description of your problem and a useless subject line. Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152508 Share on other sites More sharing options...
Renlok Posted January 3, 2007 Author Share Posted January 3, 2007 well on the first page where action equals nothing, you click on the submit button and nothing happens wheras it sould send you to the next page Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152512 Share on other sites More sharing options...
trq Posted January 3, 2007 Share Posted January 3, 2007 The first page being?Also... are you aware that session_register() has long been depricated and should no longer be used? Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152513 Share on other sites More sharing options...
Renlok Posted January 4, 2007 Author Share Posted January 4, 2007 the first page is the [b]if ( empty($action) || (($action=='first')&&($$ERR)) )[/b] sectionand no i didnt i dont know alot much about sessions what sould you use now? Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152776 Share on other sites More sharing options...
Renlok Posted January 4, 2007 Author Share Posted January 4, 2007 anyone have anything? lol sorry its so long but its only the one bit you really need to look at Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152878 Share on other sites More sharing options...
trq Posted January 4, 2007 Share Posted January 4, 2007 [quote]its only the one bit you really need to look at[/quote]Then post the relevent code. No one likes downloading files for starters (it not real secure) and secondly, you posted hundreds of lines of code. Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152880 Share on other sites More sharing options...
Renlok Posted January 4, 2007 Author Share Posted January 4, 2007 there ^-^ lol sorry i didnt do i before.but you dont need to download it to view it off this you can just open it and itll opne in the file in the browser Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152887 Share on other sites More sharing options...
trq Posted January 4, 2007 Share Posted January 4, 2007 Now you dont have a question in your post. Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152921 Share on other sites More sharing options...
Renlok Posted January 4, 2007 Author Share Posted January 4, 2007 ... :-X oops, well there all sorted? Link to comment https://forums.phpfreaks.com/topic/32758-solved-php-error/#findComment-152950 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.