daughn888 Posted July 15, 2006 Share Posted July 15, 2006 OkayI tried that ...Here is the program I'm trying to write to learn php. --------------------------------------------------------------------------------------<?php//import form information$question1a = $_POST['q1'];$question1b = $_POST['q2'];$question1 = $question1a.', '.$question1b;if ($question1a != "happiness") {echo "Sorry, the answer is results. \n ";echo "Please hit your back button and try again.";}if ($question1b != "floatation") {echo "Sorry, the answer is misc. \n ";echo "Please hit your back button and try again.}if ($question1 == "results, misc.") { [i][b] <-- This is the line that keeps giving me a parsing error[/b][/i]header('Location: thankyou.html');------------------------------------------------------------------------------What is the syntax for line 18?Thanks again! Quote Link to comment https://forums.phpfreaks.com/topic/14702-help-with-connecting-strings/ Share on other sites More sharing options...
akitchin Posted July 15, 2006 Share Posted July 15, 2006 try this:[code]$string1 = $string1a.', '.$string1b;[/code]this will insert a ", " between your two strings. otherwise if $string1a is "results" and $string1b is "misc", your current line would be giving resultsmisc (ie. connecting them directly together). Quote Link to comment https://forums.phpfreaks.com/topic/14702-help-with-connecting-strings/#findComment-58649 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.