well, ive been working on it, and it now says this(im going to show all):
<html>
<head><title>Kim's Jewelry Shop=ADD Listing</title></head>
<body>
<?php
$id = mt_rand(1001, 1000000);
import_request_variables( "g", "v" );
include("mysql.txt");
###########Check to See user input exists##############################
if ( empty( $vaddname ) ) {
DIE("<b><i>ERROR</i>--No input in \"Name\" field</b><br>
Click <a href=\"update.php\">here</a> to go back<br>"); }
if ( empty( $vaddcost ) ) {
DIE("<b><i>ERROR</i>--No input in \"Cost\" field</b><br>
Click <a href=\"update.php\">here</a> to go back<br>"); }
if ( empty( $vadddesc ) ) {
DIE("<b><i>ERROR</i>--No input in \"Description\" field</b><br>
Click <a href=\"update.php\">here</a> to go back<br>"); }
if ( empty( $vaddpic ) ) {
DIE("<b><i>ERROR</i>--No input in \"Picture\" field</b><br>
Click <a href=\"update.php\">here</a> to go back<br>"); }
###########Add to MySQL################################################
$sql = "INSERT INTO product ( name, picture, cost, desc, SOLD, iD )
values ( '$vaddname', '$vaddpic', '$vaddcost', '$vadddesc', 'n', $id )";
mysql_query( $sql, $link ) or DIE("<b><i>ERROR</i>--Could not insert data into table</b>");
###########Message Show on Screen######################################
print("Now creating page...<br>");
print("Item name is <b>$vaddname</b><br>");
print("Item price is <b>\$$vaddcost</b><br>");
print("Description is <b>$vadddesc</b><br>");
print("To visit newest listing, click <a href=\"$id.php\">here</a><br>");
print("To return to the updates, click <a href=\"update.php\">here</a><br>");
print("To access the stock menu, click <a href=\"stock.php\">here</a><br>");
###########Writing to file#############################################
//Create File
touch( "$id.php" ) or DIE("<b><i>ERROR</i>--Could Not Create File</b><br>");
//Open File
$filep = fopen( "$id.php", "w" ) or DIE("<b><i>ERROR</i>--Could Not Open File</b><br>");
//Lock File NOT NEEDED
//Writing File
fwrite( $filep, "<html>\n
<head><title>Kim's Jewelry Shop=ID:$id</title></head>\n\n
<body>\n
<?php
include(\"mysql.txt\");
print(\"<h2 align=\\"center\\">\");
mysql_query( \"SELECT name FROM product WHERE id='$id'\", $link ) or DIE(\"Error on page. Could be a server problem.\");
print(\"</h2>\");
print(\"<br><br>\");
?>
</body>\n
</html>" )
or DIE("<b><i>ERROR</i>--Could Not Write To File</b><br>");
//Unlock File NOT NEEDED
//Close File
fclose( $filep ) or DIE("<b><i>ERROR</i>--Could Not Close File</b><br>");
mysql_close;
?>
</body>
</html>
for some reason, it always says that it cant add the data into the table...
i think the original error for the file write was something about an invalid T_STRING when writing to file, but it actually made the file, but it was blank