Jump to content

Server not parsing my php?!???


28rain

Recommended Posts

Im using nearlyfreespeech.net and when i try and parse a .php file in my ftp url I dont think it parses

This is the script;

<?
if((!$_POST['table_name']) || (!$_POST['num_fields'])) {
header( "Location: show_createtable.html");
exit;
}
$form_block ="<FORM METHOD=\"POST\" ACTION=\"do_createtable.php\">
<INPUT TYPE=\"hidden\" NAME=\"table_name\" VALUE=\"$_POST[table_name]\">
<TABLE CELLSPACING=5 CELLPADDING=5>
<TR>
<TH>FIELD NAME</TH><TH>FIELD TYPE</TH><TH>FIELD LENGTH</TH></TR>";
for ($i = 0; $i <$_POST['num_fields']; $i++) {
$form_block .= "
<TR>
<TD ALIGN=CENTER><INPUT TYPE =\"text\" NAME=\"field_name[]\" SIZE=\"30\"></TD>
<TD ALIGN=CENTER>
<SELECT NAME =\"field_type[]\">
<OPTION VALUE =\"char\">char</OPTION>
<OPTION VALUE =\"date\">date</OPTION>
<OPTION VALUE = \"float\">float</OPTION>
<OPTION VALUE = \"int\">int</OPTION>
<OPTION VALUE =\"text\">text</OPTION>
<OPTION VALUE =\"varchar\">varchar</OPTION>
</SELECT>
</TD>
<TD ALIGN=CENTER><INPUT TYPE=\"text\" NAME=\"field_length[]\" SIZE=\"5\"></TD>
</tr>";
}
$form_block .= "
<TR>
<TD ALIGN=CENTER COLSPAN =3><INPUT TYPE= \"submit\" VALUE =\"Create Table\"></TD>
</TR>
</TABLE>
</FORM>";
?>
<html>
<head>
<title>Create a database table:Step 2</title>
</head>
<body>
<h1>Define fields for; <? echo "$_POST[table_name]"; ?></h1>
<? echo "$form_block"; ?>
</body>
</html>

 

and my outcome looks like this with just one set of input boxes showing;

"; for ($i = 0; $i <$_POST['num_fields']; $i++) { $form_block .= " "; } $form_block .= "
FIELD NAME	FIELD TYPE	FIELD LENGTH

"; ?>
Define fields for; 

 

The host uses apache cgi and php 5.0 and my mysql database has been set up

Link to comment
https://forums.phpfreaks.com/topic/145902-server-not-parsing-my-php/
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.