From: "James Johnson" <[EMAIL PROTECTED]>

> Can anyone see what's wrong with the following code? It produces the
> following in the browser:
>
> Warning: Cannot add header information - headers already sent by (output
> started at /home/.paco/campuscb/campuscorkboard.com/AdPay_MC.php:11) in
> /home/.paco/campuscb/campuscorkboard.com/AdPay_MC.php on line 20
>
> Which tells me that something is being written before the
> header("Location: " . "AdPayment_MCSuccess.php");

True. It even tells you it's being written (output) on line 11.

> However, I can't figure out what it may be.
>
> *** code starts at line 1 of page ***
> <?php require_once('Connections/CCB.php'); ?>
> <?php session_start();

You're "writing" a line space between those two PHP blocks.

> $colname_GetMC = "1";
> if (isset($_SESSION['svUserID'])) {
>   $colname_GetMC = (get_magic_quotes_gpc()) ? $_SESSION['svUserID'] :
> addslashes($_SESSION['svUserID']);
> }
> mysql_select_db($database_CCB, $CCB);
> $query_GetMC = sprintf("SELECT subid, credit_total FROM member_credits
WHERE
> subid = %s", $colname_GetMC);
> $GetMC = mysql_query($query_GetMC, $CCB) or die(mysql_error());
> $row_GetMC = mysql_fetch_assoc($GetMC);
> $totalRows_GetMC = mysql_num_rows($GetMC);
> ?>
>
> <?php

You're writing a couple line breaks here...

> if(isset($_POST['Submit'])){
> if($_POST['Submit'] == "Place my Ad"){
> include_once('inc_placeAd.php');
> // remove 1 credit from member_credits table for each campus
> selected
> $crdt = $row_GetMC['credit_total'] -
> $_SESSION['sv_CampusAdCount'];
> $id = $row_GetMC['subid'];
> $q = "UPDATE member_credits SET credit_total = $crdt WHERE
> subid = $id";
> $Update = mysql_query($q, $CCB) or die(mysql_error());
> header("Location: " . "Success.php");
> exit;
> }
> }
> ?>

All of this code needs to be in ONE php block...

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to