![]() |
| |||
| PHP configuration help (inline PHP not working)? I am having problems getting inline PHP to work correctly. If I do """ <?php printf("<html><body><p>The time is %s.</p></body></html>", date("g:i a", time())); ?> """ it will print "The time is 10:08 am." However, if I do """ <html><body><p>The time is <?php date("g:i a", time()) ?>.</p></body></html> """ all I get is "The time is ." printed to the screen. What am I missing in either php.ini or http.conf to get this inline php to work correctly. |
| |||
| Hello You had forgotten echo or print command for date Please use <html><body><p>The time is <?php echo date("g:i a", time()) ; ?>.</p></body></html> you can do like follow commands(dont forget ; after any coomand too) <? $var=date("g:i a", time()) ; echo $var; ?> <?=date("g:i a", time()) ;?> <?= means echo(print too) you can use date("g:i a") instead of date("g:i a", time()) ; too. visit this link for date: http://php.net/manual/en/function.date.php and for print: http://php.net/manual/en/function.echo.php Have a good times |
| |||
| I know this is a VERY old post, but it's the first result I got on a Google search with the exact same problem that took a while to figure out. The short_open_tag must be on in your php.ini for <?"This to work"?>. Otherwise, you must use <? echo "This to work"; ?> php.ini short_open_tag = On Hope this helps someone in the future. Mike |
| |||
| Hi, I found this site http://www.slackware.com/config/packages.php from google search .You can find all the solutions of the problems of PHP configuration. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP 5: Configuration file path says c:\windows, but there is no php.ini in there?? | sellinsomestuff | PHP | 3 | 05-17-2008 03:52 PM |
| Default Wii-Mote (remote 1) is no longer working. How do remove Wii-mote 1, & replace with working Wii-mote? | ju | General Discussions | 2 | 03-09-2007 02:31 AM |
| htaccess not working? | veramarose | Web Hosting | 1 | 01-22-2007 05:11 AM |
| ASP.NET Configuration page times out? | graduatehills | Programming | 2 | 03-27-2006 11:05 AM |
| php / apache configuration problem: apache not parsing php correctly? | macca | PHP | 2 | 03-14-2006 07:23 AM |