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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.