Jump to content

VTS

Members
  • Posts

    72
  • Joined

  • Last visited

    Never

Everything posted by VTS

  1. Right off the bat I see this: $name = You either need to delete that or finish out the statement and assign that variable to something.
  2. You could try something like the following: foreach($ar1 as $img) { for($i = 0; $i < count($ar2); $i++) { if($ar2[$i]['widgetID'] == $img['widgetID']) { $ar2[$i]['image'] = $img['image']; } else { // the widgetID is not found... do what you need with it here } } } Where $ar1 is the array containing the images and $ar2 is the one containing your other data. Not very efficient since it loops through the second array every time but this is just what came to the top of my head quickest. Someone else might want to post up a more efficient suggestion.
  3. Someone suggested that I used the phpmailer so my mail does not get filtered as junk so I started trying to use it.
  4. Ok, I fixed the cannot connect to smtp server error and now I am getting an error stating that my helo address is invalid. What am I supposed to put in there? If I don't put anything, it tells me it doesn't accept mail from my ip and to "bugger off". If I put my smtp in there, it tells me that my helo address is invalid.
  5. Well yea but I was wondering what things could be causing this. I can send email to people within the company if I just use the mail function alone but when I use this code I keep getting that error. Not sure why.
  6. UPDATE: I have been trying to get the PHP mailer to work since yesterday with no luck. I keep getting the error "could not connect to smtp host" Here is the code I am using: <?php require(".\\phpmailer_v2.0.0\class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "smtp.mycomanysmtp.com"; // specify main and backup server $mail->SMTPAuth = false; // turn on SMTP authentication $mail->Username = ""; // SMTP username $mail->Password = ""; // SMTP password $mail->From = "me@mydomain.com"; $mail->FromName = "david"; $mail->AddAddress("me@mydomain.com"); $mail->AddAddress("my_yahoo@yahoo.com"); $mail->AddAddress("my_cell@vtext.com"); // name is optional $mail->AddReplyTo("me@mydomain.com"); $mail->WordWrap = 50; // set word wrap to 50 characters //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Here is the subject"; $mail->Body = "This is the HTML message body <b>in bold!</b>"; $mail->AltBody = "This is the body in plain text for non-HTML mail clients"; if(!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Message has been sent"; ?> I have tried using this funciton with and without authentication and I get the same error every time. Anyone have any ideas?
  7. Ok, I just checked and there is nothing on my end that is blocking any outgoing mail. I also added 'or die("could not send message")' to the end of the mail clause and when I ran it, I got the could not send message error. I will try that phpmailer class and see how that works too.
  8. Thanks. The server here is supposed to let that go through but I will check again.
  9. UPDATE: I can send email to my company email addresses but not to any outside emails ie yahoo, hotmail, gmail. I am guessing this means I am missing some kind of information that would allow a server to see where the email is coming from. I still am not sure what I should do.
  10. Hello, I have a program that emails me whenever it gets errors. Since I am not always able to check my email and monitor it, I figured I would set it up to send a message to my phone on the weekends whenever it has errors. My problem is that for some reason I cannot get the mail function to send messages to my phone at all. I am using my company email as the from address. Is is just that the mail function cannot send messages to vtext accounts or am I just doing something wrong? I can just change the from address to a regular email and it works just fine. I can also send the messages from my company email to my phone but anytime I try to send it with the mail function it does not work. I have tried using the function like this: mail('xxxx@vtext.com', 'subject', 'message'); and like this as well: mail('xxxx@vtext.com','subject', 'message', 'From: company_email@company.com'); I tried to search a little for this but kept getting error when searching this site so i decided to post here. Thanks in advance for the help
  11. Is there any way in PHP to add a comma to a variable that will have a total in it. For instance, if $total = 100+999. How can I get that field to have a comma in the right place? thanks VTS
  12. I have a quick question about this. My data in a file looks like this: "2 4 .98 .09" "4 4 .50 .40" The format is store#, dept it, goal, actual. What I need to do is read this data from a text file into my database but I do not know how to remove the " marks from the file. How do I go about doing this? Can I use add or strip slashes somehow? thanks in advance, VTS
  13. Looks like it was a simple problem with the path to my perl.exe being wrong....I spelled apache as "apche". Guess it might help if I spell it right :-\
  14. Well, I am trying to get a Perl script to run but anytime I try to access this file from my web browser, I get this error 500. The script is very simple and only copies a file from one drive to another. When I run it in my Perl editor, it copies the file over just fine but as soon as I try to run it in my web browser, it gives me this error. I eventually want to incorporate this script into a PHP program when I get it working. Anyone have any ideas what could cause this error? I am using apache 2.2.0 on a windows web server 2003 os. Any help would be greatly appreciated. thanks in advance, vts
  15. Oh, I guess that would be a pretty easy way to do it lol. Thanks for the info.
  16. As the tittle says, I need to know how to use perl inside a PHP program. The only thing that I am using Perl for is to move a file to a mapped drive on my network. I am not sure at all how to go about using Perl inside my PHP program. If you can give me a simple example(just using the copy function or any other function) or a link to a site that shows you how to do that, I would greatly appreciate it. thanks in advance, vts
  17. Thanks for the info. I tried using this: <?php exec("c:\\test.bat"); ?> When I ran it, nothing happened. The .bat file works when I just run it so I know it is not the .bat file messing up. I also tried using "c:\test.bat" and "c:/test.bat" and none of them worked either. What am I missing?
  18. Well as the title states, I have a .bat file that copies certain files across a network and I needed a way to run this file using PHP. I was looking at exec() but I was not sure exactly how to use it. I was also using pstools but could not get them to work with PHP. Can someone give me an example of how to do this or send me somewhere where I can read up on this? thanks in advance, vts
  19. Thanks for the info! I actually just got this resolved today. They decided that it is possible to put the file on the c: of the server to begin with so now I do not have to worry about this. Ill have to try out what you suggested that way I am able to do that if something like this comes up in the future. thanks again!
  20. Well what I am trying to do is go across my network and copy a file from a mapped drive and put it on the c: drive of my server. I was told that php could not do that and I tried it with javascript, but it doesnt work right. The problem I ran into with JS was that the program that moves this file is located on a server. When a client runs this program it just puts the file on the client's computer and I need it to be placed on the C: of the server. Does anyone have any ideas for what other languages could do this or where else I can look to get help with this? If I need to be a little more clear just let me know. thanks in advance VTS
  21. Ok, I figured it out . Here is what I used: set_time_limit(999); $file = "c:\\data.txt"; if(!file_exists($file)){ echo "File does not exist"; } $handle = fopen($file, "r"); $contents = fread($handle, filesize($file)); fclose($handle); $row = explode("\r", $contents); $rows = count($row); $i = 0; while($i < $rows-1){ $parts = explode('"', $row[$i]); unset($numbers); $numbers = array(); foreach($parts as $part) { $part = trim($part); echo "</br>trimed part = $part"; $x = 0; $partA = explode(" ", $part); //new lines added here to store each field seperately foreach($partA as $var){ if(is_numeric($var)) { echo "</br> *var = $var"; array_push($numbers, $var); } $x++; } } $store = array_pop($numbers); $a = array_pop($numbers); $b = array_pop($numbers); $c = array_pop($numbers); echo "</br> store = $store || a= $a || b= $b || c= $c </br>"; $i++; } Thanks for the help Balmung!
×
×
  • 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.