Luey
asked on
proper way to write a php variable with a hyperlink
Can someone tell me the correct way to write this variable.
$mess .= "<a href=".$_POST['email_site_ address']. ">".$_POST ['email_si te_name']. "</a>";
$mess .= "<a href=".$_POST['email_site_
I don't understand the question. Perhaps a question from me will help -- Where do you want to write the variable?
ASKER
Well actually it works but I do not understand why.
Normally you would write a hyperlink like so right?
<a href="some_site">"some text"</a>
With my variable would I not be missing the "" around the site address after href=
"<a href=".$_POST['email_site_ address']. ">".$_POST ['email_si te_name']. "</a>
Normally you would write a hyperlink like so right?
<a href="some_site">"some text"</a>
With my variable would I not be missing the "" around the site address after href=
"<a href=".$_POST['email_site_
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ray makes a good point about striving for better code.
The var_dump is a very good idea. Regardless of what you do, if you are still having trouble, please share the var_dump of $mess with us.
If using Ray's code, also the var_dump of $e and $n.
The var_dump is a very good idea. Regardless of what you do, if you are still having trouble, please share the var_dump of $mess with us.
If using Ray's code, also the var_dump of $e and $n.
And a var_dump($_POST) might be a helpful and informative step, as well!
ASKER
Both examples worked but I ended up using the HEREDOC syntax. Thanks a lot.