Jump to content

[SOLVED] Am I concatenating properly?


davediamondprovo

Recommended Posts

This code will NOT spit out my session variable and I've tried single quotes, double quotes and it's driving me crazy.

[code]$firstParagraph = "Thanks, " . $HTTP_SESSION_VARS['ClientName'] . "Your scripts have been submitted successfully.</p><p>Now, after I laugh at your copy, I\'ll read and deliver it to the email address you provided with your submission, " . $HTTP_SESSION_VARS['ClientEmail'] . ". I hope you entered a valid email address. You did, didn\'t you? Excellent!";[/code]

Anyone help here? Yes, I'm a noob!
Link to comment
https://forums.phpfreaks.com/topic/32325-solved-am-i-concatenating-properly/
Share on other sites

Thanks for the reply.. code below

[code]<?
require_once ("config.php");
include ("text.php");
session_start();
if($HTTP_POST_VARS['ClientName'] > null && $HTTP_POST_VARS['ClientEmail'] > null)
{
session_start();
$HTTP_SESSION_VARS['ClientName']        = stripslashes($HTTP_POST_VARS['ClientName']);
$HTTP_SESSION_VARS['ClientEmail']      = $HTTP_POST_VARS['ClientEmail'];
$HTTP_SESSION_VARS['ClientCopy']        = $HTTP_POST_VARS['ClientCopy'];
}

$title = $thanksTitle;
include 'inc/header.php';

echo $heading;
echo $tagline;


echo $thanksHeader;
echo $firstParagraph;


if($HTTP_SESSION_VARS['ClientCopy'] == '1') {
echo $copyAccepted;
}
if($HTTP_SESSION_VARS['ClientCopy'] == '0') {
echo $copyDeclined;
}

echo $thirdParagraph;

echo $signOff;
echo $bottomNav;

include 'inc/footer.php';
$HTTP_SESSION_VARS = array();
session_destroy();

?>[/code]

[code]###########################################################
#### THANKS.PHP PAGE TEXT #################################
###########################################################

$thanksTitle = 'Fallen Down the Steps : Thanks!';

#### $thanksHeader starts with a <div> tag that's closed below. Do not remove it.

$thanksHeader = '<div class="fieldc"><h3>You Did It!</h3>';
$firstParagraph = $firstParagraph = "Thanks, " . $HTTP_SESSION_VARS['ClientName'] . "Your scripts have been submitted successfully.</p><p>Now, after I laugh at your copy, I'll read and deliver it to the email address you provided with your submission, " . $HTTP_SESSION_VARS['ClientEmail'] . ". I hope you entered a valid email address. You did, didn't you? Excellent!";
$copyAccepted = '<p><b>I noticed you chose to receive a copy of your scripts. That\'s a good idea since I\'ll probably loose them and need you to forward them to me again.</b></p>';
$copyDeclined = '<p><b>Too bad you didn\'t opt for a copy of your scripts. Oh sure, I could send you a copy but then again, that\'s why I put the silly option there so I wouldn\'t have to. It\'s ok though, I get bored around here sometimes.</b></p>';
$thirdParagraph = '<p>Ok sit back and think of more ridiculous promotions for your station while I go to lunch, perhaps a movie and then return to the studio to cut your lame copy.</p>';

#### closing </div> is in the $signOff variable below

$signOff = '<p>Have a nice day!</p></div>';
$bottomNav = '<p align="center"><a href="index.php" class="noll">Submit More Scripts</a> - *cringe*</p>';
[/code]


Thanks for any help you can provide.

Dave
I figured this out with the help of you here. I moved my first session_start(); directive to the top after the opening php tag. Works!

Thanks!

[code]<?
session_start();
require_once ("config.php");
include ("text.php");

if($HTTP_POST_VARS['ClientName'] > null && $HTTP_POST_VARS['ClientEmail'] > null)
{
session_start();
$HTTP_SESSION_VARS['ClientName']        = stripslashes($HTTP_POST_VARS['ClientName']);
$HTTP_SESSION_VARS['ClientEmail']      = $HTTP_POST_VARS['ClientEmail'];
$HTTP_SESSION_VARS['ClientCopy']        = $HTTP_POST_VARS['ClientCopy'];
}

$title = $thanksTitle;
include 'inc/header.php';

echo $heading;
echo $tagline;


echo $thanksHeader;
echo $firstParagraph;


if($HTTP_SESSION_VARS['ClientCopy'] == '1') {
echo $copyAccepted;
}
if($HTTP_SESSION_VARS['ClientCopy'] == '0') {
echo $copyDeclined;
}

echo $thirdParagraph;

echo $signOff;
echo $bottomNav;

include 'inc/footer.php';
$HTTP_SESSION_VARS = array();
session_destroy();

?>[/code]

Archived

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

×
×
  • Create New...

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.