calmchess Posted December 14, 2009 Share Posted December 14, 2009 usually i can echo a varable inside a url just by writing $varName; but in the following string it doesn't work can somebody help me use the $id variable in the following string? echo "<b>Upload successful</b><span class =span3></span><br /><a href=http://www.privatechatnow.com/currentwebsite/activate?id=$id>Back</a></div>"; Link to comment https://forums.phpfreaks.com/topic/185142-echo-variable-with-string/ Share on other sites More sharing options...
mrMarcus Posted December 14, 2009 Share Posted December 14, 2009 does $id have a value? are you sure? Link to comment https://forums.phpfreaks.com/topic/185142-echo-variable-with-string/#findComment-977310 Share on other sites More sharing options...
calmchess Posted December 14, 2009 Author Share Posted December 14, 2009 thanks for your time but i already figured it out here is the answer echo "<b>Upload successful</b><span class =span3></span><br /><a href=\"http://www.privatechatnow.com/currentwebsite/activation/activate?id=$id\">Back</a></div>"; Link to comment https://forums.phpfreaks.com/topic/185142-echo-variable-with-string/#findComment-977311 Share on other sites More sharing options...
gevensen Posted December 15, 2009 Share Posted December 15, 2009 i usually do it like this <b>Upload successful</b><span class =span3></span><br /><a href=\"http://www.privatechatnow.com/currentwebsite/activation/activate?id=<?php echo $id; ?> \">Back</a></div> Link to comment https://forums.phpfreaks.com/topic/185142-echo-variable-with-string/#findComment-977416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.