bnther Posted June 6, 2009 Share Posted June 6, 2009 I've just started using PHP for my menu bars and I've quickly come to love it. I'm looking to expand my use of PHP to include text fields. I'm doing volunteer work for the local chamber of commerce. It is great to get some experience, but I'm beginning to feel as if I'm on staff with the regular updates. I would like to build a form where the paid staff can type in their announcements press send and have it update on the website. I've done a contact form before for e-mail so I'm a little familiar with some things. What I would like is a tutorial recommendation, video if possible, that will walk me through the process. I'm not looking for a cut and paste, I'm looking to learn the process. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/161180-textfeild-tutorials-from-form-to-page/ Share on other sites More sharing options...
gevans Posted June 6, 2009 Share Posted June 6, 2009 You might find this tutorial from phpfreaks useful http://www.phpfreaks.com/tutorial/php-basic-database-handling/page1 Quote Link to comment https://forums.phpfreaks.com/topic/161180-textfeild-tutorials-from-form-to-page/#findComment-850536 Share on other sites More sharing options...
bnther Posted June 6, 2009 Author Share Posted June 6, 2009 Thank you gevans for the reply. I looked over that tutorial and I'm thinking that might be a little overkill for what I'm looking for. I might be over simplifying it, but it seems to me that what I really need is A) a form with a text area, B) a PHP file to hold the info in a variable, and then finally C) a command in the final web page that would display the info. Is that right or am I off? I've been Goggling like a fool today but I haven't come across anything like that, so maybe it's not really that easy. Quote Link to comment https://forums.phpfreaks.com/topic/161180-textfeild-tutorials-from-form-to-page/#findComment-850616 Share on other sites More sharing options...
gevans Posted June 6, 2009 Share Posted June 6, 2009 If you don't want to use a db you could create a file to save it? Write the data to a file, using appropraite seperators, then read the file and output the stored data. Quote Link to comment https://forums.phpfreaks.com/topic/161180-textfeild-tutorials-from-form-to-page/#findComment-850617 Share on other sites More sharing options...
.josh Posted June 6, 2009 Share Posted June 6, 2009 Thank you gevans for the reply. I looked over that tutorial and I'm thinking that might be a little overkill for what I'm looking for. I might be over simplifying it, but it seems to me that what I really need is A) a form with a text area, B) a PHP file to hold the info in a variable, and then finally C) a command in the final web page that would display the info. Is that right or am I off? I've been Goggling like a fool today but I haven't come across anything like that, so maybe it's not really that easy. google for a page hit counter tutorial (you know, like the ones that say "this page was viewed x times"). aside from the form part, which i'm sure you can easily figure out, a page hit counter tutorial is essentially the same thing. Quote Link to comment https://forums.phpfreaks.com/topic/161180-textfeild-tutorials-from-form-to-page/#findComment-850626 Share on other sites More sharing options...
bnther Posted June 6, 2009 Author Share Posted June 6, 2009 Thanks for the help. Here's what I've managed so far: InputForm.php <div id="formHolder"> <form name="form1" method="post" action="Output.php"> <table width="100%" border="0" cellspacing="0" cellpadding="6"> <tr> <td><div align="right"> <label for="comments">Comments:</label> </div></td> <td><div align="left"> <textarea name="comments" id="comments" cols="26" rows="5"></textarea> </div></td> </tr> <label>Submit <input type="submit" name="submit" id="submit" value="Submit" /> </label> </form></div> includes/FormProcess.php <?php /* variables */ $commentsField = $_POST['comments']; echo 'hello world 2'; ?> Output.php <body> <?php include_once('includes/FormProcess.php'); ?> </body> It's been pretty successful at saying 'Hello World 2' , but I'm not getting the comments passed. I don't know the correct way of getting the variable to display. $commentsField; doesn't do it by itself. I'll take a look for some page counter tutorials and see what I can come up with. Also, I am interested in eventually going the database route (if I could find a good video). I could definitely put to use something like that where I can upload images along with a brief description. At the moment, my galleries have all been html or Flash/XML ie; I'm the only one that can change them. It'd be nice to let the users monkey with that instead of reinstalling a backup copy after things didn't work out. Quote Link to comment https://forums.phpfreaks.com/topic/161180-textfeild-tutorials-from-form-to-page/#findComment-850666 Share on other sites More sharing options...
bnther Posted June 7, 2009 Author Share Posted June 7, 2009 I got it The correct syntax for includes/FormProcess was echo "$commentsField"; It doesn't display worth a darn, but this is a start! My thanks to all that replied. Today was a learning experience. Quote Link to comment https://forums.phpfreaks.com/topic/161180-textfeild-tutorials-from-form-to-page/#findComment-850750 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.