-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
try something like this *untested* <?php $path = $_SERVER['DOCUMENT_ROOT']; $extension = '.php'; $redirectPages = array("NotFound" => "sorry.php","Warning" => "sorry.php"); $hiddenPages = array("private.php","hiddencash.php"); if ( preg_match("#^[a-z0-9_-]+$#i",$_GET['page']) ) { $page = $_GET['page'] $filename = $path.$page.$extension; if(file_exists($filename) && !in_array($page,$hiddenPages)) { include($filename); }else{ include($pages['NotFound']); } }else{ //add to security log include($pages['Warning']); } ?>
-
You don't need it it just makes like eaiser for you.. No matter where your mail server is located limits are limts, you could host it yourself but that can cause other problems, limit on mails send shouldn't be a problem (depends what your sending i guess), i have no idea what you mean by "limited in standard subject line" as for the setting for yahoo, yes you can use them in outlook but the setting are the same host:port, connection type, username, password
-
That is a little like.. oow ooow I found a function i'll stick that in as well! testing the concat! Clean '<b>me</b>' Clean '<b>me</b>'Clean 'me'Clean '<b>me</b>'Clean 'me'Clean \'<b>me</b>\'Clean \'me\'Clean \'<b>me</b>\'Clean \'me\' Wow..The clean function is as clean as my office!
-
What didn't work?
-
Download PHPMailer and create a gmail account and try the script below <?php require_once('../class.phpmailer.php'); $mail = new PHPMailer(); $body = "testing <b>PHP Mailer</b> wooohooo"; $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server //update $mail->Username = "yourusername@gmail.com"; // GMAIL username $mail->Password = "yourpassword"; // GMAIL password $mail->SetFrom('yourusername@gmail.com', 'First Last'); $mail->Subject = "PHPMailer Test Subject via smtp (Gmail), basic"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->MsgHTML($body); $address = "whoto@otherdomain.com"; $mail->AddAddress($address, "John Doe"); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?>
-
Thats a Quote from: http://help.yahoo.com/l/uk/yahoo/mail/yahoomail/pop/pop-06.html I was saying yahoo accounts require authentication, so use phpmailer()
-
<?php echo "PHP Freaks Forums >> PHP Coding >> PHP Help"; ?> Hello and welcome to PHPFreaks, OKay these are called cookie/bread crumbs, if you google "php bread crumbs" you could find lots of examples, its not very complex, but if you get stuck feel free to ask,
-
Okay add this, right after <?php $link = mysql_connect('localhost', 'root', ''); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; $DBname = "MyDatabase"; $db_selected = mysql_select_db($DBname, $link); if (!$db_selected) { die ("Can't use $DBname: " . mysql_error()); } but change the $DBname = "MyDatabase"; to your database name (the name of the database on the left in PMA)
-
something like this *untested* USE Users GO CREATE PROC sp_GetNumUsers @UserGroup INT, RETURN (SELECT COUNT(*) FROM Users WHERE Group = @UserGroup) $link = mssql_connect($myServer, $myUser, $myPass); $d = mssql_select_db($myDB, $link); $query = mssql_init("sp_GetNumUsers", $link); $UserGroup = 4; $UserCount = 0; mssql_bind($query, "@UserGroup", $UserGroup, SQLFLT8); mssql_bind($query, "RETVAL", &$UserCount, SQLINT2); mssql_execute($query); echo "$UserCount Users in Group $UserGroup";
-
yahoo's uk mail server is BUT it requires authentication,
-
Solved ? Click Topic Solved if it is
-
Thats because both are strings "1" = string 1 = int
-
These are email settings nothing much to do with PHP atall.. PHP uses them yes do you know what your mail server is ?
-
okay, this should work '/(\$[^_].*?[\s=\'"}{])/s'
-
If your PC is running as a mail server then localhost is fine, (i assume it's not) So you need to change it to whatever your mail server is! i assume you have the email setup and the details to hand !
-
I thought it was half and half to didn't say anything! anyway solved ?
-
'/(\$[^_].*?[=\'"}{])/s' would change <?php $Hello = "moo"; $BLAH_Hi="cookies"; echo "TEST"; $Query = "SELECT HIGH_PRIORITY * FROM users WHERE u_userid='$vp_userid' limit 1" $HelloPOst = $_POST['Test'].$Hello; <script type='text/javascript'> ?> to <?php $hello = "moo"; $blah_hi="cookies"; echo "TEST"; $query = "SELECT HIGH_PRIORITY * FROM users WHERE u_userid='$vp_userid' limit 1" $hellopost = $_POST['Test'].$hello; <script type='text/javascript'> ?> EDIT: corrected (didn't copy the results correctly)
-
Okay well this depends on your mail service provider, You need to enter the details as if you was setting up the account on MacMail or Outlook ie heres some details i sent to a client, (edited a little) Now Outgoing Mail Server: mail.mydomain.com is would be used ie SMTP=mail.mydomain.com the problem is mine require authentication password, so to save time i could use PHPMailer as mai() doesn't support authentication
-
Heres the full code i am using $text = '<?php $Hello = "moo"; $BLAH_Hi="cookies"; echo "TEST"; $Query = "SELECT HIGH_PRIORITY * FROM users WHERE u_userid=\'$VP_userid\' limit 1" ?>'; <?php function toLower($matches) { return strtolower($matches[1]); } echo preg_replace_callback('/(\$.*?[=\'"}{])/s',"toLower",$text); ?> heres my output
-
Open your PHP.ini file and check the following [mail function] SMTP = localhost smtp_port = 25 SMTP should be the mail server and the smtp_port should be its port!
-
oops '/(\$.*?[=\'"}{])/s' should be '/(\$.*?)[=\'"}{]/s'
-
So.. try a simple test if(mail('abc@xyz.com', 'My Subject', "Hello")) { echo "sent"; }else{ echo "failed"; } if that fails check your PHP.INI setup SMTP, if your account require authentication then try phpmailer()
-
That reminds me, you keep posting in the wrong section, you know thats against the terms! The Javascript section does get replies (I also go their)
-
Also your code will always say sent as you don't check if mail was sucessful change mail($my_email, $subject, $message, $headers) to if(!mail($my_email, $subject, $message, $headers)) { trigger_error("Email Failed!", E_USER_WARNING); //die("ERROR SENDING"); }
-
try my last script. should fix it, it won't change limit to LIMIT, but at the same time it won't affect LIMIT at all!