Jump to content

Archived

This topic is now archived and is closed to further replies.

daughn888

Help with Connecting Strings

Recommended Posts

Okay

I 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!
       

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.