Orionsbelter Posted October 19, 2011 Share Posted October 19, 2011 hi i'm trying to create a php file from a script but i dont seem to be getting it right the file doesn't exist already am trying to create it. <title>test</title> <?php include_once"includes/db_connect.php"; $sql=mysql_query("SELECT `urlName` FROM `products` WHERE `category`='1'"); while($fetch=mysql_fetch_object($sql)){ $File = "".$fetch->urlName.".php"; $handle = fopen($File, 'w'); fclose($handle); } ?> Quote Link to comment Share on other sites More sharing options...
requinix Posted October 20, 2011 Share Posted October 20, 2011 Forget the idea. You have the wrong solution to your problem. Look into something called URL rewriting instead. It's a process that turns URLs like "big-blue-chair.php" into ones like "showproduct.php?product=big-blue-chair". No silly nonsense of creating PHP actual files. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.