Jump to content

PHP page creation


logicopinion

Recommended Posts

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

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.