Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by jasonc

  1. I thought that at first but there is a large unsubscribe link (three times the size of other text) which is why I placed it on a line of its own at the bottom of the email. The length of the email is never more than one standard screen length. I manually sent the mailshot from my pc to a few that bounced back as it was thought to be spam and the person got it. We even contacted a few of them by phone to see if they were filtering any email but no one is. But still it does not explain why say 20 fail one time and another ten fail yet another time, rarely two return from the same email address. Just a thought... So if the server was to auto send out say 100 and a number of them returned undelivered due to it might be spam, should I stop there and then from sending out any more from that batch to be sent and wait a short time before resuming to prevent some of the rest from being seen as possible spam?
  2. Setup of the email takes no more than a few minutes. My host has already set up SPF and DKIM. As for bounce rate one bounce and I have to manually check the returned email to decide if the customers email address (if exists still) will get any more emails. Out of the 500 ish subscribers we might get 2 or 3 that come back as no longer found as the employee does not work for that company anymore. The ones that I am worried about are the 20 or 30+ that come back and not delivered due to spam score rating. They are completely random and not the same customer email. Otherwise it would be that these customers are marking it as such.
  3. This has been an ongoing issue from the start. When I try to login I enter the username and password and click login, then get taken back to the login page to reenter the same details and the second time I click login I get logged in. Now if I then log out and close window and wait a few seconds, restart again and try to log in, I get in first time. I believe this could be a session issue but I thought unsetting the unset($_SESSION['admin']); would cause the session to be lost and have to start again. I just can not get my head around what is causing it. Can anyone tell me what I might be doing wrong ? I have a redirect to originating page, so if I was to view a previous page within the admin area I have to log in and then once loggeed in it will redirect to the page I was on before. Here are my scripts. adminCreateCampaign.php <?php session_set_cookie_params(0, '/', '.****.com'); session_start(); error_reporting(-1); define('site_title', 'Admin '); define('pageTitle', 'Admin '); $_SESSION['loginRedirect'] = "adminCreateCampaign.php"; include("functions-for-email.php"); $checkAdminStatus = checkAdminStatus($mysqli); if(!isset($_SESSION['admin']) || $checkAdminStatus == "NOACCESS") { $_SESSION['error'] = 'You must be logged in to view that page. (el.S1)'; //$_SESSION['loginRedirect'] = "showStats.php"; //echo("You must be logged in to view that page. (el.S1)<br>"); exit; @mysqli_close($mysqli); header('Location: ' . adminFullWebAddress . '/index.php'); exit; } else { if($_SESSION['admin']['account_type'] != 'admin') { $_SESSION['error'] = 'You do not have the priviledges to view that page. (el.S2)'; @mysqli_close($mysqli); header('Location: ' . adminFullWebAddress . '/index.php'); exit; } } ?> <!DOCTYPE> <html> <head> <link href="adminstyle.css" rel="stylesheet" type="text/css" /> <title><?php echo(site_title); ?></title> </head> <body> <div id="container"> <div class="containerInner"> <div id="leftInner100"> <?php // start of leftInner ?> <?php menu(); ?> <h1 class="middleTitle">Admin </h1> <?php if(isset($thisError)) { echo '<div class="errorDiv">',$thisError,'</div>'; unset($thisError); } if(isset($thisSuccess)) { echo '<div class="successDiv">',$thisSuccess,'</div>'; unset($thisSuccess); } ?> <br><br> </div><?php // end of leftInner ?> </div><?php // end of containerInner ?> <div class="clearfix"></div> </div><?php // container ?> </body> </html> <?php @mysqli_close($mysqli); ?> index.php <?php session_set_cookie_params(0, '/', '.****.com'); session_start(); error_reporting(-1); include("functions.php"); $checkAdminStatus = checkAdminStatus($mysqli); //$_SESSION['loginRedirect'] = adminFullWebAddress . "/index.php"; $fromlink4 = isset($_SERVER['REMOTE_ADDR']) ? (gethostbyaddr($_SERVER['REMOTE_ADDR'])) : "empty"; $ipAddress = $_SERVER['REMOTE_ADDR']; if(isset($_POST['email'])) { $email = $_POST['email']; $email = strip_tags($email); } else { $email = ""; } if(isset($_POST['pass'])) { $password = $_POST['pass']; $pass = $_POST['pass']; } else { $pass = ""; } if(isset($_POST['login']) && trim($_POST['login']) == 'Login') { $checkEmail = db_query($mysqli, "SELECT `adminid` FROM `admins` WHERE `email` = '" . $mysqli->real_escape_string($email) . "' LIMIT 1"); $checkBanned = db_query($mysqli, "SELECT `adminid` FROM `admins` WHERE `email` = '" . $mysqli->real_escape_string($email) . "' AND `suspended` = 'Yes' LIMIT 1"); $failedLoginCounter = 0; if(!$email) { $thisError = 'Please enter your e-mail address.'; } else if(! $checkEmail->num_rows) { $thisError = 'Either the email address, password or both were not entered correctly.'; } else if(!$password) { $thisError = 'Please enter your password.'; } else if($checkBanned->num_rows) { $thisError = 'Your account has been suspended by Admin.'; } else { $password = md5($password); $checkAccount = db_query($mysqli, "SELECT * FROM `admins` WHERE `email` = '" . $mysqli->real_escape_string($email) . "' AND `password` = '" . $mysqli->real_escape_string($password) . "' LIMIT 1"); if($checkAccount->num_rows) { $saveChanges = db_query($mysqli, "UPDATE `admins` SET `lastlogindatetime` = '" . $mysqli->real_escape_string(datetimenow) . "', `lastAccessSinceLogin` = '" . $mysqli->real_escape_string(datetimenow) . "', `lastloginip` = '" . $mysqli->real_escape_string($ipAddress) . "', `failedLoginCounter` = 0 WHERE `email` = '" . $mysqli->real_escape_string($email) . "' LIMIT 1"); // set lastlogindatetime $_SESSION['admin'] = $checkAccount->fetch_assoc(); $loginRedirect = isset($_SESSION['loginRedirect']) ? $_SESSION['loginRedirect'] : ""; $_SESSION['success'] = 'You are now logged in. (ok.L2) ' . $loginRedirect; header('Location: ' . adminFullWebAddress . '/' . $loginRedirect); exit; } else { $thisError = 'Your e-mail address and/or password is incorrect.<br>If you still face issues, you can <a href="startresetpw.php">reset your password</a>'; $saveChanges = db_query($mysqli, "UPDATE `admins` SET `failedLoginCounter` = `failedLoginCounter` + 1, `lastloginfailedip` = '" . $mysqli->real_escape_string($ipAddress) . "', `lastlogindatetimeFailed` = '" . $mysqli->real_escape_string(datetimenow) . "' WHERE `email` = '" . $mysqli->real_escape_string($email) . "' LIMIT 1"); // set lastlogindatetimeFailed } } } if(!isset($_SESSION['admin'])) { define('site_title', 'Login'); define('pageTitle', 'Login'); } else { define('site_title', 'Home'); define('pageTitle', 'Home'); } ?> <!DOCTYPE> <html> <head> <link href="adminstyle.css" rel="stylesheet" type="text/css" /> <title><?php echo(site_title); ?></title> </head> <body> <div id="container"> <div class="containerInner"> <div id="leftInner100"> <?php // start of leftInner ?> <div id="mainphoto"><?php //specialMessage($mysqli); mainPageImage(""); ?></div> <div class="clear"></div><?php if(isset($_SESSION['admin'])) { menu(); } if(isset($thisError)) { echo '<div class="errorDiv">',$thisError,'</div>'; } if(isset($thisSuccess)) { echo '<div class="successDiv">',$thisSuccess,'</div>'; } unset($thisError); unset($thisSuccess); if(!isset($_SESSION['admin'])) { ?> <div style="width: 100%; margin: 0em auto; text-align: center;"> <form method="POST" action="index.php" style="width: 15em; text-align: center;"> <div class="field"> E-mail Address </div> <div class="value"> <input type="text" name="email" value="<?php if(isset($_POST['email'])) { echo $email; } ?>" style="width: 12.5em;" title="email"> </div> <div class="field"> Password<br><span style="font-size: 0.8em;"><?php if (isset($_POST['pass'])) { echo('<strong style="color: red;">'); } ?>(Please note: your password may be CaSe SeNSitIvE)<?php if (isset($_POST['pass'])) { echo('</strong>'); } ?></span> </div> <div class="value"> <input type="password" name="pass" value="" style="width: 12.5em;" title="pass"> </div> <div><br><input type="submit" name="login" value="Login"> <input type="reset" value="Clear"><br></div> </form><br> <div class="clearFloat"></div> </div> <?php } else { ?>logged in<?php } ?> <br><br> </div><?php // end of leftInner ?> </div><?php // end of containerInner ?> <div class="clearfix"></div> </div><?php // container ?> </body> </html> <?php @mysqli_close($mysqli); ?> functions.php <?php define('showOutput', 0); include("/home/****/db_login_functions.php"); define('db_table_name', 'clientList'); define('mailHost', 'mail.****.com'); define('mailUsername', 'noreply@****.com'); define('mailPW', '****'); define('bounce', 'bounce@****.com'); define('fullDomain', 'https://www.admin.****.com'); define('adminFullWebAddress', 'https://www.admin.****.com'); define('adminEmail', 'admin@****.com'); define('fromEmail', 'noreply@****.com'); define('fromName', 'DO NOT REPLY'); define('REMOTEADDR', isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''); define('PHPSELF', $_SERVER['PHP_SELF']); define('HTTPREFERER', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "not set"); define('unsub', 'https://www.****.com/unsub.php'); define('securityhash', 'abc'); // NEVER change this securityhash. date_default_timezone_set('Europe/London'); define('datetimenow', date("Y-m-d H:i:s")); /* check if user is allowed to access a certain page or not. */ function checkAdminStatus($mysqli) { $yesNo = ""; if(isset($_GET['action']) && $_GET['action'] == 'logout') { unset($_SESSION['admin']); $_SESSION['success'] = 'You have successfully logged out. (lo.1)'; header('Location: index.php'); exit; } if(isset($_SESSION['admin']) ) { // need to add in code to check if logged in for more than 1 hour, if so log out on next refresh of page. if ($_SESSION['admin']['lastAccessSinceLogin'] < date( 'Y-m-d H:i:s', strtotime("-5 minutes") )) { unset($_SESSION['admin']); $_SESSION['error'] = 'You were logged out due to no activity, please login again to view that page. (lo.2)'; header('Location: index.php'); exit; } $checkBanned = db_query($mysqli, "SELECT `adminid` FROM `admins` WHERE `email` = '" . $mysqli->real_escape_string($_SESSION['admin']['email']) . "' AND `suspended` = 'Yes' LIMIT 1"); if($checkBanned->num_rows) { $yesNo = "NOACCESS"; //$_SESSION['error'] = 'You must be logged in to view that page.'; } else { $yesNo = "ACCESS"; // if logged in, update `users`.`lastAccessSinceLogin` with current datetime. $updateLastAccessSinceLogin = db_query($mysqli, "UPDATE `admins` SET `lastAccessSinceLogin` = '" . $mysqli->real_escape_string(datetimenow) . "', `lastloginip` = '" . $mysqli->real_escape_string(REMOTEADDR) . "', `failedLoginCounter` = 0 WHERE `email` = '" . $mysqli->real_escape_string($_SESSION['admin']['email']) . "' LIMIT 1"); $_SESSION['admin']['lastAccessSinceLogin'] = datetimenow; } } return $yesNo; } function menu() { echo('<a href="index.php?action=logout">Log Out</a>&nbsp;&nbsp;&nbsp;&nbsp;'); echo(' <a href="adminCreateCampaign.php">Create Campaign</a><br><br><br>'); } ?> .htaccess (within the admin folder) Header set Access-Control-Allow-Origin "*" RewriteEngine On RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain to use www. # [NC] is a case-insensitive match RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] ### DON'T DELETE!! Below entry is MUST for your PHP sites like wordpress,joomla and etc to work properly. suPHP_ConfigPath /home/****/php.ini .htaccess (within the root folder) Header set Access-Control-Allow-Origin "*" RewriteEngine On RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don't put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain to use www. # [NC] is a case-insensitive match RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] ### DON'T DELETE!! Below entry is MUST for your PHP sites like wordpress,joomla and etc to work properly. suPHP_ConfigPath /home/****/php.ini the php.ini file allow_url_fopen = on allow_irl_include = on date.timezone = Europe/London safe_mode = off upload_max_filesize = 20M post_max_size = 20M upload_tmp_dir = "/home/****/tmp" session.save_path = "/home/****/sessions" session.use_only_cookies = on error_reporting = E_ALL log_errors = On display_errors = Off track_errors = On error_log = "/home/****/errors.log" sendmail_from = "server@****.com"
  4. Oh almost forgot... There are about 500 in the list and we only send out about 4 or 5 emails a year. So paid option is out of the question.
  5. There are around 500 in the list. We are currently using the server to send out emails, one every minutes (cron job). The issue is that a lot of them return due to possible spam. I have the email sent using the actualy email login and tls. But as with shared servers it gets added to block lists a lot. Sometime ago we used a few of the free email services but a lot of them have their advertising in which we wanted to do with out, so opted for the method we have now. I have a custom link in the email so they can quickly unsubscribe. But looking as mailchimp and a few others none allow for custom stuff like that from what I read. I was wondering if ther is a config issue from our end that might cause it to be seen as spam, which it is not as they subscribed to it in the first place. as for MTA the server uses a system called relay.mailchannels.net ---- Now if I was to send the email manually from my computer exact content as the automated one sent from the noreply address it goes through fine. So I understand it is the servers IP that is the issue. Is there a way to have the email sent like it was sent from my pc ?
  6. We use a shared server and have the same problems as many like us with emails not being delivered as it is seen as possible spam. What pc installed software is suggested to use to send out out emails to out mailing list but allows us to customise each email to the user. The only few differences is the greeting text (Hi.. John) and the unsubscribe link that contains their email address and a hash that is stored on our server so we know that it is most likely them wanting to be removed. The emails are all in HTML (tabled) format. Please suggest what programs you use. Thank you
  7. With the new GDPR in place for site owners, should all sites have a contact page/means to make contact site owners ? Is it somewhere in the policy that this is so ? if so where ?
  8. I have looked at the children() link but its gone completely over my head. It looks like the only way I can do this is the long way and search the html code for the <dt>item7:</dt> then grab the text within the next element if the text was found. I was just wondering if there was an easier way of doing this without all the extra code.
  9. The code is from a third-party site which I wish to get certain content from. I am wanting to search within the "b" class (there is only on in the source code!) for the <dt>item7</dt> then grab the content of the element that follows it. the otherwise return an empty string $b = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html"> <head> </head> <body> <div class="b"> <dl> <dt>item1:</dt><dd>1</dd> <dt>item2:</dt><dd>2</dd> <dt>item3:</dt><dd>3</dd> <dt>item4:</dt><dd>4</dd> <dt>item5:</dt><dd>5</dd> <dt>item6:</dt><dd>6</dd> <dt>item7:</dt><dd>7-</dd> <dt>item8:</dt><dd>8</dd> <dt>item9:</dt> </dl> </div> </body> </html> '; $b = new SimpleXMLElement($b); echo $b->dl->dt; // echo the content of <dd> only if the previous <dt> node has the text 'item7' in it.
  10. If I done a JSFiddle it would be the same code. I recreated the same problem using my original code and stripped out everything that was not needed to show my issue. The right side select is the issue. I am wanting the options 'container' to be right aligned to the select as shown in the image I added in the OP
  11. For the sake of simplicity I have used instyle. I am wanting the right side select to have its option 'container' to be moved over to the left so it is like that in the image in my first post. <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> .form2 { width: 200px; margin: 0 auto; padding: 0.5em 0.5em 0.5em 0.5em; } .form2 input.field { float: left; width: 100%; height: 2em; border: 0.02em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } .form2 select { } .form2 select.field { float: left; width: 100%; height: 2em; border: 0.02em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } </style> </head> <body> <form class="form2" id="form2" name="form2" method="post" action=""> <div style="float: left; width: 48%;"><select class="field" title="Select Stairs, Lift or N-A" name="stairliftna" id="stairliftna"><option value="Select Stairs, Lift or N-A">Select Stairs, Lift or N/A</option><option value="Stairs">Stairs</option><option value="Lift">Lift</option><option value="n-a">N/A</option></select><br><br> </div> <div style="float: left; width: 4%;"> </div> <div style="float: left; width: 48%;"><select class="field" title="Select Packing service" name="packingservice" id="packingservice"><option value="Select Packing service">Select Packing service</option><option value="Self packing">Self packing service</option><option value="Part packing">Part packing service</option><option value="Full packing service">Full packing service</option></select><br><br> </div> <br class="clearFloat"> </form> </body> </html>
  12. I have been looking via google and this forum but still no closer to finding the answer to this. I have a select that is in the right side of my page but the options are jumping out to the right side of the page. So I am looking to get the 'container' moved to the left so it is aligned to the right of the select.
  13. Hi, Are you still looking for a coder ? Cheers Jason
  14. I wish to read all data from a DB table and display it. Displaying each record, if there is a character is between x0 and x7F then wrap it in a span that will highlight it using CSS.
  15. I wish to highlight the special characters that fall within the following range x00 to x7F Please can someone advise how could I do this ?
  16. I downloaded Netbeans and installed it and like the look of it. I have not had an major issues with uploading any of my custom written files directly to the server using DW. (from the errors point of view) I would really like to have it all setup just like I had with DW, where I edit the files and it saves it locally and then immediately to the server. I have yet to go through all the settings to see what under the hood. But did see something about saving locally for some testing server or something, will have to check that again. Think I will check a bit more of the help pages as well. Are any of the settings files of the project saved to the server ? Change is good sometimes but only if it does not take away some of the original features that I was use to.
  17. I do see your point.. but I like the features of DW. Also the ability of of being able to upload files, folder within the editor at the same time.
  18. When I open a file be it a html or in most of the cases a PHP file the view changes to what it was saved as. So say I have indented a portion of text to 2 or 3 or more tab indents and save the file. When I open it again in dreamweaver the tabs are still there, but the whole portion that was indented is now brought to the next line and taken to the first column and not indented as it was previously saved. If I enit the file in notepad and open it the file is how it was saved as I wanted it. But opening this file in DW and the code gets changed. I have looked through a lot of the settings nad can not find anything that has helped stop this. Even the do not change files with certain extentions stops it. Is there another setting that I have missed that will stop this ?
  19. Please can someone advise how I correctly access each of the nodes in an XML file. echo($geoLocXML->isp . '<br>'); this is what I used before and it worked up to last month, then all of a sudden it failed. I have also tried this code on a different server and it fails there too, so it suggests there is an error in the code, but for the life of me I can not find it. <?php //exit; error_reporting(-1); //$ip = $_SERVER['REMOTE_ADDR']; //$geoLocXML = getGeoLocXML($ip); //->result[0]; //$geoLocXML = file_get_contents('http://api.geoiplookup.net/?query='.$ip); $getGeoLocXML = simplexml_load_file('http://www.mysite.com/getGeoLocXML.xml'); /* $getGeoLocXML = '<?xml version="1.0" encoding="iso-8859-1"? > <ip> <results><result><ip></ip><host></host><isp>Provider</isp><city>My City</city><countrycode>GB</countrycode><countryname>United Kingdom</countryname><latitude>123.123</latitude><longitude>-1.123</longitude></result></results> </ip> '; */ $geoLocXML = $getGeoLocXML->result[0]; echo($geoLocXML . '<br>'); echo($geoLocXML->isp . '<br>'); echo($geoLocXML[city] . '<br>'); echo($geoLocXML[countryname] . '<br>'); /* <results> <result> <ip></ip> <host></host> <isp>Provider</isp> <city>My City</city> <countrycode>GB</countrycode> <countryname>United Kingdom</countryname> <latitude>123.123</latitude> <longitude>-1.123</longitude> </result> </results> */ ?> <?xml version="1.0" encoding="iso-8859-1"?> <ip> <results><result><ip></ip><host></host><isp>Provider</isp><city>My City</city><countrycode>GB</countrycode><countryname>United Kingdom</countryname><latitude>123.123</latitude><longitude>-1.123</longitude></result></results> </ip>
  20. Hi please can you let us know the content of your logout.php file as this is where the error is, as stated in the error message. It's likely that there is some output too soon,
  21. The £ is showing as a diamond for one, I'll have to check for the other characters.
  22. ALTER TABLE `tablename` CONVERT TO CHARACTER SET utf8 [COLLATE utf8_general_ci] I used this but still the text in the data is not showing on the webpage as that of a new entry that is added via my CMS area.
  23. All tables and databases are set to utf-8. Adding/editing new entries is working ok. The actual data in the database which was added ages ago is still in the old format. Is there a way to convert the previous existing data before I changed to the correct method of storing the data.
  24. Yes my page is html5, but some of the code was outdated. It seems that so far all information that I add as new is being stored as is, no change to the text apart from escaping before being added and when displayed all looks ok and of the scripting text I tried this also shows as html entities in the source code. All good so far. But still there is the issue of all the entries in the database that was incorrectly stored. How would I start to convert it to normal text as it would be if I had entered it as of now. £ instead of the chr(163) which shows on the page as a diamond with question mark in it. and the other unicode characters.
  • 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.