todayme Posted March 5, 2007 Share Posted March 5, 2007 I have managed to get the values of the drop down boxes using java script. I have put them into a variable and now I am trying to see if they pass to the PHP script below. I am a beginner, can someone tell me what I am doing wrong with the script below. <? $dbindustry = $cool_industry $dbstate = $cool_state Print '.$dbindustry.' Print '.$dbstate.' ?> Link to comment https://forums.phpfreaks.com/topic/41210-help-with-simple-print-variable/ Share on other sites More sharing options...
dsaba Posted March 5, 2007 Share Posted March 5, 2007 it should be $dbindustry = $cool_industry; missing a semicolon Link to comment https://forums.phpfreaks.com/topic/41210-help-with-simple-print-variable/#findComment-199621 Share on other sites More sharing options...
todayme Posted March 5, 2007 Author Share Posted March 5, 2007 Okay done that but what about the print part why does it not print the contents of the variable instead it prints what is in the code. Link to comment https://forums.phpfreaks.com/topic/41210-help-with-simple-print-variable/#findComment-199622 Share on other sites More sharing options...
kenrbnsn Posted March 5, 2007 Share Posted March 5, 2007 Remove the quotes from the statements. Variables within single quotes are not evaluated, but are treated as literals. <?php Print $dbindustry.'<br>'; Print $dbstate; ?> Remember, all PHP statements end with a semi-colon. Ken Link to comment https://forums.phpfreaks.com/topic/41210-help-with-simple-print-variable/#findComment-199626 Share on other sites More sharing options...
todayme Posted March 5, 2007 Author Share Posted March 5, 2007 Thanks Ken Link to comment https://forums.phpfreaks.com/topic/41210-help-with-simple-print-variable/#findComment-199634 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.