I am trying to set a site that has an option for the user to create a one page site for themselves but I just want them to fill out a form that specify's what they want and then when they submit it, the page is created for them........ Can I do that? and will I use perl or PHP? or maybe something else? Your help is appreciated!!!!
JamesYes. It is doable.
You can use PHP, ASP, PERL, Coldfusion and a slew of other Server-side programming languages.
You could use a database to keep track of what pages belong to which users and that sort of stuff but it's not necessary.
What you should do is go to your web host and find out what Server-side languages they support and if they support a database of any sort and then you can come back here with a better idea of what you can and cannot do and we will be better able to assist you.
goodness, that last line brings me back to the days of working on the help Desk
Talk to ya soon I will be using PHP then and I have access to MySQL so if maybe you guys could point me to a tutorial or something I would really appreciate it.... Thanks Again.....This thread is now in the PHP forum and these guys here should be able to help you out with that language more than I can
I'd recommend you looking at <!-- w --><a class="postlink" href="http://www.hotscripts.com">www.hotscripts.com</a><!-- w --> for starters and see if there's anything there for that sort of function.very doable but I am affraid you might have to code it yourself.
all you need to do is have the form they fill out made in html, you should be able to do that. then once they submit we can write all what they posted to a file and name it, pretty easy.? php can create web pages, oh wait it must in forums right?PHP itself doesn't create the page. It can print html that does, but it can't do it on it's own.how do you create a page with html? do you mean creating an html file?Creating a page with html........................? html is on the page but html doesnt create it.OK I have searched and could not find anything....how does PHP print HTML and if it can't do it on it's own, what do I need to help it do this???you can have php wirte to a file and then save the contents as html so it will have the extension as .html.
I already told you what to do. look at php.net and look for open() function. it will explain it right there.Did anyone get an actual answer/code to this question?Originally posted by shayta
Did anyone get an actual answer/code to this question?
yes, I already said it
Originally posted by scoutt
you can have php wirte to a file and then save the contents as html so it will have the extension as .html.
I already told you what to do. look at php.net and look for open() function. it will explain it right there.
also look into fwrite()I found some basic code on using PHP to create a text file and writing a forms values to it... Although I get the error:
Warning: fwrite(): supplied argument is not a valid File-Handle resource in /mnt/web_h/d38/s15/b01d3464/www/submit_make_file.php on line 13
Here's the code...
make_file.php:
<?php
// COPYRIGHT Tyler King, <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->, 2003-2004
echo '<form method="post" action="./submit_make_file.php">
<table width="100%" border="1" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor="#CCCCCC" >
<div align="center"><strong><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif">MAKE FILE</font></strong></div></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif">File name:</font></td>
</tr>
<tr>
<td><input name="filename" type="text" size="49"></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif">File Content:</font></td>
</tr>
<tr>
<td><textarea name="content" type="text" size="49"></textarea></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>';
?>
submit_make_file.php:
<?php
// COPYRIGHT Tyler King, <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->, 2003-2004
$file = $_POST["filename"];
$content = $_POST["content"];
$open = fopen($file, 'a+');
fwrite($file, $content);
fclose($open);
echo '<table width="100%" border="1" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor="#CCCCCC">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif"><strong>INFORMATION</strong></font></div></td>
</tr>
<tr>
<td><font color="#00FF00" face="Verdana, Arial, Helvetica, sans-serif">FILE WAS MADE SUCCESSFULLY</font></td>
</tr>';
?>look at the error again.
Warning: fopen("", "r+")
it is empty. your filename never came across through the form you push submit on
JamesYes. It is doable.
You can use PHP, ASP, PERL, Coldfusion and a slew of other Server-side programming languages.
You could use a database to keep track of what pages belong to which users and that sort of stuff but it's not necessary.
What you should do is go to your web host and find out what Server-side languages they support and if they support a database of any sort and then you can come back here with a better idea of what you can and cannot do and we will be better able to assist you.
goodness, that last line brings me back to the days of working on the help Desk
Talk to ya soon I will be using PHP then and I have access to MySQL so if maybe you guys could point me to a tutorial or something I would really appreciate it.... Thanks Again.....This thread is now in the PHP forum and these guys here should be able to help you out with that language more than I can
I'd recommend you looking at <!-- w --><a class="postlink" href="http://www.hotscripts.com">www.hotscripts.com</a><!-- w --> for starters and see if there's anything there for that sort of function.very doable but I am affraid you might have to code it yourself.
all you need to do is have the form they fill out made in html, you should be able to do that. then once they submit we can write all what they posted to a file and name it, pretty easy.? php can create web pages, oh wait it must in forums right?PHP itself doesn't create the page. It can print html that does, but it can't do it on it's own.how do you create a page with html? do you mean creating an html file?Creating a page with html........................? html is on the page but html doesnt create it.OK I have searched and could not find anything....how does PHP print HTML and if it can't do it on it's own, what do I need to help it do this???you can have php wirte to a file and then save the contents as html so it will have the extension as .html.
I already told you what to do. look at php.net and look for open() function. it will explain it right there.Did anyone get an actual answer/code to this question?Originally posted by shayta
Did anyone get an actual answer/code to this question?
yes, I already said it
Originally posted by scoutt
you can have php wirte to a file and then save the contents as html so it will have the extension as .html.
I already told you what to do. look at php.net and look for open() function. it will explain it right there.
also look into fwrite()I found some basic code on using PHP to create a text file and writing a forms values to it... Although I get the error:
Warning: fwrite(): supplied argument is not a valid File-Handle resource in /mnt/web_h/d38/s15/b01d3464/www/submit_make_file.php on line 13
Here's the code...
make_file.php:
<?php
// COPYRIGHT Tyler King, <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->, 2003-2004
echo '<form method="post" action="./submit_make_file.php">
<table width="100%" border="1" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor="#CCCCCC" >
<div align="center"><strong><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif">MAKE FILE</font></strong></div></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif">File name:</font></td>
</tr>
<tr>
<td><input name="filename" type="text" size="49"></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif">File Content:</font></td>
</tr>
<tr>
<td><textarea name="content" type="text" size="49"></textarea></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table>
</form>';
?>
submit_make_file.php:
<?php
// COPYRIGHT Tyler King, <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->, 2003-2004
$file = $_POST["filename"];
$content = $_POST["content"];
$open = fopen($file, 'a+');
fwrite($file, $content);
fclose($open);
echo '<table width="100%" border="1" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor="#CCCCCC">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif"><strong>INFORMATION</strong></font></div></td>
</tr>
<tr>
<td><font color="#00FF00" face="Verdana, Arial, Helvetica, sans-serif">FILE WAS MADE SUCCESSFULLY</font></td>
</tr>';
?>look at the error again.
Warning: fopen("", "r+")
it is empty. your filename never came across through the form you push submit on