Jump to content

PHP shorthand BAD coding


schawel

Recommended Posts

<input type="text" name="email" size="35" value="" class="input">&nbsp;
<input type="hidden" name="mail_message" value="<?=$message?>">
<input type="submit" name="sendemail" class="input" value=" Send " onClick="return validate();">



I have this code and it looks like shorthand is being used for this. I was handed this code to try and clean it up.

<?=$message?> I don't recog this.

should it be <?php something = $message;?>

I have a whole page full of stuff like this

i.e. ----

<?=$val['fieldname']?>

or

<?=$_GET['id']?>


any ideas?
Link to comment
https://forums.phpfreaks.com/topic/5186-php-shorthand-bad-coding/
Share on other sites

[!--quoteo(post=355995:date=Mar 17 2006, 12:31 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 17 2006, 12:31 PM) [snapback]355995[/snapback][/div][div class=\'quotemain\'][!--quotec--]
The "<?=" is shorthand for "<?php echo "

Just replace "<?=" with "<? echo " and you should be set.

Ken
[/quote]


THANKS!!! u da man!

[!--quoteo(post=355999:date=Mar 17 2006, 12:40 PM:name=schawel)--][div class=\'quotetop\']QUOTE(schawel @ Mar 17 2006, 12:40 PM) [snapback]355999[/snapback][/div][div class=\'quotemain\'][!--quotec--]
THANKS!!! u da man!
[/quote]


ONE more thing

in my question..i sampled this

<?=$message?>

shouldn't there also be a semicolon after the variable $message

???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.