logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 03-02-2008, 03:45 PM   #1
moe122
 
Join Date: Feb 2008
Posts: 138
Default echo problem

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?
moe122 is offline   Reply With Quote
Old 03-02-2008, 06:55 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

assign the string to a variable then place the variable and echo it where you want it in the page

PHP Code:
<?php echo $variable?>
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 03-02-2008, 07:07 PM   #3
moe122
 
Join Date: Feb 2008
Posts: 138
Default

bt its as an else if statement so elseif echo......
moe122 is offline   Reply With Quote
Old 03-02-2008, 07:11 PM   #4
moe122
 
Join Date: Feb 2008
Posts: 138
Default

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?
moe122 is offline   Reply With Quote
Old 03-02-2008, 07:20 PM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

its best to try and keep your logic seperate

above the HTML tag (inside the php)

PHP Code:
if($submitted){
 
$error "error1 text";
 
}else{
 
$error "error2 text";
 


inside the html

PHP Code:
<?php echo $error?>
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 03-02-2008, 07:32 PM   #6
moe122
 
Join Date: Feb 2008
Posts: 138
Default

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
moe122 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:24 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com