|
|
|
|
![]() ![]() |
Nov 17 2006, 08:24 AM
Post
#1
|
|
|
Hidden Secrets can't be told threw just words. One must feel what the other feels to truely understand... ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,523 Joined: 8-January 06 From: Sacramento California Member No.: 16,756 |
Ok,
what i am looking for would be a script, that has a page set-up similar to this http://www.hogwartsmagic.net/test.php But, what i want it to do, is when i type in the Name: box, that will be the file name to a new file on my site. and whatever i put in the Content: box, will be the content that is put inbetween he top part of my sites HTML, and the bottom part of my sites HTML... and it would automatically have the HTML pre-set into the code, and easy for me to change it if i change layouts. it's kind of hard to explain, but if you dont undertand please let me know. I know there are scripts out there, but i dont know where i can find them./what to call them >_< so it would kind of be like this QUOTE <HTML> <HEAD> <TITLE>.:Hogwarts Magic:. Where Real Magic Is Possible!</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <META NAME="author" CONTENT="Phillip Morehead"> <META NAME="copyright" CONTENT="© Phillip Morehead 2006 All Rights Reserved"> <META NAME="keywords" CONTENT="Harry ginny ,Ron hermione,Scripts,Hex, Articles, muggle tower, quotes, quiz, bio , Scripts ,harry potter, jk rowling ,Daniel , Emma , Hex , Hexie , magic, quidditch, wizards, witches, hogwarts, the sorcerer's stone, Dobby , Sana , Potter , scholastic, bloomsbury, warner bros., daniel radcliffe, rupert grint, emma watson, tom felton Sorcerer's Stone, Chamber of Secrets, Prisoner of Azkaban, Goblet of Fire, Order of the Phoenix, Half Blood Prince, Quidditch"> <META NAME="description" CONTENT="Hogwarts Magic is your source for all of your Harry Potter needs, whether it be Harry Potter Pictures, or magical spells, everything related to harry potter can be located here at Hogwarts Magic!"> <META NAME="rating" CONTENT="general"> <link rel="stylesheet" href="site_files/css.css" type="text/css"> </HEAD> <BODY text="#FFFFFF" bgcolor="#000000" topmargin="0" leftmargin="0" rightmargin="0"> <CENTER> <table width="100%" cellspacing="0" cellpadding="0" bgcolor="#000000" border="0"> <tr> <td align="center" colspan="1"><img src="images/layout_images/top.jpg" width="900" height="298" border="0"></td> </tr><tr> <td align="center" colspan="1"> <table align="center" cellspacing="0" cellpadding="0" background="images/layout_images/fill.jpg" border="0"><tr> <td align="right" valign="top" width="199"> <table width="80%" cellspacing="0" cellpadding="4" border="0"> <tr><td align="center" valign="top"><?php include("site_files/menu.html"); ?> </td> </tr></table></td> <td align="center" valign="top" width="507"> <table width="100%" cellspacing="0" cellpadding="5" border="0"> <tr><td align="center" valign="top"> READ THIS HERE WOULD BE THE STUFF THAT I PUT IN THE CONTENT: BOX ON THAT FORM <br><br>Hogwarts Magic is not an offical Harry Potter website, as much as we wish we were. Hogwarts Magic is in no way Affiliated with J.k. Rowling, Warner Brothers, Or Schoolastic Inc. </td> </tr></table></td> <td valign="top" width="194"> <table width="80%" cellspacing="0" cellpadding="4" border="0"> <tr><td align="center" valign="top"><?php include("site_files/bottom.html"); ?> </td> </tr></table></td> </tr></table></td> </tr><tr> <td align="center" colspan="1"><img src="images/layout_images/bottom.jpg" width="900" height="48" border="0"></td> </tr></table> <FONT face="Arial,Verdana" size=2><I>Template created by <a href="http://websetsbydonna.com/" target="_top">Web Sets by Donna</a> ©2006</I></font><br><br> </CENTER> </BODY> </HTML> and whatever i put the File name: as, it would save it to the server as for example index.php if i put index.php in the File name area..... this is all that i want it to do. i dont want to be able to edit other files or anything else.... |
|
|
|
Nov 17 2006, 08:51 AM
Post
#2
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 65 Joined: 7-July 05 Member No.: 9,139 |
I think I understand what you sre saying. You want to basically type in the filename box eg. eg.html then the contents eg
HTML <html ><body><h2>test</h2></body></html> Then you want to write this to a new file? with the contens in it, and the filename is specified to the one you set ok? |
|
|
|
Nov 17 2006, 09:02 AM
Post
#3
|
|
|
Hidden Secrets can't be told threw just words. One must feel what the other feels to truely understand... ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,523 Joined: 8-January 06 From: Sacramento California Member No.: 16,756 |
no, i would like for the
CODE <html> <head> </head> <body> </body> </html> i just want to be able to put content in the textbox, and have it automatically put in the correct table. but the rest you have is correct yes. |
|
|
|
Nov 17 2006, 09:05 AM
Post
#4
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 65 Joined: 7-July 05 Member No.: 9,139 |
no, i would like for the CODE <html> <head> </head> <body> </body> </html> i just want to be able to put content in the textbox, and have it automatically put in the correct table. but the rest you have is correct yes. ok I will sort it out, you will need php functionability on your server to make this work. You basically need to use the touch command then the fwrite function to wite the contents to the file. You will need to use the POST superglobal as well. |
|
|
|
Nov 17 2006, 12:40 PM
Post
#5
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 65 Joined: 7-July 05 Member No.: 9,139 |
try this out:
CODE <? if ($_POST[check] =="1"){ if ($_POST[Message] =="" AND $_POST[name] ==""){ header("Location: test.php?error=nm"); exit; }else if ($_POST[name] ==""){ header("Location: test.php?error=n"); exit; }else if($_POST[Message] ==""){ header("Location: test.php?error=m"); exit; }else{ } touch("$_POST[name].php"); $r = $_POST[name].'.php'; $fh = fopen($r, 'w') or die("Error!!"); fwrite($fh, "<html>\n"); fwrite($fh, "<head>\n"); fwrite($fh, "</head>\n"); fwrite($fh, "<body>\n"); fwrite($fh, "$_POST[Message]\n"); fwrite($fh, "</body>\n"); fwrite($fh, "</html>\n"); ?> <? }else if ($_POST[check] !="1"){ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- saved from url=(0037)http://www.hogwartsmagic.net/test.php --> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> <form name="form1" method="post" action="<? $_SERVER['PHP_SELF'] ?>"> <META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD> <BODY> <p><B>File Name:</B> <INPUT size=40 name=name> <BR> <BR> <BR> <B>Content:</B> <TEXTAREA name=Message rows=7 cols=40></TEXTAREA> <input type="hidden" name="check" value="1"> </p> <input type="submit" name="Submit" value="Submit"> <? if ($_GET[error] =="nm"){ $error = "Please enter a message and a filename"; }else if ($_GET[error] == "n"){ $error = "Please enter a filename"; }else if ($_GET[error] =="m"){ $error = "Please enter some content"; } ?> <font color="#FF0000"><? echo $error; ?></font> </form> </FORM> </BODY></HTML> <? }else{ } ?> Also save this as test.php This post has been edited by truefusion: Nov 18 2006, 12:45 AM |
|
|
|
Nov 18 2006, 12:16 AM
Post
#6
|
|
|
Hidden Secrets can't be told threw just words. One must feel what the other feels to truely understand... ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,523 Joined: 8-January 06 From: Sacramento California Member No.: 16,756 |
i get this error
CODE Warning: touch() [function.touch]: Unable to create file testingthis.php.php because Permission denied in /home/albus/public_html/test.php on line 24 Warning: fopen(testingthis.php.php) [function.fopen]: failed to open stream: Permission denied in /home/albus/public_html/test.php on line 26 Error!! and nowhere in this do i see the HTML to my layout >_< |
|
|
|
Nov 18 2006, 12:52 AM
Post
#7
|
|
|
Ephesians 6:10-17 ![]() Group: [MODERATOR] Posts: 1,916 Joined: 22-June 05 From: The World of Gentoo Member No.: 8,528 |
I'm guessing permission denied cause you don't have public_html chmodded to 777. According to what i read in the first post, you want the script to create a file for you with a specified template. You can't do so without chmodding the folder that the "test.php" file is in, to 777. You'd be better off just having the script add the stuff from the Content field, and just display the HTML on submit. Then copy, and manually create, and paste into a new file.
|
|
|
|
Nov 18 2006, 01:35 AM
Post
#8
|
|
|
Hidden Secrets can't be told threw just words. One must feel what the other feels to truely understand... ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,523 Joined: 8-January 06 From: Sacramento California Member No.: 16,756 |
well then there would be no point in doing that >_< because that is what i am currently doing, and it's just too bothersome
|