View Full Version : echo problem

03-02-2008, 03:45 PM
hi david,

you know when you have the echo thing in php it shows a message at the top of the window, how can i put it wherever i want?

03-02-2008, 06:55 PM
assign the string to a variable then place the variable and echo it where you want it in the page

<?php echo $variable; ?>

03-02-2008, 07:07 PM
bt its as an else if statement so elseif echo......

03-02-2008, 07:11 PM
ok i've changed the elseif 2 <?PHP if($submitted){
echo $error;
}?> and put it where i want so its within the html coding..........that ent going to cause me ne problems is it?

03-02-2008, 07:20 PM
its best to try and keep your logic seperate

above the HTML tag (inside the php)


$error = "error1 text";


$error = "error2 text";


inside the html

<?php echo $error; ?>

03-02-2008, 07:32 PM
yh i did something similar but had the else if as jus if and put that with the html bt ur method seems logical so ive changed it now. cheers