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
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

???
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.