Jump to content

djanim8

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Everything posted by djanim8

  1. I have two pages to my site that use fopen()... the first one: $eventFile = fopen($_FILES['fleCSV']['tmp_name'],'r'); opens the file fine... but with the same code, only different names (the variable and fleCSV files USED to be the same.. but changed them because i thought it was conflicting..) the other page gives me this error: Warning: fgetcsv(): supplied argument is not a valid stream resource in uploadmusic.php on line 69 Warning: fclose(): supplied argument is not a valid stream resource in uploadmusic.php on line 103 its using the SAME code....
  2. am I not going to be able to send emails to the user because the domain is different?
  3. I tried setting it to mail.future-sounds.com (I THINK this might be the incoming/outgoing mail server, but my client is home at the moment, so I'm just guessing...) It says it sent it to the info mail... but when it tries to send a copy of the email to person sending the email (in this case, james @ creativedynamix.net) I get this: Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. in sendemail.php on line 63 Line 63 has the mail() function to send it to the user.
  4. AndyB: yea its the real domain, it pulls the email from a database and returns info@future-sounds.com TheFilmGod: I tried it here: http://www.future-sounds.com/newsite/email_test.php inserting my email addres (james@creativedynamix.net) and I didn't receive anything..
  5. I did just change it from localhost to the domain (future-sounds.com) but it gave me an error about authenticity?
  6. yea, the company's name and email is pulled from a database above in the script. All the fields are the same (checked those first) and it is a post.. for the "true domain mail address" do you mean instead of setting it to "localhost" you set it to the .com domain? nothing shows up in spam.. for some reason it doesn't send at all..
  7. it doesn't display any errors.. the emails just never arrive
  8. I've searched through the forums to find out if I could get a resolution to this problem, added some code in here from the forums, but it still won't send an email through the website.. can someone take a look a this and see if you can figure out why? thanks <?PHP // INI Settings // ini_set(sendmail_from,$companyInfo['email']); ini_set(SMTP,"localhost"); ini_set(smtp_port,"25"); // Gather Email Info // $message = "Emailed From: ".$_POST['txtName']."<br><br>"; $message .= "Message Below:<br>".stripslashes(nl2br($_POST['txtMessage'])); $to = $companyInfo['name']." <".$companyInfo['email'].">"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "To: ".$to."\r\n"; $headers .= "From: ".$_POST['txtName']." <".$_POST['txtEmail'].">\r\n"; mail($to,$_POST['txtSubject'],$message,$headers); //Send the email to the client $to = $_POST['txtName']." <".$_POST['txtEmail'].">"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "To: ".$to."\r\n"; $headers .= "From: ".$companyInfo['name']." <".$companyInfo['email'].">\r\n"; mail($to,"Copy of your Email to .$companyInfo['name'],stripslashes(nl2br($_POST['txtMessage'])),$headers); ?>
  9. ok this code seems to work, but when I modify it, it doesn't.. man I'm so confused!! basically what I'm trying to do is upload a csv file from an excel spreadsheet that has information for a music collection, I'm trying to upload it line by line and changed the code to this: <?PHP $handle = fopen($_FILES['theFile']['tmp_name'], "r"); $mySQL1 = "INSERT INTO songs (title,artist,disc,track,genre1,genre2)"; while ($data = fgetcsv($handle, 1024, ",")) { $mySQL2 = " VALUES ("; foreach ($data as $field) $mySQL2 .= "'$field',"; $mySQL = $mySQL1.substr($mySQL2,strlen($mySQL2)-2).")"; echo $mySQL."<br>"; } ?> right now I'm just trying to get it to echo the string for the SQL statement, and it always returns this: INSERT INTO songs (title,artist,disc,track,genre1,genre2)',) now what am I missing? LOL
  10. ok I've tried a couple different things, but I don't think the server is running 5.0.. do I tried this: $row = 1; $handle = fopen($_FILES['theFile']['tmp_name'], "r"); while (($data = fgetcsv($handle, , "\n")) !== FALSE) { $num = count($data); echo "<p> $num fields in line $row: <br /></p>\n"; $row++; while (($stuff = fgetcsv($data, , ",")) !== FALSE) { echo $stuff[1]."<br>"; } } fclose($handle); and still no luck any other help?
  11. I have the following code after uploading a csv (text) file: $file = fopen($_FILES['theFile']['tmp_name'], 'rb') or die("Can't open file"); $theData = fread($file,filesize($_FILES['theFile']['tmp_name'])); fclose($file); $delimiter = "\n"; $splitcontents = explode($delimiter, $theData); for whatever reason, its not reading more than two lines.. it has about 12,000 lines in it, and needs to be split by the "\n" then I loop through that array and split it by the ",".. its only reading the first 2 lines.. what am I doing wrong?
  12. I want to get all records from a mySQL database that have a date for this week (starting on Sunday).. I can get the day of the week (today is Wed...) by doing this: date("w"); so how can I subtract this many days (3) from today's date to get the start? and then add 6 to that date to get the end.. for example: this is todays date: 08/23/2006 I want to make a dymanic sql statement like this for THIS week (and then whatever week after that). $mySQL = "SELECT * FROM thistable WHERE thisdate IS BETWEEN ".$firstDate." AND ".$lastDate; Where first date would be this sunday (08/20/2006) and the last date would be this saturday (08/26/2006) I can't seem to find code to add and subtract from the current date :(
  13. I'm getting errors on this line of code: <option value="1" <?PHP if($row["catagoryNum"] == "1") { echo "selected" } ?>>Option 1</option> can you have an if statement on a single line? or do I have to convert it to this: <option value="1" <?PHP if($row["catagoryNum"] == "1") { echo "selected" } ?> >Option 1</option>
  14. I'm not sure how to get the cookie to set only from the time they login in, until they close the browser... this is what I have currently setcookie("Login",$txtLogin,time()+60*60,"","myurl.com",0); that just sets it for an hour, but I want it to ask them for a login EVERY time after they clothes the browser. Is there a way to do that?
  15. I'm trying to see if a date pulled from the database is less than the current date.. I'm using this: if ($row['date'] < date("Y-m-d")) { 'do stuff } else { 'do other stuff } it doesn't seem to work.. how can I check to see if the date is older than today? the format in the $row['date'] is yyyy-mm-dd (2006-05-22)
  16. Anyone know how to get Asc codes for individual characters?
  17. What field type do I use to get a "Memo" style field (like a memo field in Access) in mySQL?
×
×
  • 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.