deansaddigh Posted February 23, 2010 Share Posted February 23, 2010 I want to basically but 2 strings into the subject field if a variable exists. I have the following code <?php // check to see if the get variables are empty //these variables are passed from the quicksearchresults page when some one clicks //the email image if(isset($_GET['coursename'] , $_GET['schoolname'])) { $coursename =$_GET['coursename']; $schoolname =$_GET['schoolname']; } ?> <label>Subject :</label> <input type="text" name="subject" /> <br /> so basically i just want to put $coursename and $schoolname in the subject field if they exist, how can i do this? Kind regards dean Link to comment https://forums.phpfreaks.com/topic/193011-want-to-put-a-sting-into-a-form-field-if-variables-exist/ Share on other sites More sharing options...
sader Posted February 23, 2010 Share Posted February 23, 2010 <input type="text" name="subject" value="<?php echo $schoolname."-".$coursename;?>"/> Link to comment https://forums.phpfreaks.com/topic/193011-want-to-put-a-sting-into-a-form-field-if-variables-exist/#findComment-1016487 Share on other sites More sharing options...
deansaddigh Posted February 23, 2010 Author Share Posted February 23, 2010 Thanks sader you have been a wicked help Link to comment https://forums.phpfreaks.com/topic/193011-want-to-put-a-sting-into-a-form-field-if-variables-exist/#findComment-1016488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.