Solved

what's wrong with this PHP script

Posted on 2012-03-30
15
225 Views
Last Modified: 2012-04-03
<form action="page3-belief-audit" method="post">
<?php echo $_POST["belief1"] ?> because I <input type="text" size="100" name="becauseI" /></input>
<?php echo $_POST["belief1"] ?> after I <input type="text" size="100" name="afterI" /></input>
<?php echo $_POST["belief1"] ?> before I <input type="text" size="100" name="beforeI" /></input>
<?php echo $_POST["belief1"] ?> when I <input type="text" size="100" name="whenI" /></input>
<?php echo $_POST["belief1"] ?> as I <input type="text" size="100" name="asI" /></input>
<?php echo $_POST["belief1"] ?> although I <input type="text" size="100" name="althoughI" /></input>
<?php echo $_POST["belief1"] ?> so that I <input type="text" size="100" name="sothatI" /></input>
<input type="submit" />
</form>

It's putting text inside the box, I attached what it looks like when the page loads
ee1.gif
0
Comment
Question by:weikelbob
  • 3
  • 3
  • 2
  • +4
15 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 84 total points
Comment Utility
The first thing is that that textarea is not in the list you posted above.  Matter of fact, I don't see that any of what you posted is in that pic.
0
 
LVL 7

Assisted Solution

by:designatedinitializer
designatedinitializer earned 84 total points
Comment Utility
the attached image cannot be the result of the script snippet you posted.
Will you check that and post again?
0
 
LVL 2

Assisted Solution

by:DangItMarilyn
DangItMarilyn earned 83 total points
Comment Utility
It looks to me like you didn't close your text area tag or closed it with an open <br> between.

Of course that's not evident in the code you posted, it's just a guess.
0
 
LVL 9

Assisted Solution

by:rinfo
rinfo earned 83 total points
Comment Utility
Yes it definitely having a <Br> in the textarea description .
The reason i suppose is you wants to break value for textarea in to particular lines.
So for displaying string linewise you have added <br> before post array  and that is not the way to do it.
Or maybe you wanted to have some space before the textarea but some how it is included in the textarea declaration.
0
 
LVL 10

Assisted Solution

by:acbxyz
acbxyz earned 83 total points
Comment Utility
Unlike input elements, textarea is not self-closing.
<textarea name="belief1"></textarea>
0
 
LVL 7

Expert Comment

by:designatedinitializer
Comment Utility
this is hard to debug because you haven't provide us the necessary information (your screenshot is NOT the result of the code you posted).
However, you have a big mistake in your listing that so far as gone unnoticed.
You can't use this:

<input type="text" size="100" name="becauseI" /></input>

You either use this:
<input type="text" size="100" name="becauseI" />

OR this:
<input type="text" size="100" name="becauseI" ></input>

This looks the same as what you've got, but notice the slash...
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Until we get a response from the author, we're just guessing here.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 83 total points
Comment Utility
Please post the actual URL of the HTML form page.  Then we can use "view source" to see what the HTML contains.  After the form has been posted you can add these three lines to the top of your PHP action script and you will be able to see what the HTML form sends to the action script.
echo "<pre>";
var_dump($_POST)
;echo "</pre>";

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
Crap.  EE code snippet editor bites again.
echo "<pre>";
var_dump($_POST);
echo "</pre>";

Open in new window

0
 
LVL 7

Author Comment

by:weikelbob
Comment Utility
Woops, wrong code:

<form action="page2-belief-audit" method="post">
<textarea name="belief1" rows="5" cols="100">
</textarea>
<input type="submit" />
</form>
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
What are we to make of that?  It would be so much easier to help you if you would work with us here.  We need to see the HTML of the entire web page.  What we have seen so far cannot possibly cause the issue shown in the GIF image.  Something else is in play.  It's unreasonable for us to guess when you have the code in front of you and we cannot see it.
0
 
LVL 9

Expert Comment

by:rinfo
Comment Utility
I entirely agree with Ray .
From this
   Woops, wrong code:

<form action="page2-belief-audit" method="post">
<textarea name="belief1" rows="5" cols="100">
</textarea>
<input type="submit" />
</form>
its amply clear that problem is somewhere else and not in this form declaration.
0
 
LVL 2

Expert Comment

by:DangItMarilyn
Comment Utility
Perhaps it's a proprietary page you don't want to share? Maybe you should look at anything that isn't "static" that includes the </ br> code that could be showing up in the area or if there is something from the way the page loads that populates the "belief1" field pre-load as if it was being submitted to the page.

Again, I'm just trying to steer you in the right direction since the page seems to be something you'd rather not share.
0
 
LVL 7

Author Comment

by:weikelbob
Comment Utility
I got this. It was in wordpress and I was working with a plugin that put PHP inside of the wordpress admin, so I didn't have direct access to the full code (though I could have gone View-> source.

Since it was in wordpress, a space and line break between <textarea> and </textarea> was showing up as a <br />

I want to apologise that I did not ask the correct question. You guys are always so helpful.

I will be more careful and thorough next time.

Thank You,

Bob
0
 
LVL 2

Expert Comment

by:DangItMarilyn
Comment Utility
Glad you got it figured out :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now