redgunner Posted August 14, 2009 Share Posted August 14, 2009 $message = 'Hi ' . $_REQUEST["fullname"] . ' How are you?!; Is this an efficient way of doing this? Quote Link to comment Share on other sites More sharing options...
.josh Posted August 14, 2009 Share Posted August 14, 2009 well I don't see a closing parenthesis after the ' How are you other than that, where is this "fullname" supposed to be coming from? p.s.- it helps if you actually post what the problem is. Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 14, 2009 Share Posted August 14, 2009 I think you mean apostrophe CV Quote Link to comment Share on other sites More sharing options...
Anti-Moronic Posted August 14, 2009 Share Posted August 14, 2009 I'm assuming you mean make this a little less 'messy'. How about: <?php $fullname = $_REQUEST['fullname']; $message = "Hi $fullname How are you?!"; ?> That's certainly less messy. It should be noted technically, using the ' ' is faster (albeit minutely in this case) because php doesn't look for variables to parse. AND you're not assigning any variables, so your statement is more efficient, but the one above is less messy. I would like to point out, FILTER your input. Do not just blindly accept input from the user. Fullname could contain some malicious javascript! Hope that helps. Quote Link to comment Share on other sites More sharing options...
.josh Posted August 14, 2009 Share Posted August 14, 2009 I think you mean apostrophe CV haha oops... no wait, wait, i DID mean parenthesis. You see, an apostrophe looks like a mini parenthesis, and I didn't want to hurt its feelings by pointing out how it isn't as long as the parenthesis, so I called it a parenthesis to be politically correct. Kind of like how you can't call a midget a midget. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.