ueon Posted May 19, 2008 Share Posted May 19, 2008 For some reason, the data sent through the form isn't being transfered at all to the next page. FORM CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Webgen 2.0</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <div align="center"> <b>Webgen 2.0</b><br /> [stage 2]<br /> <?php include 'connect.php'; // Extracting Data $sql = "SELECT css_file, js_file, div_file, table_file FROM stageone WHERE id = '1'"; $result = mysql_query ($sql) or die (mysql_error()); list ($css_num, $js_num, $div_num, $table_num) = mysql_fetch_row($result); //Set initial loop vars $css_int = 0; $js_int = 0; $div_int = 0; $table_int = 0; $css_id = 0; $js_id = 0; $div_id = 0; $table_id = 0; //form echo '<form name="stagetwo1" method="post" action="stagethree.php">'; //CSS loop while ($css_int != $css_num) { echo " <p>\n <input name='css_name$css_id' type='text' id='css_name$css_id' value='CSS file'>\n </p>\n "; $css_int++; $css_id++; } //JS Loop while ($js_int != $js_num) { echo (" <p>\n <input name='js_name$js_id' type='text' id='js_name$js_id' value='JS file'>\n </p>\n "); $js_int++; $js_id++; } //Div Loop while ($div_int != $div_num) { echo (" <p>\n <input name='div_name$div_id' type='text' id='div_name$div_id' value='DIV Image'><BR />\n <input name='div_top$div_id' type='text' id='div_top$div_id' value='Top PX'><BR />\n <input name='div_left$div_id' type='text' id='div_left$div_id' value='Left PX'><BR />\n </p>\n\n "); $div_int++; $div_id++; } //Table Loop while ($table_int != $table_num) { echo (" <p>\n <input name='table_name$table_id' type='text' id='table_name$table_id' value='Table'><BR />\n <input name='table_width$table_id' type='text' id='table_width$table_id' value='Width'><BR />\n <input name='table_height$table_id' type='text' id='table_height$table_id' value='Height'><BR />\n <input name='table_top$table_id' type='text' id='table_top$table_id' value='Top PX'><BR />\n <input name='table_left$table_id' type='text' id='table_left$table_id' value='Left PX'><BR />\n <input name='table_border$table_id' type='text' id='table_border$table_id' value='Border PX'><BR />\n <textarea name='content$table_id' cols='15' rows='3'>Content</textarea> </p>\n\n "); $table_int++; $table_id++; } echo (" <p> <input type='submit' name='Submit' value='Submit'>\n </p>\n </form>\n ") ?> </div> </body> </html> FORM ACTION <?php include 'connect.php'; // Extracting Data $sql = "SELECT table_file FROM stageone WHERE id = '1'"; $result = mysql_query ($sql) or die (mysql_error()); list ($table_num) = mysql_fetch_row($result); $int_val3 = 0; for ($int_val3 = 0; $int_val3 < $table_num; $int_val3++) { $table_name.$int_val3 = $_POST["table_name$int_val3"]; $table_width = $_POST["table_width$int_val3"]; $table_height = $_POST["table_height$int_val3"]; $table_top = $_POST["table_top$int_val3"]; $table_left = $_POST["table_left$int_val3"]; $table_border = $_POST["table_border$int_val3"]; $table_content = $_POST["table_content$int_val3"]; echo (" <div style='position:absolute; left: $table_left; top: $table_top; overflow:auto;'> "); } ?> Link to comment https://forums.phpfreaks.com/topic/106342-trouble-with-_post/ Share on other sites More sharing options...
BlueSkyIS Posted May 19, 2008 Share Posted May 19, 2008 i would look at the HTML to make sure the form names/values look right, then print_r($_POST) to see what you're getting on that page. Link to comment https://forums.phpfreaks.com/topic/106342-trouble-with-_post/#findComment-544998 Share on other sites More sharing options...
ShimmyShine Posted May 19, 2008 Share Posted May 19, 2008 Why are you putting variables in the $_post? Your doing $_POST["bla$var"]; You could try maybe $_POST["bla".$var]; Not sure if this helps or not, but on a phone that's all I really noticed. Shimmy Link to comment https://forums.phpfreaks.com/topic/106342-trouble-with-_post/#findComment-545042 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.