Solved

what's wrong with this PHP script

Posted on 2012-03-30
15
231 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 83

Accepted Solution

by:
Dave Baldwin earned 84 total points
ID: 37789646
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
ID: 37789647
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
ID: 37789669
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
ID: 37790688
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
ID: 37791072
Unlike input elements, textarea is not self-closing.
<textarea name="belief1"></textarea>
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37791128
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 83

Expert Comment

by:Dave Baldwin
ID: 37791257
Until we get a response from the author, we're just guessing here.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 83 total points
ID: 37793181
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
ID: 37793183
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
ID: 37797345
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
ID: 37797393
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
ID: 37799317
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
ID: 37801199
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
ID: 37803224
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
ID: 37803311
Glad you got it figured out :)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
This article discusses four methods for overlaying images in a container on a web page
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

914 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

17 Experts available now in Live!

Get 1:1 Help Now