Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 4th, 2006, 12:47 PM
Friend of Wrox
 
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default php tags in form visible

Hi,

I just installed php 5.2 with IIS on my computer. All works just fine but there is something really strange with my form pages.
When i have a code that looks something like the following my php source becomes visible in the input tag.

Code:
<?php
$myPhpString="this is a string";
?>
<form>
    <input value="<?=$myPhpString?>" />
</form>
So in my browser i can see "<?=$myPhpString?>" in my text field instead if seeing "this is a string" in my textfield.

Anyone have any ideas what this could be.

__________________________________________________ ________
This is my junk I'm gona eat it
 
Old November 8th, 2006, 11:59 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hai,
In php 5.2 you have to use like this,
<?php
$myPhpString="this is a string";
?>
<form>
    <input value="<?php echo $myPhpString?>" />
</form>


surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old November 9th, 2006, 10:19 AM
Friend of Wrox
 
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply,

Someone gave me a different solution to my problem. I had to enable my short tags in my php.ini file. now i can use the <?=?> syntax

__________________________________________________ ________
This is my junk I'm gona eat it
 
Old November 10th, 2006, 07:09 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
how did you enable? can you please explain me.

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old November 10th, 2006, 08:22 AM
Friend of Wrox
 
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

It's pretty easy to enable short tags actually. Open your php.ini filen and look for the following line.
Code:
short_open_tag = off
turn this to on and your done.

__________________________________________________ ________
This is my junk I'm gona eat it





Similar Threads
Thread Thread Starter Forum Replies Last Post
visible vs. not visible on form akibaMaila VB.NET 2002/2003 Basics 2 August 15th, 2005 02:40 PM
Is it possible to have 2 FORM tags? vanjamier Classic ASP Components 12 January 27th, 2005 06:55 PM
How do you make a label visible in a form Brian263 Access 2 March 19th, 2004 03:32 PM
strip html tags & PHP trangd Beginning PHP 6 October 21st, 2003 10:28 AM
PHP & Strip tags trangd Pro PHP 1 October 20th, 2003 12:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.