i need to create a variable called $obj from the "table" i get from this:
//get table info
$query = "SELECT * FROM `objects`;
if($result = mysql_query($query)) {
while ($row = mysql_fetch_array ($result)) {
//print table info
print "<tr><td class=\"border2\" align=center height=30><a href=" . $row["url"] . " target=tv>". $row["name"] . "</a></td><td class=\"border2\" align=center height=30>" . $row["descr"] . "</td><td class=\"border2\" align=center height=30>" . $row["cat"] . "</td></tr>";
}// end while
}// end if
so then i can create a file inserting all that object into a file
$obj = $_POST['obj'];
$file_directory = "/home/user/public_html/url/place/"; //the directory you want to store the new file in
$file_name = strip_tags("obj".$id[0]);//the file's name, stripped of any dangerous tags
$file_ext = strip_tags(".html"); //the file's extension, stripped of any dangerous tags
$pagename = $file_directory.$file_name.$file_ext; //this is the entire filename
$page = $file_name.$file_ext;
if (file_exists($pagename)) // check if page already exists
{
echo "Page already exists"; // if it exists, tell the user.
}
else // if the page doesn't exist, create it.
{
$f1 = fopen($pagename, "w+"); //create the new file
$chmod = chmod($pagename, 0644); //set the appropriate permissions.
$top = ('<html><head></head><body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 leftmargin=0 rightmargin=0>');
$bot = ('</body></html>');
$pagecontent = stripslashes($top.$obj.$bot); // the page content
fputs($f1, $pagecontent); // add the content to the page
fclose($f1); // close the page (file)
include('dbadd.php');
print "Your object at ".$url." has been successfully added to the popup listing.<br>";
}//end else
}
anyone know what a girl needs?
lilRachie