Appreciate some help with a PHP form

Hi guys,

Thanks in advance for your help. I know very very basic PHP and am trying to do a simple form to help with some work I have.

Basically what I am trying to do is input some text into a text field, and it shows in a separate area in the same page. Of course, ideally if it could be done in real-time it would be great, but for now I’ll settle with just submitting the fields to the same php file and echoing from there. (Hope this is clear)

This is the code I’m using (rewritten for context):

Filename: thisform.php (hence the form sends to itself)

[code]

Headline:
Call to action:

This is the headline: [php]<?php echo $_POST["headline"]; ?>[/php]
This is the call to action: [php]<?php echo $_POST["calltoaction"]; ?>[/php]

[/code]

When I submit the form, nothing happens. My address bar shows “/thisform.php?headline=asdfasdf&calltoaction=asdfasdf” but the body shows where it should be.

Please help! Many many many thanks.

Update: PROBLEM SOLVED! Lol I was saving the code into a local file and opening it with my browser directly. No wonder the code didn’t work, I need PHP installed in order to send PHP code for processing. Major facepalm!

Thanks for reading. Topic closed.

Ha! You can download software such as WAMP that will allow you to run PHP on your localhost.

Sponsor our Newsletter | Privacy Policy | Terms of Service