Jump to content

Textfeild tutorials -- from form to page


bnther

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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'  :D, 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. :P

Link to comment
Share on other sites

I got it  ;D

 

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.

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.