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
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
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.