I am confused little bit.. Can anybody guide me "how to add html code between php code ? I tried to add html code directly but gives smarty errors.. Any way to do that ?
If I had - <?php echo 'hi'; ?> it would display - hi If I had - <?php $var = 'Daniel'; echo 'Hello, '.$var.'.'; ?> it would display - Hello, Daniel.
the easiest way to do it is just basically close your php tag ?> ... and then write your html code then open a new php tag <?php <html> <head> </head> <body> <?php code ?> text <?php code2 ?> </body> </html> (your php tags don't have to be in the body) http://www.killersites.com/PHP/find_PHP_host_step2.jsp
@prise... are you ok? Returning to PHP: Using Variables in PHP will be easier if done like this: <?php $var = "Value"; echo "<h3 align=\"center\">Here you will read the Value of the variable:</h3><p align=\"center\">$var</p>"; ?> Code (markup): Using a variable inside ' can be frustrating because you need to use dots to connect it while it will be linear using the " . Other example to show the difference: <?php $var_a = "YoGem"; $var_b = date("d"); $var_c = date("m"); $var_d = date("Y"); //Case 1 echo "<p>$var_a said that today is day $var_b of month $var_c of year $var_d.</p>"; //Case 2 echo '<p>'.$var_a.' said that today is day '.$var_b.' of month '.$var_c.' of year '.$var_d.'.'; ?> Code (markup): Both will return the same thing but... which is the best and easy method? ^_^