Jump to content

14pulsars

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

14pulsars's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Tried XVI32, removed three small symbols from the start, and it works! Thanks!
  2. I dropped it into notepad++ as well - no different that the Dreamweaver code view.
  3. Dreamweaver has the option to include a BOM - I unchecked it, still no go. Not included anywhere - I just present this page, nothing else. Thanks for your replies, though!
  4. Hi folks, I'm having some problems with a script I'm writing. I'm trying to use a session to store POST variables for another page, then redirect based on one of the post variables. After the user redirects, they click a few links, and come back to the redirecting page, except they see the content this time, with some form fields pre-populated using the session info. Here are the error codes I get: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/dir/public_html/orderconfirm.php:1) in /home/dir/public_html/orderconfirm.php on line 1 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/dir/public_html/orderconfirm.php:1) in /home/dir/public_html/orderconfirm.php on line 1 Warning: Cannot modify header information - headers already sent by (output started at /home/dir/public_html/orderconfirm.php:1) in /home/dir/public_html/orderconfirm.php on line 16 Here is the code at the top of the page responsible for the work(starting from line 1) <?php session_start(); if (isset($_POST)) { if ($_GET['us'] != 'true') { foreach ($_POST as $key => $value) $_SESSION[$key] = $value; } for ($i=1;$i<20;$i++) { if(isset($_POST['sku'.$i])) { if ($_POST['sku'.$i] == "AOI0000") header('Location: http://www.sitename.com/bookthankyou.php'); elseif ($_POST['sku'.$i] == "AOI0004") header('Location: http://www.sitename.com/hardcopythankyou.php'); } else break; } } ?> I thought that the problem would be on line 1, but there is nothing but the opening PHP bracket - no empty space or anything that could cause an issue. Any thoughts on a cause for the problem?
  5. It seemed to work pretty well, but I get some duplicate entries. Is there a way I can only pull unique matches?
  6. I had to use the last name since it's the only real point of commonality across the data sets. The billing details don't have User ID's, and some users used variations in their fist names (Dan/Danny), and rather than having to account for that, I thought it easier to just compare last names, and eliminate any mismatches based on first name manually. I'll try what you suggested and get back to you.
  7. I'm trying to match up a list of client names with billing details. The problem is that the info is spread over two different data sets. I loaded the two data sets into two DB tables, and finding matches by Last Name. I want to categorize any matches into an array for printing and organizing, and the rest into another array, for the same reason. Here is the code: <?php $dbh=mysql_connect ("localhost", "DB_Name", "Password") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("database"); $missingUsers = mysql_query("SELECT * FROM `members-unknowns`") or die (mysql_error()); $OSCOrder = mysql_query("SELECT * FROM `1SC-Orders`") or die (mysql_error()); $OscData = mysql_fetch_array( $OSCOrder ); $miData = mysql_fetch_array( $missingUsers ); $successArray = array(); $failArray = array(); foreach ($OscData as $Osckey => $Oscvalue){ foreach ( $miData as $mikey => $mivalue){ if (strcasecmp($Osckey['LastName'],$mikey['LastName']) == 0) { $successArray[] = array( 'FirstName' => $mikey['FirstName'], 'LastName' => $mikey['LastName'], 'UserName' => $mikey['UserName'], 'CCNum' => $Osckey['CCNum'], 'CCExp' => $Osckey['ExpireDate'] ); } else { $failArray[] = array( 'FirstName' => $mikey['FirstName'], 'LastName' => $mikey['LastName'], 'UserName' => $mikey['UserName'] ); } } } mysql_close(); //print_r($successArray); For Debug Purposes print "<p>These are good:</p>"; foreach ($successArray as $key => $value) { print $value['FirstName']." ".$value['LastName']." | ".$value['UserName']." | ".$value['CCNum']."<br />\n"; } ?> Here's a sample of the output, though: These are good: | | | | | | | | | | | | I I | I | I | | | | Pretty much alot of empty spaces, and some other things I can't account for. What am I doing wrong?
  8. That Worked, thank you! I guess the Resource ID#2 was referring to a second row that did not exist, meaning it did not render anything. Is my logic flawed? Anyway, thanks alot Barand.
  9. Did some more digging, and it turns out that my $data variable returns: Resource id #2 for every query string except (monthNumber=1 AND weekNumber=1). Does that tell anyone anything? I will keep looking.
  10. Hi folks, I need some help: I'm retrieving data from a DB based on two variables in the SQL query string (a month number and a week number). All records pull up fine for (monthNumber=1 AND weekNumber=1), but any other weekNumber, monthNumber, or any combination thereof pulls a blank. Also, everything shows up with if the query string just includes (weekNumber=n), but the first record of every month is missing is the query string just includes (monthNumber=n) Here is what I have tried: I though that the weekNumber was not an integer, but a string. is_int() told me $weekNumber is not an integer; is_numeric() returned false. Type Casting or intval() did nothing. Placing single quotes around the variables in the query string in every single combination I could think of I ran the exact same queries through PHPMyAdmin and the right records show up I'm at my whit's end here - any help would be greatly appreciated. Here is my code: (The month variable goes through the array for a reason, by the way) $dbh=mysql_connect ("localhost", "DB_NAME", "PASSWORD) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("TABLE_NAME"); $monthArray = array( 'udhYdh' => 1, 'IUshd8' => 2, 'Cdne92' => 3, 'Cmdiuj' => 4, 'jd83wh' => 5, 'Vmd93f' => 6, 'd9dfOv' => 7, '8dFvhj' => 8, 'lCjuew' => 9, 'mDUfn4' => 10, '9dnjCu' => 11, 'KIDc2m' => 12 ); $errorMsg = 'Sorry, the following error(s) occured:<br />'; if (isset($_GET['month'])) $monthNumber = $monthArray[$_GET['month']]; else $errorMsg = $errorMsg.'- Invalid Month<br />'; if ($_GET['week'] == 1 || $_GET['week'] == 2 || $_GET['week'] == 3 || $_GET['week'] == 4) $weekNumber = $_GET['week']; else $errorMsg = $errorMsg.'- Invalid Week<br />'; if (isset($monthNumber) && isset($weekNumber)){ $data = mysql_query("SELECT * FROM amember_weeks WHERE monthNumber=$monthNumber AND weekNumber=$weekNumber") or die(mysql_error()); $info = mysql_fetch_array($data); } ... page contents were here .... if (isset($monthNumber) && isset($weekNumber)) { while($info = mysql_fetch_array( $data )) { print $info['id']." - ".$info['title'].'<br />'.$info['weekDesc'].'<br /><br />'; } } else { print $errorMsg; }
  11. This fixed the first part of my problem - I switched to a regular array to fix the second. Thanks for your help!
  12. Hi folks, a small question. I have two arrays, one named $sku, and a 2-d array named $productInfo. I need to reference the $productInfo array and another POST variable that has a naming format "productn" where n is an integer, starting from 1, from a loop responsible for printing the contents of the $sku array. This works just fine: foreach ($sku as $key => $value) echo $key.'=>'.$value.'<br />'; But the following renders absolutely nothing, not even the strings: foreach ($sku as $key => $value) echo $_POST['product'.$key + 1].'=>'.$productInfo[$value]['filename'].'<br />'; Can someone spot my error? Where is my logic flawed? Any help would be appreciated...
  13. The problem is that I don't have access to those fields, the data comes from the POST from a third party CC processor. Absolutely no control over field names or anything. Though your suggestion would have been ideal.
  14. Hey, that worked! Thanks. I didn't think about bringing in the first array addition into the loop. I also did not know you could concatenate inside variables like that. THANKS! I'm going to remember this!
×
×
  • 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.