Forum Moderators: coopster

Message Too Old, No Replies

jmp goto? in PHP

How to jump through the page

         

aspr1n

1:22 am on Nov 17, 2002 (gmt 0)

10+ Year Member



Hi all,

I am looking for a way of exiting from my current PHP braces, and jumping back in further down the page.

There's loads of html in between the two PHP sections, and exit; obviously won't work.

Cheers,

asp

andreasfriedrich

1:34 am on Nov 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Surround the current block you want to leave with a loop or switch construct and then break from that where you want to jump down.

switch($x) { 
default:
// current PHP braces, ie. your code
break; // if you want to leave this block
}

Andreas

Lisa

3:40 am on Nov 17, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



function call1(){
echo "Why not ";
}

function call2(){
?>functions.<BR>
<BR>
This would be the easiest way.<BR><?
}

function call3(){
echo "put your html in ";
}

call1();
call3();
call2();