Jump to content

MDanz

Members
  • Posts

    728
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

MDanz's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. I'm attempting to reply to an email with php. I use php imap to fetch the email from the mail server and get the `message-id`.. i'm attempting to reply to the email but the email still shows up as a new message rather than a reply with threaded messages? $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to email: ' . imap_last_error()); $emails = imap_search($inbox,'ALL'); if($emails) { rsort($emails); foreach($emails as $email_number) { $overview = imap_fetch_overview($inbox,$email_number,0); $message_id = $overview[0]->message_id; $references[] = $overview[0]->message_id; } $references = implode(" ",$references); $headers = "From: <test@domain.co.uk> \r\n"; $headers .= "In-Reply-To: $message_id\r\n"; $headers .= "References: $references\r\n"; $headers .= "Content-Type: text/html;\r\n"; $subject = "testing"; $message = "test message2"; mail( "test2@domain.co.uk", $subject, $message, $headers ); How do i solve? I'm using the headers from http://www.jwz.org/doc/threading.html.
  2. The way my clients website is set up it has /public_html/website 1 /public_html/website 2 /public_html/wp-content /public_html/website 3 The website i want to mod rewrite on is /public_html/wp-content. If i put a .htaccess file in /wp-content will that override the .htaccess file in the public_html folder? Thanks for help
  3. It's an assumption, in my .htaccess file in the root folder i have several of the below code written. So i don't know which one to change for the specific domain. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Is there a workaround of putting .htaccess in wp-content folder?
  4. I have multiple folders(domains) in my public_html folder. In my public_html folder i have a .htaccess file. I want to do mod rewrite on a specific domain e.g. www.test.com Here is the mod rewrite wordpress has written for each domain # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress The above code is in my .htaccess file multiple times, so i don't know which one to edit. I want to add the below code to the domain www.test.com but i don't know which one to edit. RewriteRule ^page/(.*) ads/page/$1 [R=301,L] RewriteRule ^page/(.*)/ ads/page/$1/ [R=301,L] What is the solution? Any help, greatly appreciated.
  5. OK...Can the queries have different amount of JOINS? e.g. SELECT child.id, child.name, child.colour FROM fruit child LEFT JOIN tree parent on parent.type=child.type LEFT JOIN country parent2 on parent2.name=parent.country UNION SELECT child.id, child.manufacturer, child.colour FROM car child LEFT JOIN country parent on parent.name=child.country ORDER BY colour
  6. Is the column structure only required in the SELECT or do i have to have the same amount of JOINS for each query?
  7. I'm trying to do a following feed. This feed includes posts and comments that the user is following. The first 3 following types are in the content table and the last following type is in the comments table. This query fetches the first 3 following types successfully. $construct = $connectdb->prepare("SELECT parent.* FROM `content` as parent JOIN followers ftable on ( (ftable.parent_id=parent.sid AND ftable.userposts='1') OR (ftable.`parent_id`=parent.pageid AND ftable.topic='1') OR (ftable.parent_id=parent.pageid AND ftable.page='1') ) AND ftable.userid=:userid WHERE parent.deleted='0' GROUP BY parent.id ORDER BY parent.posted DESC"); This query fetches the following comments type successfully $construct = $connectdb->prepare("SELECT parent.* FROM `comments` as parent JOIN followers ftable on ftable.parent_id=parent.postid AND ftable.comments='1' AND ftable.userid=:userid WHERE parent.deleted='0' ORDER BY parent.posted DESC"); How do i combine the two queries? In this feed i want the results to be ORDER by posted DESC.
  8. I always have trouble reading shorthand statements, as i am used to always using brackets. So when i view someones code and they use shorthand, i get confused. Can i get a clear explanation on the example below: if ( have_posts() ) : while ( have_posts() ) : the_post(); the_content(); endwhile; else: echo "<p>Sorry, no posts matched your criteria.</p>"; endif; I've always been accustomed to using brackets, so i have trouble understanding the above quickly.
  9. I've always used brackets but now switching to WordPress alot of the code doesn't use brackets in if statements and loops. <?php while (have_posts()) : the_post(); the_content(); endwhile; ?> How does this look with brackets? Also i see alot of question marks, i know question marks and colons are another way of coding, for example if($one == $two) { $yes = 1; } else { $yes = 2 ; } Any help to get me to understand this
  10. ok thanks, so i have to have register an account offline on this machine, so i can login with an account offline on this machine?
  11. I just installed wamp, so i can test my website offline. Now i get numerous Undefined index or Undefined variable errors, which i know how to fix. Now logging in works online but with wamp it doesn't work. The code isn't wrong. I imported the database online to offline. I've pin pointed what is wrong but don't know how to solve it. here is the code where i test if the login details are correct. $Blowfish_Pre = '$2a$05$'; $Blowfish_End = '$'; $hashed_password = crypt($password, $Blowfish_Pre . $salt . $Blowfish_End); //check to see if they match if ($username==$dbusername&&$hashed_password==$dbpassword){ Offline the echoed $hashed_password for the account is $2pozHhRA6bDM Online the echoed $hashed_password for the account is $2J7rPSsTYb1Q I've determined crypt is working differently online than it is offline? I am using the same php version both online and offline(php 5.2.17), Why is this and how can i solve it? I've been stuck on this all day. My website works perfectly online though.
  12. I currently have it that when a user logs in their username and userid are stored in a cookie. As this isn't the most secure method i now plan on changing the method; When the user logs in, a unique token is saved in the cookie. The username, userid, banned boolean and unique token are stored a session. The token in the cookie has to match the token in the session to be logged in. I've thought about storing the token in the database? Alot of times in my code i quickly require the username and userid, so storing in a session is the most logical idea to me instead of always querying the database. Anyway, is my method appropriate?; if not, what is a proven method? I understand that if i want to do 'remember me' i have to have the token stored in the db? Any help appreciated.
  13. The below prepared statement doesn't insert into the database. $sid =1; $sid2 = $GET['sid2']; //empty $position = 0; $name = "John"; $new = $connectdb->prepare("INSERT INTO `table1` VALUES ('',:sid,:sid2,:position,:name)"); $new->execute(array(':sid'=>$sid,':sid2'=>$sid2,':position'=>$position,':name'=>$name)); When i add quotations to execute array values, then the insert works. $new->execute(array(':sid'=>"$sid",':sid2'=>"$sid2",':position'=>"$position",':name'=>"$name")); What i want to know is by adding quotations does this affect PDO's sanitization?
  14. Do i have to use ENT_QUOTES with htmlspecialchars in the example below? I haven't use ENT_QUOTES in code similar to the example, do i have to change this? $var = htmlspecialchars("the title"); //user title <div data-title='$var'>$var</div>
  15. thanks, so that is for pages with privileges? Do i need to change any of my code regarding session/cookie security for just regular login?
×
×
  • 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.