eMonk Posted November 22, 2008 Share Posted November 22, 2008 'Subject' => 'Bio Submission by " . $name . "' sorry i'm still new to php & still need to learn the difference between single & double quotes & how to use them. the problem here is, i'm trying to include the post values from $name into the subject line but it's showing up as "Bio Submission by $name" in the subject line when it's suppose to fetch the info from $name $name = $_POST['name']; thanks in advance! Link to comment https://forums.phpfreaks.com/topic/133752-solved-whats-wrong-with-this-line/ Share on other sites More sharing options...
zenag Posted November 22, 2008 Share Posted November 22, 2008 if u were to print the whole line echo "Subject=> Bio Submission by ".$name ; echo "Subject=> Bio Submission by {$name}" ; if u need to assign $ value to subject variable echo $Subject= "Bio Submission by {$name}" ; echo $Subject= "Bio Submission by ".$name; Link to comment https://forums.phpfreaks.com/topic/133752-solved-whats-wrong-with-this-line/#findComment-696046 Share on other sites More sharing options...
eMonk Posted November 22, 2008 Author Share Posted November 22, 2008 here's the complete headers code $hdrs = array( 'From' => 'eMonk', 'Subject' => 'Bio Submission' ); how can i include Bio Submission by $name using 'single quotes'? Link to comment https://forums.phpfreaks.com/topic/133752-solved-whats-wrong-with-this-line/#findComment-696056 Share on other sites More sharing options...
zenag Posted November 22, 2008 Share Posted November 22, 2008 $hdrs = array( 'From' => 'eMonk', 'Subject' => 'Bio Submission '.$name ); Link to comment https://forums.phpfreaks.com/topic/133752-solved-whats-wrong-with-this-line/#findComment-696057 Share on other sites More sharing options...
eMonk Posted November 22, 2008 Author Share Posted November 22, 2008 that worked, thanks! Link to comment https://forums.phpfreaks.com/topic/133752-solved-whats-wrong-with-this-line/#findComment-696060 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.