We help IT Professionals succeed at work.
Get Started

php wait for print string to be finish before execute 2nd script

bionicblakey
bionicblakey asked
on
922 Views
Last Modified: 2008-03-17
hi, i am using an oscommerce shoppingcart for a client and i am running into trouble...

the script uses a lot of include file.
one script use alot of string concatenation and print out the string at the end of function..

however, i suspect that somehow before it finish print out that string, the program already start to execute the next script.

here is the problem link http://www.gearessentials.com/oscommerce/catalog/
view source and search for 'new_products_eof', u will see </<!-- new_products_eof //-->
and suppose to be </table><!-- new_products_eof //-->

if i add echo $tableBox_string . " ---- " . strlen($tableBox_string); and " ---- " . strlen($tableBox_string) will not even get executed...

however, after the page get load, and i hit refresh, then everything works perfectly...
i believe that something get cache and load it faster which reduce the script runtime and make the script run perfectly...

my question is there anything that i can make the next script wait until the print out statement is finish..

my source code will look something like
echo $tableBox_string;
wait();
.....  //continue running...

Thanks for any help

Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE