Solved

what's wrong with this PHP script

Posted on 2012-03-30
15
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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
 
LVL 110

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 110

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 110

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

624 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