Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

what's wrong with this PHP script

Posted on 2012-03-30
15
Medium Priority
?
238 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 84

Accepted Solution

by:
Dave Baldwin earned 336 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 336 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 332 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Assisted Solution

by:rinfo
rinfo earned 332 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 332 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 84

Expert Comment

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

Assisted Solution

by:Ray Paseur
Ray Paseur earned 332 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 111

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 111

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
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 a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

963 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