Jump to content

trouble with $_POST[''];


ueon

Recommended Posts

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

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.