[PHP] help again
I am having big troubles here. I wrote this code just as it said in the manual, and it prints {$beer}'s taste is great;? html head titlePHP Test/title /head body ?php $beer = 'Heineken'; echo h1{$beer}'s taste is great/h1; ? /body /html and if I don't put string into h1 it prints nothing ! I'm kind of confused right now ... (win98, opera 5.12, php installed with installShield) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] help again
All you should need to do is echo H1$beer's taste is great/H1; don't use the braces. -Jbell - Original Message - From: Nikola Veber [EMAIL PROTECTED] To: php forum [EMAIL PROTECTED] Sent: Friday, August 31, 2001 9:38 AM Subject: [PHP] help again I am having big troubles here. I wrote this code just as it said in the manual, and it prints {$beer}'s taste is great;? html head titlePHP Test/title /head body ?php $beer = 'Heineken'; echo h1{$beer}'s taste is great/h1; ? /body /html and if I don't put string into h1 it prints nothing ! I'm kind of confused right now ... (win98, opera 5.12, php installed with installShield) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] help again
echo sends a literal string to the output and eventually evaluates variables that are found inside, so it seems that your instruction should be: echo h1{$beer}'s taste is great/h1; Why it worked with h1 outside, I guess because it was closing some former tag in your code or something like that... Hope this helps (this sentence should be a tag!) Regards, Alex. - Original Message - From: Nikola Veber [EMAIL PROTECTED] To: php forum [EMAIL PROTECTED] Sent: Friday, August 31, 2001 12:38 PM Subject: [PHP] help again I am having big troubles here. I wrote this code just as it said in the manual, and it prints {$beer}'s taste is great;? html head titlePHP Test/title /head body ?php $beer = 'Heineken'; echo h1{$beer}'s taste is great/h1; ? /body /html and if I don't put string into h1 it prints nothing ! I'm kind of confused right now ... (win98, opera 5.12, php installed with installShield) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] help again
Sounds like you want to do : $guiness = 'Thick and Creamy!'; $beer= 'guiness'; print ${$beer}; // Thick and Creamy! Regards, Philip Olson On Fri, 31 Aug 2001, Nikola Veber wrote: I am having big troubles here. I wrote this code just as it said in the manual, and it prints {$beer}'s taste is great;? html head titlePHP Test/title /head body ?php $beer = 'Heineken'; echo h1{$beer}'s taste is great/h1; ? /body /html and if I don't put string into h1 it prints nothing ! I'm kind of confused right now ... (win98, opera 5.12, php installed with installShield) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] help again
The code of your's print's the following : $beer's taste is great;? I'm not sure if there could be a problen in configuring PHP, since the only thing I have done was making html page containing this code. 8/31/01 6:42:02 PM, Andrey Hristov [EMAIL PROTECTED] wrote: html head titlePHP Test/title /head body ?php $beer = 'Heineken'; echo h1$beer's taste is great/h1; ? /body /html Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Nikola Veber [EMAIL PROTECTED] To: php forum [EMAIL PROTECTED] Sent: Friday, August 31, 2001 7:38 PM Subject: [PHP] help again I am having big troubles here. I wrote this code just as it said in the manual, and it prints {$beer}'s taste is great;? html head titlePHP Test/title /head body ?php $beer = 'Heineken'; echo h1{$beer}'s taste is great/h1; ? /body /html and if I don't put string into h1 it prints nothing ! I'm kind of confused right now ... (win98, opera 5.12, php installed with installShield) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] help again
do yourself a favor... create a file, call it something like test.php and add the following to it's contents: /* begin test.php */ ?php phpinfo(); ? /* End test.php */ then, open this page with your browser. if PHP is working, you should see a lot of configuration and version information, and the PHP logo etc if you don't see that, then your installation is broken. - Original Message - From: Nikola Veber [EMAIL PROTECTED] To: Andrey Hristov [EMAIL PROTECTED]; php forum [EMAIL PROTECTED] Sent: Friday, August 31, 2001 11:00 AM Subject: Re: [PHP] help again The code of your's print's the following : $beer's taste is great;? I'm not sure if there could be a problen in configuring PHP, since the only thing I have done was making html page containing this code. 8/31/01 6:42:02 PM, Andrey Hristov [EMAIL PROTECTED] wrote: html head titlePHP Test/title /head body ?php $beer = 'Heineken'; echo h1$beer's taste is great/h1; ? /body /html Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Nikola Veber [EMAIL PROTECTED] To: php forum [EMAIL PROTECTED] Sent: Friday, August 31, 2001 7:38 PM Subject: [PHP] help again I am having big troubles here. I wrote this code just as it said in the manual, and it prints {$beer}'s taste is great;? html head titlePHP Test/title /head body ?php $beer = 'Heineken'; echo h1{$beer}'s taste is great/h1; ? /body /html and if I don't put string into h1 it prints nothing ! I'm kind of confused right now ... (win98, opera 5.12, php installed with installShield) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]