Jump to content

whitedragon101

Members
  • Posts

    21
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

whitedragon101's Achievements

Member

Member (2/5)

0

Reputation

  1. I got this reply back on another forum Would this not be secure? They would have to know the page address and then crack a long password. Isn't that what would be required to break the ssh? i.e know the port then brute force the secret key. If the index was disabled on htaccess wouldn't the page address have to be brute forced as well? e.g www.mywebsite.com/ri13t673gr672tf762g7676f2i37fggreg23i7f623/index.php (Only asking as this way seems easier, but if its not secure I'll go ssh)
  2. What would you recommend for securing access to phpMyAdmin? I am the developer and need remote access to phpMyAdmin which is on a server in another country (a linux machine with a LAMP stack at the owners office). At the moment for development it's just an internet accessible url and a username and password. a) restrict access to phpMyAdmin to localhost and ssh into the server to get access b) Allow access via an internet url and use 2 factor authentication (probably Google Authenticator) c) keep it as username and password with public url and use a crazy long password to protect against brute force
  3. Don't want to code a forum from scratch for no reason. Just wondered if anyone had any particular recommendations for what forum they prefer to use.
  4. Hi, I have finished a webshop (coded in php, Javascript, MySQL) for a client and they want to add a Forum . Does anyone have any recommendations for a free forum I can just drop in with minimal setup ? In an ideal world it would be good if it used MySQL so I can create a forum account at the same time they create their customer account, but its not the end of the world if that's not possible. Many thanks
  5. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table3 LEFT JOIN (SELECT lga_id , COUNT(schools.school_id_p) as num_of_scho' at line 15
  6. MYSQL Version : 5.0.91 I have two queries which run fine however when I alias them and left join them I get a syntax error : QUERY_1 SELECT * FROM( (SELECT lga_id , COUNT(school_id_p) as num_of_schools_unapproved FROM schools WHERE EXISTS ( SELECT * FROM orders WHERE approved = 'no' AND schools.school_id_p = orders.school_id) GROUP BY lga_id) AS table1 LEFT JOIN (SELECT lga_id_p, name FROM lga) AS table2 ON table1.lga_id = table2.lga_id_p ) produces: lga_id num_of_schools_unapproved lga_id_p name 2 2 2 lga_name2 4 1 4 lga_name4 5 1 5 lga_name which is correct QUERY_2 SELECT lga_id , COUNT(schools.school_id_p) as num_of_schools FROM schools GROUP BY lga_id produces : lga_id num_of_schools 1 5 2 5 3 5 4 5 5 5 6 3 7 2 which is correct. However when I try to call them table3 and table 4 and do a LEFT JOIN on the lga_id I get a syntax error. Any help much appreciated : SELECT * FROM( SELECT * FROM( (SELECT lga_id , COUNT(school_id_p) as num_of_schools_unapproved FROM schools WHERE EXISTS ( SELECT * FROM orders WHERE approved = 'no' AND schools.school_id_p = orders.school_id) GROUP BY lga_id) AS table1 LEFT JOIN (SELECT lga_id_p, name FROM lga) AS table2 ON table1.lga_id = table2.lga_id_p ) AS table3 LEFT JOIN (SELECT lga_id , COUNT(schools.school_id_p) as num_of_schools FROM schools GROUP BY lga_id) AS table4 ON table3.lga_id = table4.lga_id )
  7. Bingo it works. Its always the stupid stuff that gets you Is this how these styled corporate emails are generally done. Just send out html in the email itself? Or do they use an iFrame or other such container linked to an html page on their servers? I have already got the first row out when I wrote the MySQL query. I only do it that way so when I do my loops down the page I can just copy and paste the row name $query_email = "SELECT email FROM customer WHERE email_yes_or_no != 'no' "; $email_result = mysql_query($query_email, $jobconnect) or die(mysql_error()); $row_email = mysql_fetch_assoc($email_result); $totalRows_email_result = mysql_num_rows($email_result); Thanks thorpe
  8. I am looping through the emails so there is a do loop at the bottom of each getting a new address for each MySQL row. All three codes send the email, and all three only display the html markup itself but not styled text. Code 1 //define the receiver of the email //define the subject of the email $subject = 'Test HTML email'; //create a boundary string. It must be unique //so we use the MD5 algorithm to generate a random hash $random_hash = md5(date('r', time())); //define the headers we want passed. Note that they are separated with \r\n $headers = "From: $from\r\nReply-To: $from"; //add boundary string and mime type specification $headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; //define the body of the message. ob_start(); //Turn on output buffering ?> --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello World!!! This is simple text email message. --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <h2>Hello World!</h2> <p>This is something with <b>HTML</b> formatting.</p> --PHP-alt-<?php echo $random_hash; ?>-- <? //copy current buffer contents into $message variable and delete current output buffer $message = ob_get_clean(); do{ $email= $row_email['email']; $to=$email; $sentmail = @mail($to,$subject,$message,$headers); } while($row_email = mysql_fetch_assoc($email_result)); Code 2 $from = $row_company_details['email']; $name=$_POST["name"]; $subject="hello"; //$message = file_get_contents('http://www.holtrecruitment.com/TEST_RECRUITMENT/webpages/management_area/newsletter.php'); $message = "<p>Hello</p>"; $headers="From:$name <$from>\r\n"; $headers .= "Reply-To: $from\r\n"; $headers .= "Date: " . date("r") . "\r\n"; $headers .= "Return-Path: $from\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Message-ID: " . date("r") . $_SERVER["name"]."\r\n"; $headers .= "Content-Type: text/html; charset=utf-8\r\n"; $headers .= "X-Priority: 1\r\n"; $headers .= "Importance: High\r\n"; $headers .= "X-MXMail-Priority: High\r\n"; $headers .= "X-Mailer: PHP Mailer 1.0\r\n"; //////////////////// //message do{ $email= $row_email['email']; $to=$email; $sentmail = mail($to,$subject,$message,$header); } while($row_email = mysql_fetch_assoc($email_result)); Code 3 $from = $row_company_details['email']; // $HTML = file_get_contents('http://www.holtrecruitment.com/TEST_RECRUITMENT/webpages/management_area/newsletter.php'); $HTML = "<p>THis is a test</p>"; $headers = "From: $from\r\n"; // Now we specify our MIME version $headers .= "MIME-Version: 1.0\r\n"; // Create a boundary so we know where to look for // the start of the data $boundary = uniqid("HTMLEMAIL"); // First we be nice and send a non-html version of our email $headers .= "Content-Type: multipart/alternative;". "boundary = $boundary\r\n\r\n"; $headers .= "This is a MIME encoded message.\r\n\r\n"; $headers .= "--$boundary\r\n". "Content-Type: text/plain; charset=ISO-8859-1\r\n". "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode(strip_tags($HTML))); // Now we attach the HTML version $headers .= "--$boundary\r\n". "Content-Type: text/html; charset=ISO-8859-1\r\n". "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode($HTML)); do{ $email= $row_email['email']; $to=$email; $sentmail = mail($to,$subject,"",$header); } while($row_email = mysql_fetch_assoc($email_result));
  9. I have tried the top 4 or 5 scripts from googling "send html email using php." Every single one results in the html markup itself being displayed as text, not as a styled page. I have many emails from companies where no matter what client I view it on I see a fully styled webpage with links and pics. How can this be achieved with php?
×
×
  • 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.