Login | Register | FAQ
Anonymous

echo several times into the same row

+ Post a reply

5 posts Page 1 of 1


echo several times into the same row

by Wieisses » Sat May 19, 2012 2:41 pm

Hello,
how can I manage this in PHP: I want to write a text onto the screen and after a pause want to overwrite the text on the same place of the same row by another text. I tried this:

echo "please wait"."<br>";
sleep (4);
echo "done ";

But (as could be expected), "done" is always written BELOW "please wait" instead of replacing it.

How can I "reposition" the echo output?
Someone told me, for this I should use something called "Ajax". But I refuse to learn complete new stuff for such a stupid task.
Any suggestion to solve this by ordinary PHP ?
User avatar

Wieisses

  • Posts: 2
  • Joined: Sat May 19, 2012 2:16 pm

Re: echo several times into the same row

by XainPro » Sat May 19, 2012 7:30 pm

User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: echo several times into the same row

by Wieisses » Sun May 20, 2012 2:56 pm

Thank you for the suggestion. For me as a PHP newbee it looks very complicated. Your example worked fine, but I did not really got why.
Also I do not want to worry my customers (most of them silver-agers) by Javascript, which may not work on some computers or browsers.

If there exists no simplier solution, I will better stay with what I have: two texts in two different rows.
User avatar

Wieisses

  • Posts: 2
  • Joined: Sat May 19, 2012 2:16 pm

Re: echo several times into the same row

by XainPro » Mon May 21, 2012 5:41 am

Well that was old story now a days each and every browser support java script.
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm

Re: echo several times into the same row

by soccerwebsitemaker » Wed May 23, 2012 10:22 am

But javascript can also be blocked (to prevent pop up pages and stuff), so you may want a 'noscript' tag in your HTML:

<noscript>You need Javascript to see this</noscript>


That will tell only Javascript blocked users to turn on Javascript momentarily...
User avatar

soccerwebsitemaker

  • Posts: 138
  • Joined: Sat Dec 31, 2011 6:25 pm
--
Coins. Profile. Games. Chat. Fun.

CoinAwards.

Check it out at


+ Post a reply

Page 1 of 1