Jump to content

IrOnMaSk

Members
  • Posts

    149
  • Joined

  • Last visited

    Never

Everything posted by IrOnMaSk

  1. hehe looks like it's possible... when you finished that project (if you intend to do it) I would love to use that would be a great tool
  2. hey luke, if you want to redirect to different page, you need to create header for that... example header("Location: pathtopage.php"); if user loggin or submit or watever put above code in there and specify the path to the site you want them to go... check manual for more info http://php.net/manual/en/function.header.php
  3. pewww good question... Logically i would think that you could provide access to those accounts in your application to login then check for the email and save them to an array then call the array into the mail function... obviously I DIDN'T test this Or you can ask them if you could use their database that store email address, search address under your account then send mail using those address in database. And I didn't test this either... just brainstorming...
  4. your'e absolutely right, Sensei!!! I thought the if elseif else is same as if, if, if, if else statement :'( everything is working fantastically now, thanks,
  5. here's the full code, <html> <head> <title>Email Application</title> </head> <body> <?php function email($to,$message)//create email function { $subject = "Please Ignore"; $headers = "MIME-Version: 1.0" . "\r\n"; $headers.= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: <[email protected]>' . "\r\n"; mail($to,$subject,"<strong>".'Expiration Status'."</strong>"."<br />"."<br />" .$message,$headers); } $file = file_get_contents ('content.html', true);//get content from file for reading if (preg_match('/ADAM\/ MIIS\/ LDAP/',$file))//search the match keyword under the app_owner 'ADAM / MIIS / LDAP' { email('[email protected]',"<strong>".'Expire App: '."</strong>".'ADAM / MIIS / LDAP' ."<br />"."<br />". $file);//mail the owners } if (preg_match('/AMAG SMS/', $file)) { email('[email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'AMAG SMS' ."<br />"."<br />". $file); } if (preg_match('/Aspect eWFM/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'Aspect eWFM' ."<br />"."<br />". $file); } if (preg_match('/Aspect RTA/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'Aspect RTA' ."<br />"."<br />". $file); } if (preg_match('/AutoSys \/ iXp Agent/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'AutoSys / iXp Agent' ."<br />"."<br />". $file); } if (preg_match('/BES Standard, BlackBerry/', $file)) { email('#[email protected]',"<strong>".'Expire App: '."</strong>".'BES Standard, BlackBerry' ."<br />"."<br />". $file); } if (preg_match('/Clarify/', $file)) { email('[email protected], [email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'Clarify' ."<br />"."<br />". $file); } if (preg_match('/Clients and Profits/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'Clients and Profits' ."<br />"."<br />". $file); } if (preg_match('/Connect: Direct/', $file)) { email('[email protected], [email protected], [email protected], [email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'Connect: Direct' ."<br />"."<br />". $file); } if (preg_match('/ConnectShip/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'ConnectShip' ."<br />"."<br />". $file); } if (preg_match('/CorpTax/', $file)) { email('#OWNED@dishnetwork,com',"<strong>".'Expire App: '."</strong>".'CorpTax' ."<br />"."<br />". $file); } if (preg_match('#CSG / ACSR#', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'CSG' ."<br />"."<br />". $file); } if (preg_match('/DeskAlerts/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'DeskAlerts' ."<br />"."<br />". $file); } if (preg_match('/ELM \/ iLearning/', $file)) { email('[email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'ELM / iLearning' ."<br />"."<br />". $file); } if (preg_match('/F-Secure Anti-Virus/', $file)) { email('[email protected], [email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'F-Secure Anti-Virus' ."<br />"."<br />". $file); } if (preg_match('/F5 \/ Big-IP/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'F5 / Big-IP' ."<br />"."<br />". $file); } if (preg_match('/FileNet/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'FileNet' ."<br />"."<br />". $file); } if (preg_match('/GEAC MPC/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'GEAC MPC' ."<br />"."<br />". $file); } if (preg_match('/Gemini Scanner/', $file)) { email('[email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'Gemini Scanner' ."<br />"."<br />". $file); } if (preg_match('/Google Search Appliance/', $file))//search the match keyword under the app_owner { email('[email protected]',"<strong>".'Expire App: '."</strong>".'Google Search Appliance' ."<br />"."<br />". $file); } if (preg_match('/Hyperion \/ OBIEE/', $file)) { email('[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'Hyperion / OBIEE' ."<br />"."<br />". $file); } if (preg_match('/Instant Service/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'Instant Service' ."<br />"."<br />". $file); } if (preg_match('/Kronos Workforce Central/', $file)) { email('[email protected], [email protected], [email protected], [email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'Kronos Workforce' ."<br />"."<br />". $file); } if (preg_match('/Liquid Engines/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'Liquid Engines' ."<br />"."<br />". $file); } if (preg_match('/Merced \/ DishMetrics/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'Merced / DishNetrics' ."<br />"."<br />". $file); } if (preg_match('/PGP/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'PGP' ."<br />"."<br />". $file); } if (preg_match('/PL\/SQL Developer/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'PL / SQL Developer' ."<br />"."<br />". $file); } if (preg_match('/PTMS/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'PTMS' ."<br />"."<br />". $file); } if (preg_match('/SecureAuth/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'SecureAuth' ."<br />"."<br />". $file); } if (preg_match('/Siebel/', $file)) { email('[email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'Siebel' ."<br />"."<br />". $file); } if (preg_match('/Stoneriver Tracker/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'Stoneriver Tracker' ."<br />"."<br />". $file); } if (preg_match('/TeamMate/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'teamMate' ."<br />"."<br />". $file); } if (preg_match('/TeamTrack/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'TeamTrack' ."<br />"."<br />". $file); } if (preg_match('/WCCMS/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'WCCMS' ."<br />"."<br />". $file); } if (preg_match('/WebMethods/', $file)) { email('[email protected], [email protected], [email protected], [email protected], [email protected]',"<strong>".'Expire App: '."</strong>".'WebMethods' ."<br />"."<br />". $file); } if (preg_match('/WSNet/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'WSNet' ."<br />"."<br />". $file); } else { email('[email protected]',"<strong>".'Expire App: '."</strong>".'No expire apps between now and the next 60 days' ."<br />"."<br />". 'relax'); } ?> </body> </html> the content of the $file is in the picture, [attachment deleted by admin]
  6. oh and i don't know if this info matters or not,,, but i have at least 20 if statements, like if(){} if(){} if(){} ... then the last one is else
  7. thanks for reply Sensei. Yes I only run it once, and i tested the preg_match <?php $file = file_get_contents ('content.html', true); if (preg_match('/Google Search Appliance/', $file))//search the match keyword under the app_owner { echo 'Google Search Appliance found'; } else { echo 'Google Search Appliance not found'; } ?> Google Search Appliance is in the file so it echo found. and else never executed. and when it's not found the else exectued. so that seems to work fine. don't where the bug is
  8. Hey guys, I encoutered something strange in php, or maybe it suppose to. so i created a mail function then call it using if else statement, base on that, i send out email to one person if conditon meets require criteria then email anoter person in else... but it execute the if condition (that's fine) and it also execute the else condition too, both emails got send. I thought only one condition got executed. heres the mail function function email($to,$message)//create email function { $subject = "Please Ignore"; $headers = "MIME-Version: 1.0" . "\r\n"; $headers.= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: <[email protected]>' . "\r\n"; mail($to,$subject,"<strong>".'Expiration Status'."</strong>"."<br />"."<br />" .$message,$headers); } here's the if else sending mail condition $file = file_get_contents ('content.html', true);//get content from file for reading if (preg_match('/WSNet/', $file)) { email('[email protected]',"<strong>".'Expire App: '."</strong>".'WSNet' ."<br />"."<br />". $file); } else{ email('[email protected]',"<strong>".'Expire App: '."</strong>".'No expire apps between now and the next 60 days' ."<br />"."<br />". $file); } so the if condition met and sending email to me, shouldn't the else condition be ignored? but it send email to me too... thanks for the help
  9. thanks man, right after i asked that question found the answer, and tested and it worked fine. you're the best, thanks very much, Premiso, you should change that to Supremiso!!!!
  10. thankx for the help Premiso. So I read the manual, and i'ma just gonna stick with your example lol.... so what are the php.exe and script.php. I'm guessing the script.php is the php file i want to execute in the CLI but what is the php.exe per se? thankx,
  11. Hi guys, So I want to run one of my php page as a process. I don't want it to run on a browser because it'w be just a blank page. I've been searching and I know the function is shell_exec... But I don't know how to use this function... And if it's not too much asking i want to call it from a batch file... I know the batch scripting part, it would be just (start then the path to the page)... any help or idea would be much appreciated, thanks
  12. Pran, Did you edit the php.ini by putting that gmail server where it says smtp? search for smtp, it should be under mail function, and the one says smtp = ". put your code below after that equal sign and your port under neath it. And is there a reason why you have to use the phpmailer class? to me its much simpler to use the mail function. I've been sending out tons of email just using the mail function. let me know if it works
  13. Joe, I don't think you will ever find the exact example code for what you looking for, unless you pay someone to do it and you post the code up then the next guy having same problem will have your code as the example to use So you should put the pieces together. You stated that php doesn't take the upload file and save it to the database. That seems like bug in the file upload code (check the manual). Or the jquery, javascript, and php don't even talk to each other at all. I'm replying so your post will end up back in the first page, so people can see and they might want to help. by now this post probly is at the 5 or 6th page already!!! goodluck
  14. this should solve your problem Uploading Multiple Files http://www.php.net/manual/en/features.file-upload.multiple.php
  15. So what did it return? PHP doesn't have a mind of its own; it only returns what you tell it to return
  16. thanx for reply premiso... i think its too hard to have it run in a batch mode... anyway, the batch file works fine. Anyone knows anything about autosys? i'm using it to schedule to run the batch file; the job executes the batch but the commands in the batch are not executed which to open the two pages!!! but i think its the wrong place to ask here!!! don't know where to ask this complex question!!! :'(
  17. hey guy, this is probably the dumbest question I ever ask. But can a php page be running in a batch mode, which means i want it to run in the background when i attemp to open it in a browser? So i'm using php mail function to send out email. to do so i have to open it up in a browsers, but it will be just empty page so i don't want it to pop up. So i wrote a batch file to call the page. @echo off start iexplore.exe http://localhost/licensedb/Dev/home.php ping 123.45.67.89 -n 1 -w 20000 > nul taskkill /im iexplore.exe start iexplore.exe http://localhost/licensedb/Dev/send_mail.php ping 123.45.67.89 -n 1 -w 10000 > nul taskkill /im iexplore.exe thats the batch file calling to the 2 pages. So is there a way to just run it in the background without having them popping up? thanks guys
  18. i got it to work... here's how to email alert if connection fail <?php $conn = @mysql_connect('localhost', 'root', 'wrongpass'); if (!$conn) { $to = [email protected]'; $subject = 'connection status'; $message = 'can\'t connect to the database'; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; //More headers $headers .= 'From: <[email protected]>' . "\r\n"; mail($to,$subject,$message,$headers); exit(); } $select = mysql_select_db('db'); ?>
  19. right now it is not right to do that. if you run it, it will give you the error expecting the '}'. After you close your if statement try to run it... looks like it's going to add up fine... note: not tested
  20. hey Premiso, just curious, what do you mean by if html is valid or not valid? You will notice that since the posting of that w3schools has actually gone through and update the content. It is not nearly as bad as it used to be. better be cuz I just suggested to someone!!!
  21. hey Jaynesh this tutorial might help. Give it a try. http://www.w3schools.com/sql/sql_unique.asp disclaimer: errr w3school didn't have good reputation in the pass!!!
  22. all i can get out of what you're trying to do is creating two tables with one attribute is the foreign key of the other... to do that no php require just mysql create statement... of you can use phpmyadmin: www.phpmyadmin.net/home_page/downloads.php so here's how to do that table 1(Person): CREATE TABLE Person ( PID int not nul, Name varchar(30), Age int, Address varchar(60), City varchar(30), Primary Key(PID) ); Here's table number 2 (Qualification): CREATE TABLE Qualification ( ID int, Qualification varchar(30), College varchar(30), University varchar(30), PersonID int FOREIGN KEY (PersonID) REFERENCED Person (PID) ); have no idea what you mean by that
  23. thanks for replying decro2 and teynon. oopse for got to take it out... I tested try and catch, but it's not working just gave me the unexpected "{" at the try line. looked at the manual, but found no example like so...
  24. hi guys, i'm just exploring the possibility. so i'm trying to send email alert to myself if the connection to the database fail by giving it the wrong password. I tried and the connection did fail but there's no email sent. So I don't know if it's even possible to do that or not or i'm just trying something that's not even exist? or it's possible but there's error in my code? here's the code <?php $conn = mysql_connect('localhost', 'root', 'wrongpass') or die(mysql_error()); $select = mysql_select_db('student') or die (mysql_error()); if(!$conn || !$select) { $to = '[email protected]; $message = 'can\'t connect or select the database'; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; // More headers $headers .= 'From: <[email protected]>' . "\r\n"; mail($to,$subject,$message,$headers); } ?> appriciate it
  25. hey max_w1 I came across this article saying that shouldn't sue w3schools resources :http://w3fools.com/ hosker, I would suggest using access db to upload the data into your database... this works pretty well for insert into database with lots and lots of data. I'm thinking you might not know how to do it so here are the steps. 1)create access with the exact columns name as your database 2)copy and pasted the data from the website (this is the boring part) into the right columns in the access. 3)upload that access file to your database 4)(fun part) insert into (your database name) select*from (the access file name you just upload) 5)f5 to run DONE!!! the most important part is that the columns in access has to be exact same as columns in your database!!! well unless someone else comes up with another better magical method to do so.. you might want to try it lol goodluck
×
×
  • 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.