Jump to content

markbett

Members
  • Posts

    133
  • Joined

  • Last visited

    Never

Everything posted by markbett

  1. perhaps teh leading space in the server name?
  2. <?php // variables $ftpServer = "hostAddress"; $ftpUser = "userID"; $ftpPass = "password"; $finalDir = '/httpdocs/km/tmp/'; $finalFile = $finalDir . $_FILES['userfile']['name']; $sourceFile = $_FILES['source_file']['tmp_name']; // Connect and echo result $ftpConn = ftp_connect("$ftpServer"); $ftpResult = ftp_login($ftpConn, $ftpUser, $ftpPass); ftp_pasv($ftpConn, true); if ((!$ftpConn) || (!$ftpResult)) echo "Connection failed<br><br>"; else echo "Connection succeeded<br><br>"; // upload the file $ftpUpload = ftp_put($ftpConn, $finalFile, $sourceFile, FTP_BINARY); // check upload status if (!$ftpUpload) echo "FTP upload has failed!"; else echo "Uploaded $sourceFile to $ftpServer as $finalFile"; // close the FTP stream ftp_close($ftpConn); ?>
  3. read the values from the array and set them to a variable THEN write them back into the array , otherwise ensure you are writing to the correct key value in the array or else you will overwrite the information.
  4. surpresses sql errors
  5. when logging into the site session variables are declared and set: [code]  if(mysql_num_rows($validate) == 1){       while($row = mysql_fetch_assoc($validate)){         $_SESSION['login'] = true;         $_SESSION['userid'] = $row['id'];         $_SESSION['first_name'] = $row['first_name'];         $_SESSION['last_name']  = $row['last_name'];         $_SESSION['email_address'] = $row['email_address'];[/code] the problem i have is that when i call on these variables later on, they often have changed and are now showing information for a different users.  the problem generally is triggered after performing a new SQL query to fetch other information.  Where I am confused is that I do not set $_session variables in ANY other locations.  I am the one experiencing the poblem on my test site so i know i am not hacking anything and resetting variables....  am i mistaken that once $_SESSION['first_name']  is set to a value that it will rmeain that set value until explicitly told otherwise or is it the case that when you declare $_SESSION['first_name']  = $row['first_name']; every time you have a $row['first_name'] the session variable will be reset to that new value....
  6. if the above doesnt work have it echo the SQL statement so you can see what values are being put where.... you may have a variable defined as something other then oyu think it is
  7. right now i am running the SQL query [code]$sql = mysql_query("SELECT start_time, title FROM events WHERE YEAR( start_time ) = $show_cal_year AND MONTH( start_time ) = '$show_cal_month' ORDER BY start_time"); while($row = mysql_fetch_array($sql)){ stripslashes(extract($row));[/code] what i need to do is be able to deal with the results by DAY so for each day i lump them together (NO I DONT WANT TO GROUP BY in my sql query)  is there a way to achieve this AS IF I HAD run 31  queries that were defined by DAY (start_time)= $day but by only running the single query for the whole month?
  8. I am working on a site with a calendar.  events are being store in the MySQL DB as a date/time  (eg 2006/08/23 14:09:34 )  what I am trying to do is build a mySQL query so that i can read all of the events listed for each day.  so can i do a query  where i select by month year? do i need to do SELECT * FROM events ORDER BY start_day BETWEEN DATE 'DATE1'               AND DATE 'DATE2' and then i set the Date1 and Date2 variables independantly? should i do  a query for each month and then sort and echo by day or should i runa  query for each day and run it every day of the month?
×
×
  • 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.