logicopinion Posted November 15, 2007 Share Posted November 15, 2007 Hello everybody, i am writing simple content menagment for my site, and one thing i can`t get through is that with this code <form action="index.php?p=itm1" method="post"> <input type="text" name="item"> <input type="submit" value="დამატება"> </form> and this <?php include("includes/vars.php"); $item = $_POST['item']; mysql_connect("$hostname", "$username", "$password") or die(mysql_error()); mysql_select_db("$db") or die(mysql_error()); mysql_query("CREATE TABLE IF NOT EXISTS menu( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), item VARCHAR(300)) ") or die(mysql_error()); mysql_query("INSERT INTO menu (item) VALUES('$item')") or die(mysql_error()); echo "$item"; echo "successfull"; ?> i create new item which appears in main menu on the left side.. so it works fine.. but, how can make this script to create "filename.php" file to which new ITEM from menu will be linked.. (exaple: if i create new item called some new item and after creation i hit this button it must have some page to redirect right?) so when creating ITEM i also have to creat page to redirect to it when pressed this button. how should i do that ? i know its about fopen function or something similar to it, is not it? please give me some advice about that. thanks a lot Link to comment https://forums.phpfreaks.com/topic/77448-php-page-creation/ Share on other sites More sharing options...
axiom82 Posted November 15, 2007 Share Posted November 15, 2007 Add a field in the `menu` table for the link to the page it will redirect to. Link to comment https://forums.phpfreaks.com/topic/77448-php-page-creation/#findComment-392062 Share on other sites More sharing options...
logicopinion Posted November 15, 2007 Author Share Posted November 15, 2007 no, i mean how to create that page, where i want to redirect current ITEM Link to comment https://forums.phpfreaks.com/topic/77448-php-page-creation/#findComment-392063 Share on other sites More sharing options...
axiom82 Posted November 15, 2007 Share Posted November 15, 2007 are you trying to create a text editor? than yes, use fopen and fread to insert the file text into a textarea object. Link to comment https://forums.phpfreaks.com/topic/77448-php-page-creation/#findComment-392066 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.