JhunVW Posted June 30, 2015 Share Posted June 30, 2015 Hello, Is it possible to store an <a href= > to a variable, like this: $link_add = "<a href='http://www.yahoo.com'>here</a>"; $message = "If you want to continue this transaction, please click " . $link_add; My output look like this: If you want to continue this transaction, please click <a href=http://www.yahoo.com>here instead of: If you want to continue this transaction, please click here I also tried this: $link_add = echo "<a href='http://www.yahoo.com'>here</a>"; still not correct. Please help. Thanks. Jhun Quote Link to comment https://forums.phpfreaks.com/topic/297118-storing-to-a-variable/ Share on other sites More sharing options...
cyberRobot Posted June 30, 2015 Share Posted June 30, 2015 The following code works for me: <?php $link_add = "<a href='http://www.yahoo.com'>here</a>"; $message = "If you want to continue this transaction, please click " . $link_add; print $message; ?> Are you using a function like htmlentities() on $message before it's displayed? What does your echo statement for $message look like? Note: please surround your code with tags. It makes your post and code easier to follow. Quote Link to comment https://forums.phpfreaks.com/topic/297118-storing-to-a-variable/#findComment-1515281 Share on other sites More sharing options...
JhunVW Posted June 30, 2015 Author Share Posted June 30, 2015 (edited) Hi CyberRobot, Thanks for your immediate response. My apology, I failed to mention that I am sending the message thru SMS and not just printing it. Here's part of the codes: <?php $link_add = "<a href='http://www.yahoo.com'>here</a>"; $message = "If you want to continue this transaction, please click " . $link_add; $unicode = ""; $_objSmsProtocolGsm->Logfile = "C:\SMSMMSToolLog.txt"; //Clear the messageobject first $objMessage->Clear(); $objMessage->Clear(); if( $recipient == "" ) die("No recipient address filled in."); $objMessage->Recipient = $recipient; if( $unicode != "" ) $objMessage->Format = $objConstants->asMESSAGEFORMAT_UNICODE; $objMessage->Data = $message; $_objSmsProtocolGsm->Clear(); $_objSmsProtocolGsm->Device = $device; ... rest of codes work fine here! ? If you want to continue this transaction, please click <a href=http://www.yahoo.com>here <- this is the ouptut in my SMS. Best regards, Jhun Edited June 30, 2015 by JhunVW Quote Link to comment https://forums.phpfreaks.com/topic/297118-storing-to-a-variable/#findComment-1515288 Share on other sites More sharing options...
ginerjm Posted June 30, 2015 Share Posted June 30, 2015 Your sms doesn't handle html most likely. Quote Link to comment https://forums.phpfreaks.com/topic/297118-storing-to-a-variable/#findComment-1515289 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.